Using OpenSSL Cryptography: Blowfish, DES, RC2, RC4

If you are looking for a cryptography solutions in your project, whether it is Blowfish, DES, RC2 or RC4, perhaps, you can consider to utilize the crypto library which is provided by openssl. In this tutorial, i am going to show you how it can be easily implemented into the C++ project solution.
If you are new to OpenSSL or you haven’t compile the OpenSSL source right now, i’d strongly recommend you to read my previous post at the following link:
Compiling and Installing OpenSSL for 32 bit Windows
Let’s start the tutorial with the following steps:

Create a Win32 console application. I called my demo application “OpenSSLCryptoSample”. Btw, I am using VS C++ 2010 express in this tutorial.

Download and add the following header file into the project. This header file will consists of the core function to encrypt and decrypt the given string. Following is the code snippet of the header file.

The project may compile sucessfull now. BUT, if you try to run it, it will complaint that the application can’t start because LIBEAY32.DLL is missing. To address this issue, you may copy LIBEAY.DLL, which you can found it in the OpenSSL bin folder, to the project’s debug/release folder

Compile and run the project now and you should see the following screenshot: