encrypt- decrypt with AES using C/C++

Yannis Assael picture Yannis Assael · Mar 22, 2010 · Viewed 89k times · Source

How can I encrypt and decrypt a file with a 256 key AES in C or C++?

Answer

Thomas Pornin picture Thomas Pornin · Mar 22, 2010

If you are just after AES and do not mind losing flexibility (i.e. you will not replace it with another cryptographic algorithm at some time) then Brian Gladman's AES implementation is a popular choice (both for performance and portability). This is the kind of code which you embed in your own source code.

On the external libraries front, you have plenty of choice, including NSS, OpenSSL, Crypto++... the latter is specifically designed for C++, while the two others are meant for C.