aes-lib-cpp is a complete AES/Rijndael C++ implementation
The library supports the industry standard of 128 bit key sizes and runs in CBC mode
Included also is the supporting research work that was written for this project
For the Javascript version of this library see aes-lib-js
You can use the following function to encrypt a plain-text message
You will need to input your plain-text bytes, the private-key, an IV and the key size (SMALL=128, MEDIUM=192, LARGE=256)
See notes below about the data type aliases used in aes-lib-cpp
The plain-text bytes in text
are overwritten with the encrypted bytes
void AES::encryptMessage(std::vector<State*> &text, Key &privateKey, State &initialVector, KeyLength length)
Similarly, you can use the following funciton to decrypt an encrypted message
The cipher-text bytes in text
are overwritten with decrypted plain-text bytes
void AES::decryptMessage(std::vector<State*> &text, Key &privateKey, State &initialVector, KeyLength length)
There are several noteable data type aliases used in aes-lib-cpp
- BYTE:
std::bitset<8>
- State:
BYTE[4][4]
- Key:
BYTE[4][4]
- Visual Studio 2013
- Clone the aes-lib-cpp
git clone https://github.com/kyleruss/aes-lib-cpp.git
- Open the VS solution
AESImplementation.sln
- Build the solution in Visual Studio
aes-lib-cpp is available under the MIT License
See LICENSE for more details