I have a C++ application that has its own routines to send and receive data. I would like to use OpenSSL to apply AES encryption to parts of this data. Unfortunately I can’t hand over the whole connection to OpenSSL like most examples do and I can’t even give OpenSSL the socket to read the data from.
I would like to pass my data in and out as memory buffers and I also have the keys transmitted separately. Does anyone have an example how this can be done with the OpenSSL API ?
I have seen code that fiddles with the internal pointers and structures of OpenSSL, but was dependant on a certain OpenSSL version and I would very much like to avoid that.
I think you actually want to use the crypto library, which is part of OpenSSL. Here is an example of how to use it:
http://saju.net.in/code/misc/openssl_aes.c.txt