Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I\'m just looking at very simple encryption. I\'ve noticed that the key is typic

ID: 653264 • Letter: I

Question

I'm just looking at very simple encryption. I've noticed that the key is typically either at the front or at the back of the encrypted text. This is quite easy to break if you know the key. It can be made more difficult if the key is split up and scattered in random known positions within the encrypted message. The locations used by the key will only be known to the encrypter and decrypter.

Say the key is 0xBAADF00D and the message, after encryption is 20 bytes long. Say

0102030405060708090A0B0C0D0E0F1011121314

If the key is added, it will be 24 bytes. The encrypted code is shifted to make holes in positions 2, 9, 15 and 19.

0102 030405060708 090A0B0C0D 0E0F10 11121314

Then add key byte 1 at 15, key byte 2 at 9, 3 at 19 and 4 at 2 instead of the standard 1, 2, 3, 4 positions.

01020D030405060708AD090A0B0C0DBA0E0F10F011121314

On decryption, just extract the bytes from those positions, pack the remainder to obtain the key and the original encrypted message and begin the process of decryption.

Is there a name already given to this technique.

Explanation / Answer

I don't know if it has a name, but I can tell you that it is a bad idea. A very bad one. The only thing I have to do to break the encryption is to try all the possible combinations of 4 bytes in the total 24 byte string. Intuition may tell some people that there are many combinations, but really? How many combinations are possible? The answer is 255024. This is 4 orders of magnitude smaller than the number of all the possible 4-byte keys, i.e. tens of thousands of times weaker than agreeing on a random key, instead of agreeing on the few positions where you are trying to hide it.

Conclusion: don't use this technique for anything serious.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote