Caesar cipher -

Back to notes

Caesar cipher

Keywords: cryptography, encryption, security, algorithms
  • The Caesar cipher is a classic substitution cipher that involves shifting two alphabets in relation to each other to generate a code
    • The alphabet can be any arbitrary alphabet, but is commonly the uppercase [A-Z] alphabet

    • Steps:

      1. write the alphabet down two times
      2. shift the bottom alphabet by an arbitrary number of positions, known as the key-value
    • Consider this example, where the bottom alphabet has been shifted right 3 positions:

      A  B  C  D  E  F  G  H  I  J  K  L  M  N  O  P  Q  R  S  T  U  V  W  X  Y  Z
      D  E  F  G  H  I  J  K  L  M  N  O  P  Q  R  S  T  U  V  W  X  Y  Z  A  B  C
      • The word "example" would be encoded into "hadpsoh"
    • This cipher is named after Julius Caesar, who used this technique to encode military messages

    • This is a relatively insecure cipher, since it can be brute-forced with the maximum number of attempts being the length of the alphabet minus 1