This is a work in progress!
A purely educational (NOT SECURE!) implementation of AES, favouring code readability over performance. Additionally, the SHA256 hash algorithm was implemented as well to generate keys from passwords. While SHA256 might not be the most conventional choice to generate AES Keys, it is one of the most commonly used hashing algorithms and given the educational nature of this little project I thought it was a fine choice.
Current State
- Basic Encryption/Decryption of a arbitrary length data (not cleaned up and improved yet)
- SHA256 Hashing of arbitrary bytes, only prototype not cleaned up yet
- Input via command line, prototype
- Not implemented:
- Variable key length (only AES at this point in time)
- No input/output capabilities, encrypted data and keys are hardcoded arrays
- No block modes yet (Stuck in simple ECB mode so far)
Sources used
- The NIST AES specification:
- Understanding Cryptography by Christof Paar:
- Supplemental lectures on Christof Paars YouTube channel:
- For the key schedule:
- Reference implementation for debugging:
- Test vectors by NIST:
- Math behind the mix column step:
- The NIST Secure Hashing specification (SHA1/2 families):
- This amazing video about SHA256:
- A great step-by-step breakdown of SHA256, very helpful as validation/test data: