I was assigned in my AP Java class to decrypt the following: umzDlBF8aFix
with the following key: oE2dpffzEiFD
The only problem is I don't know how to do an XOR to decrypt these. I've gotten as far as turning them into binary:
key: 101000|000100|110110|011101|101001|011111|110011|000100|100010|000101|000011
ciphertext: 110110|100110|110011|100101|000001|111100|011010|000101|100011|110001
but I don't know what to do with that. If you could help me with this, that would be great! Code would be nice as well, but not needed.
Thanks a million!
As others have noted, "xor" is a wonderful encryption mechanism, because the encryption and the decryption are exactly the same operation. If you use every part of the key only once, you have the most secure encryption algorithm possible.
If you re-use any part of the key, it turns into one of the worst encryption mechanisms because that makes it easy to crack.
The problem that you have here is - how do you go from the characters to the value that you want to encrypt. You could take the Unicode character values but you'd get bogus results with your ciphertext and key. The problem with using Unicode as-is is also that you may get unprintable characters after encryption/decryption, which is normally not a problem, but in textbook examples it is hard to print unprintable characters.
To decrypt your text, I made the assumption that the translation of characters works like this.
A
- Z
=> 0 - 25a
- z
=> 26 - 510
- 9
=> 52 - 61(I didn't need to guess what 62/63 would be but space and point would be good guesses).
Using that assumption and xor, I take your ciphertext umzDlBF8aFix
and your key oE2dpffzEiFD
and end up with the plaintext GiFeMeaPenny
.
Since this is readable English - "Give me a penny" - it looks like the assumptions above are plausible.