Bag Of Cows

Encryption

Keyword Cypher

A more cunning plan is to use a keyword cypher, so that each letter of your plantext message is converted to the cyphertext by using the letters of the key word to decide how many letters up the alphabet to shift it.

For example, to encode the message 'BOB I LOVE YOU' using a key word of 'DOG' you would say:

  • D is the 4th letter of the alphabet, so let us convert the B from BOB to F (4 along)
  • O is the 15th letter of the alphabet, so let us convert the O from BOB to D (30 along, wrapped round)
  • G is the 7th letter of the alphabet, so let us convert the second B from BOB to I (7 along)

  • Now we go back to the start of the keyword
  • D is the 4th letter of the alphabet, so let us convert the I to M (4 along)

Eventually we get from

B O B I L O V E Y O U

to

F D I M A V V T F S Y

This is good because the first B and the second B were converted to different letters. However, if there is a lot of text and a short keyword, patterns could still appear to allow frequency analysis to help break the code.

If the keyword were as long as the message, there would be no patterns to provide a weakness. But if all your messages used the same keyword, patterns would be present across many messages.

<= BackBackgroundCaesar
Cypher
Keyword
Cypher
One Time
Pad
SSLDigital
Certificates
Not
all good
Try itNext =>