Score:0

Attacking AES ECB

sm flag

this is a school challenge. I have a cipher file which is the audio file, and no key of course, encrypted with AES ECB mode. The size is around 550 Kb. I know the key size used is 16 bytes, and I have the plain file of 20 Kb that is part of the whole original plain file, but I do know the offset of it.

I guess attacking the key is off. Am I right to go like this: move by 16 bytes in ciphered file and compare with the plain file, then map the bytes. One time I will be in the right offset position, and then I can map the rest of the bytes and decrypt the rest of the ciphered file.

Is this the correct approach? How is this even called (maybe dictionary attack?), and is there a smarter way of doing it? And is there an explanation of something similar in Python maybe?

Thank you in advance.

Maarten Bodewes avatar
in flag
To be honest, I haven't got a clue what you mean with "map the bytes", what you mean with "being in the right offset position" or "mapping the rest of the bytes". With ECB you should not be able to "decrypt the rest" either, as the key will remain unknown unless you can guess it. I'd be more thinking in the area of frequency analysis.
Meir Maor avatar
in flag
What kind of audio file? is it a compressed format (that would be really hard to crack)? Or raw? do you have partial plain text? what does it look like? do blocks repeat?
user1405583 avatar
sm flag
Plain file is an uncompressed audio file of 20 Kb, it is a part of the whole encrypted file. My idea was this: I think the 16 byte blocks in the plain file would be encrypted as 256 byte in the cipher file (so 16 x 16). I can move in offsets by 256 bytes, and at some point that block starting from there having len of 20Kb * 256 bytes would be a chunk to map to the plain file. I just don’t know when is that. So each time I slide by offset I map the bytes and try to decode the file, then calculate the hash of that file (since I know what hash should be). Does this sound like the right approach?
Meir Maor avatar
in flag
Did you look for repeating blocks in your plain text? How common are they? How many distinct blocks do you have? (Just finding the allignment is not sufficient to break ECB)
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.