Encrypted OpenSSL Streams

Does anyone know a good implementation for C ++ encrypted streams using OpenSSL ? Something that extends or wraps std :: istream and std :: ostream ?

I know that this can be done with boost (filtering stream), but I don’t want to enable boost just for that. Any unmanaged suggestions?

+8
c ++ iostream openssl
source share
3 answers
+2
source share
+1
source share

If you want to do it yourself:

Subclass std :: streambuf for use with TCP or SSL (they basically work the same after opening the socket. Then you can do std :: istream and std :: ostream using this streambuf. If you don't want std :: iostream, you can make two streambufs, one for input and one for output.

std :: streambuf docs (basically just focus on overflow and stream): http://www.cplusplus.com/reference/streambuf/streambuf/

And a little tutorial on how to use libssl directly.

http://www.ibm.com/developerworks/linux/library/l-openssl/index.html

+1
source share

All Articles