https://github.com/rebornplusplus/aes-128
Advanced Encryption Standard (Rijndael)
https://github.com/rebornplusplus/aes-128
Last synced: 11 months ago
JSON representation
Advanced Encryption Standard (Rijndael)
- Host: GitHub
- URL: https://github.com/rebornplusplus/aes-128
- Owner: rebornplusplus
- Created: 2021-03-15T03:34:18.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2021-03-15T03:41:42.000Z (about 5 years ago)
- Last Synced: 2025-03-22T06:29:45.000Z (about 1 year ago)
- Language: Python
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# Advanced Encryption Standard (Rijndael)
### Usage
```
AES-128 encryption | Usage:
-k, --key-len mention the key length in bytes, possible options are 16, 24 or 32.
-m, --mode mention the procedure, either 'encrypt' or 'decrypt' without quotes.
-f, --file provide the filename with relative/absolute path to encrypt/decrypt it.
not to be used with: -h, --hex, -c, --console.
-c, --console encrypt/decrypt ASCII plaintext through console.
not to be used with: -f, --file.
-h, --hex when in console mode, output encrypted bytes and input to decrypt bytes in hexadecimal string.
to be used with: -c or --console.
not to be used with: -f, --file.
```
For example, to encrypt a `file.ext` with a 128 bits key, execute
```
./aes.py -m encrypt -f file.ext -k 16
```
and input the key after the console prompt. `file.ext` will be changed (overwritten, encrypted).
Similarly to decrypt the encrypted file `file.ext` with the same key, execute
```
./aes.py -m decrypt -f file.ext -k 16
```
and input the key like before.
You must make `aes.py` to be executable to execute the previous commands.
```
chmod +x aes.py
```
If you don't want to do that however, add `python3` to the prefix of those encryption and decryption commands.
### Caution
Don't pull the following stunt:
```
./aes.py -m encrypt -f aes.py
```
This script doesn't keep info over which files are encrypted, which are not. So, a single file can very well be encrypted multiple times, with different keys. Make sure to decrypt them in a reverse manner. Also, make sure not to decrypt a non-encrypted file. (The behaviour is untested.)