https://github.com/z-40/microaes
https://github.com/z-40/microaes
aes cryptography python-3
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/z-40/microaes
- Owner: Z-40
- License: gpl-3.0
- Created: 2021-04-04T13:18:46.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2021-07-01T04:47:30.000Z (almost 5 years ago)
- Last Synced: 2025-02-25T02:07:47.999Z (over 1 year ago)
- Topics: aes, cryptography, python-3
- Language: Python
- Homepage:
- Size: 61.5 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# MicroAES
A pure python implementation of AES (Advanced Encryption Standard) with support for
128, 192 and 256 bit keys and CBC, CTR, CFB and OFB modes of encryption.
### Usage
import micro_aes
aes = micro_aes.AES(b"MyPassword", b"sAlTDaTa", 32, "sha256")
encrypted_data = aes.encrypt(b"Send Z-40 $100", "cbc", "sha256")
decrypted_data = aes.decrypt(encrypted_data, "cbc", "sha256")
print(bytes.hex(encrypted_data))
# Output: 1bbd4a183d5c633e167d50047144ab812ebfa252da1282446a33fc681513a4d63234c18c83b82796dfafebed2714ef3c047c773b050c58048a3a1ea00bbcbd0a
print(decrypted_data)
# Output: b'Send Z-40 $100'
### Security Overview
- Same message maps to different cipher texts
- HMAC insures the integrity of the message and prevents attacks such as padding oracle
- SCRYPT helps transform weak passwords into AES keys, HMAC keys and IV
### Limitations
This implementation of AES is ***NOT*** Side-Channel attack resistant, however, attacks
can be prevented by clearing memory and deleting objects after usage