Don't like this style? Click here to change it! blue.css
Symmetric just means sender and receiver have the same exact shared key (like the JWT HS256).
(Use some public-key magic to make sure you and partner get same key)
ciphertext SHOULD LOOK LIKE HIGH ENTROPY NOISE IN TRANSIT
Grubby paws will handle your ciphertext, they might know part of your message. They shouldn't be able to figure out anything better than just guessing.
THE SAME MESSAGE SHOULD NEVER BE SENT TWICE... EVER
Someone holding then replaying your message should fail
Someone bouncing your message back to you should fail
Someone cleverly tampering with your message should fail
OK so the + in these statements is bit-wise XOR.
If the goal of crypto is to make messages that seem completely random while on the wire then become completely plain once they arrive at their destination then this does the job:
That is, make something random, mix it with your message using XOR, then unmix it again using XOR
Typically every character is one byte (8 bits) of data.
These bytes do NOT look random. You can start to see the binary by seeing the HEX digests:
So something like "A" is 65 in decimal, 0x41 in hex, and (4) 0100 0001 (1) in binary.
Alright XOR works with two binary inputs:
BUT we don't send 1 bit text messages, we send big long paragraphs or novels or movies...
So for that we just do each bit separately:
So plaintext XOR randomlookingkey will look random.
IF we can make a key which is
1) Unpredictably random looking
2) Reproducible at two places on opposite sides of the planet
3) Just as long as the original message
THEN we can do perfect encryption, and that system is called the One-Time Pad
Of course all of those conditions are very hard to pull off.
Why is it called the one-time pad? Well because your method of making random stuff on two sides of the planet CANNOT ever be repeated.
Now PT1 XOR PT2 is not random xor random.
Let's play with that.