StudEH
StudEH

Reputation: 15

How to decrypt AES CBC encrypted file only knowing key length

I have a file that is encrypted using AES CBC. The only thing i know is that the password is 6 characters long and the possible 10 characters it possibly has. This password gets hashed into a 128 bit key.

But since 128 bit key decryption takes litteraly forever how do i decrypt this file?

Upvotes: 0

Views: 1136

Answers (1)

Sani Huttunen
Sani Huttunen

Reputation: 24375

Generate every permutations of the 6 characters out of the 10 possible different characters. Then hash those permutations and compare with the password hash you've got. Shouldn't take more than a second or so. 10 to the 6th power is 1000000 permutations which you can generate in a few ms. The hashing takes the longest time and depending on the algorithm it might take up to a minute but rest assured you'll find the correct permutation (password) in a very short time.

There's no need to "decrypt" the 128-bit hash and literally that would be a waste of time since hashes are designed to be "undecryptable". They are called "one-way-hashes" for a reason.

But you'll still need to know which hash-algorithm is used to hash the password to make this work.

Another approach would be to generate all permutations and simply decrypt the file with each and check if there is some valid data there. However, since it's CBC and you don't know the IV that would also be futile.

Upvotes: 0

Related Questions