Known-plaintext BF-ecb file edit - Uni Assignment
So I'm doing a first year Cybersecurity fundamentals paper and we have our first assignment. I've finished all questions bar this one in particular and need some push in the right direction.
We have a small "payroll/ann salary" file that we need to edit. And make "our" salary equal to the higher salaries.
We know employee names, know the length of each line, and also that it is sorted alphabetically.
After quite a bit of reading I'm concluding that I'm stumped. After decryption I still don't have the key to re-encrypt, editing the file will change its hash, making it obvious that it has been edited.
What are the typical steps to approach something like this? Is there any appropriate documents that would be of help?
Thanks
Posted Apr 25, 2019, 10:17 PM UTC
Have you looked at the differences between ECB mode and other modes like CTR and CBC? You might notice that each block in ECB is always encrypted the same way no matter where it is or what's around it. Blocks gets scrambled in CTR and CBC mode if you randomly move them. But what do you get in ECB mode? And for example, what happens to the ciphertext if the same plaintext repeats for a while, like a bunch of zeroes? And vice versa.
You mentioned a hash. Is that something that's actually being verified? Is there any authentication tag? Because if it isn't validated, the hash means nothing. If there's an unkeyed hash on the ciphertext, stored next to the ciphertext, you can trivially replace it. You'd be in trouble if it was keyed (like HMAC) or stored in a system you can't access.
We haven't covered CTR yet, mostly AES/DES ECB and CBC. So I should just keep attempting decrypts with bad passwords? We honestly haven't covered methods for this, so a little lost.
From what I read it's salted, and it uses non-alphabetic ciphertext, but isn't ending in Base64 (I presume due to the lack of ending in "==") And the goal is to edit "my" salary utilising openssl command lines.
I've overthought the hash. Which doesn't need to be addressed. After re-reading the question.
Have you considered ciphertext malleability? Google the term, and see if you can figure out what to do on your own. You might not need the key!
Ahhh! I'll definitely read up on this one, hope it may help! Thankies