Re: AES Encryption
- Posted by ghaberek (admin) Jul 21, 2023
- 690 views
Well vcPkg has a libtomcrypt package. However it only compiles as a .lib file. I looked into Microsoft Seal, but its very C Plus Plus codebase.
Building libtomcrypt on Windows is pretty simple but there are a few small caveats. libtomcrypt.dll depends on libtommath.dll so you need to build that first. The makefile for libtomcrypt is specifically looking for ../libtommath and you can technically override this but it's easier to just rename the directories after you extract them. Just make sure they're next to each other. Probably not an issue if you're cloning the repo from GitHub instead of using the zip files.
Here are the steps I used to build both libraries:
tdm-gcc
- Install TDM-GCC 10.3.0 first if you don't have it already
libtommath
- Download and extract ltm-1.2.0.zip
- Rename libtommath-1.2.0 to simply libtommath
- cd libtommath and build the library:
mingw32-make -f makefile.mingw -j4 libtommath.dll
libtomcrypt
- Download and extract crypt-1.18.2.zip
- Rename libtomcrypt-1.18.2 to simply libtomcrypt
- cd libtomcrypt and build the library:
mingw32-make -f makefile.mingw -j4 libtomcrypt.dll
What about OpenSSL? Or is that not have AES Encryption or is OpenSSL bigger than what is needed?
OpenSSL, as its name suggests, is primarily build to provide encrypted networking via SSL and TLS. But it only provides the encryption later and not the protocols running inside. LibCURL provides most of that on top of OpenSSL. Using OpenSSL for only its encryption features is overkill and libtomcrypt is a much simpler option.
-Greg