Crypto

Decrypt file

Find cipher used for encryption

1
ciphers.lst
Copied!
1
-aes-256-cbc
2
-aes-128-cbc
3
-aes-256-ecb
4
-aes-128-ecb
5
-aes-256-ofb
6
-aes-128-ofb
7
-rc4
8
-rc4-cbc
9
-aria-128-cbc
10
-des
Copied!
Generate files of various lengths (in steps of 8)
1
for i in $(seq 0 8 176); do python -c "print 'A'*$i" > $i; done
Copied!
Generate encrypted files with various ciphers if various length
1
for cipher in $(cat ciphers.lst); do
2
for length in $(ls | grep ^[0-9]); do
3
openssl enc $cipher -e -in $length -out $length$cipher.enc -k Whatever
4
done
5
done
Copied!
Check which of those match the length of the encrypted file
1
ls *.enc | xargs wc -c | grep '176 '
Copied!
Crack it^^
1
bruteforce-salted-openssl -t 10 -f <wordlist> -c aes-256-cbc -d sha256 <encrypted-file>
Copied!
Decrypt the file
1
openssl enc -aes-256-cbc -d -in <encrypted-file> -out <decrypted-file> -k <password>
Copied!
Copy link
Edit on GitHub