Posts Tagged ‘openssl’

Verify SSL certificate using OpenSSL

No Comments »

Use this command to verify the SSL certificate for the domain www.somedomain.com

openssl s_client -showcerts -connect www.somedomain.com:443

If the certificate is correctly installed the result should contain at the end:

Verify return code: 0 (ok)

That’s it


Password encrypted files in Linux

No Comments »

 

I am found of keeping password protected backups and most of the time I lost my super secret password thus unable to open my super important backups 🙂 just kidding.

Like in windows we can simple right click and zip folders/files with passwords in text based terminals of linux I always want the same.

So here is the trick I normally use.

For encrypting a file:

openssl enc -aes-256-cbc -e > out.file

It will ask for password like:

enter aes-256-cbc encryption password:
Verifying - enter aes-256-cbc encryption password:

If you want to encrypt a folder with compression (tar.gz)

tar -cz foldername | openssl enc -aes-256-cbc -e > out.tar.gz

Now the important part, decrypting your encrypted files….

openssl enc -aes-256-cbc -d -in out.file > new.file

Installing MinGW/MSYS on Windows with OpenSSL support

1 Comment »

 

Installing MinGW/MSYS
http://www.mingw.org/wiki/HOWTO_Install_the_MinGW_GCC_Compiler_Suite
http://www.mingw.org/wiki/MSYS

Install MinGW (before MSYS)

Download the MinGW Installer from http://sourceforge.net/projects/mingw/files/Installer/mingw-get-setup.exe/download

  1. Select Save File when prompted.
  2. Open the downloaded exe.
  3. Click Yes when Windows asks if you want to allow it.
  4. Click Next > on the Welcome screen.
  5. Select Download and Install and click Next >
  6. Read the License Agreement and click I agree
  7. Select Current to install the current MinGW package and click Next >
  8. Check the MinGW base tools and g++ compiler click Next
  9. Destination Folder should be C:\MinGW
  10. Click Next >
  11. Leave the default folder and click Install
  12. When Installation is complete, click Next >
  13. Click Finish

Install MSYS:

  1. Download MSYS
  2. Run the downloaded exe.
  3. Click Yes when Windows asks if you want to allow it.
  4. Click Yes you want to install in the Setup pop-up.
  5. Click Next in the Welcome Window.
  6. Read the License Agreement and click Yes
  7. Read the Information and click Next >
  8. The Default Destination of C:\msys\1.0 is fine, so click Next >
  9. The default folder of MinGW is fine, so click Next >
  10. Click Install
  11. A cmd shell will pop-up asking if you want to continue with the post install, enter y enter
  12. Answer y you do have MinGW Installed.
  13. Enter c:/mingw as the path where MinGW is installed.
  14. It should confirm that you have make.exe installed, press any key to continue.
  15. Click Finish you are done the installation. (It is up to you if you want to open the documents.)

OpenSSL

OpenSSL is a library for Secure Sockets Layer (SSL), Transport Layer Security (TLS) protocols, and cryptography. Some tools require openSSL, if so, here are some instructions:

I downloaded an openssl installer from: http://www.slproweb.com/products/Win32OpenSSL.html

I installed into /mingw/openssl/. I then linked the includes:

cd /mingw/include
ln -s ../openssl/include/openssl openssl

That's it.