2024-03-08 22:27:10 +01:00
|
|
|
# aes-project
|
2024-04-28 18:51:24 +02:00
|
|
|
AES-128, and square attack against reduced AES-128 (only 4-turns) implementation in rust.
|
2024-03-08 22:27:10 +01:00
|
|
|
|
2024-04-28 22:42:57 +02:00
|
|
|
### commands
|
|
|
|
#### encrypt
|
|
|
|
encrypt or decrypt a text
|
|
|
|
|
|
|
|
#### findkey
|
|
|
|
square attack against 4-turns AES-128 with a specific key
|
|
|
|
|
|
|
|
#### square
|
|
|
|
square attack against 4-turns AES-128 with n randomly generated keys
|
|
|
|
|
2024-04-28 18:51:24 +02:00
|
|
|
### example
|
|
|
|
encrypt the text "Hello, world!" using the key 2b7e151628aed2a6abf7158809cf4f3c, hex-encoded. 10-turns AES-128
|
|
|
|
```
|
|
|
|
cargo run -- encrypt -K -k '2b7e151628aed2a6abf7158809cf4f3c' -t "Hello, world!" -n 10
|
|
|
|
```
|
2024-04-28 22:42:57 +02:00
|
|
|
decrypt the text 7d6a80dde1d56639903194344eddf515, hex-encoded, using the key 2b7e151628aed2a6abf7158809cf4f3c, hex-encoded. 10-turns AES-128
|
|
|
|
```
|
|
|
|
cargo run -- encrypt -d -Kk '2b7e151628aed2a6abf7158809cf4f3c' -Tt '7d6a80dde1d56639903194344eddf515' -n 10
|
|
|
|
```
|
2024-04-28 18:51:24 +02:00
|
|
|
square attack against 4-turns AES-128, choosen key bba51a66aca801747294ff4317fb59e2, hex-encoded.
|
|
|
|
```
|
|
|
|
cargo run -- findkey bba51a66aca801747294ff4317fb59e2 -K
|
|
|
|
```
|
|
|
|
square attack against 4-turns AES-128, 10 keys generated randomly.
|
|
|
|
```
|
|
|
|
cargo run -- square 10
|
|
|
|
```
|