architecture/docs/workshop/5-snake-oil-crypto/scripts/gen_ecb.sh

9 lines
383 B
Bash
Raw Normal View History

2019-11-16 11:45:37 +01:00
#!/bin/bash
# Then take the header apart
head -n 4 d4-logo.ppm > header.txt
tail -n +5 d4-logo.ppm > body.bin
# Then encrypt with ECB (experiment with some different keys)
openssl enc -aes-128-ecb -nosalt -pass pass:"ANNA" -in body.bin -out body.ecb.bin
# And finally put the result together and convert to some better format with Gimp
cat header.txt body.ecb.bin > d4-logo.ecb.ppm3