encrypt- decrypt with AES using C/C++

91,166

Solution 1

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.

Solution 2

LibTomCrypt I think may be one of the easiest to use. I know so little about this type of work, but I was able to get it up and running fairly quickly. The thing about encryption is not the actual functions, but the flow and what to do with the information as you encrypt and decrypt. That is what makes this type of work hard, not just the fact you can encrypt things.

http://github.com/libtom/libtomcrypt

Share:
91,166

Related videos on Youtube

Yannis Assael
Author by

Yannis Assael

DPhil in Machine Learning, Oxford University.

Updated on May 10, 2020

Comments

  • Yannis Assael
    Yannis Assael almost 4 years

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

  • Yannis Assael
    Yannis Assael about 14 years
    are there any examples of crypto++ with aes?
  • Paŭlo Ebermann
    Paŭlo Ebermann over 12 years
    Could you write some sentences about this library, e.g. why you recommend it? As it is, your answer is not an answer, and would better be a comment.
  • Steffen Funke
    Steffen Funke almost 9 years
    Brian Gladman's code on github: github.com/BrianGladman/AES I just edited the link in the post.
  • Admin
    Admin over 8 years
    @ThomasPornin: Is there some tutorial how to use that Brian Gladman's implementation in my project? Thanks. Or maybe you have some advice on how?