in my opinion the following is what you are searching:
http://vchav.wordpress.com/2008/05/14/r ... ecryption/remember only to modify a bit the #include in case you see errors (like u_char).
you need openssl and you must specify the libcrypto.a -lgdi32 libraries when you compile it