Docsity

Computer Security Sec&on Week 4: Cryptography, Study notes of Cryptography and System Security

Partial preview of the text

Download Computer Security Sec&on Week 4: Cryptography and more Study notes Cryptography and System Security in PDF only on Docsity!

CSE 484 / CSE M 584

Computer Security Sec4on Week 4: Cryptography TA: Thomas Crosley tcrosley@cs Thanks to Franzi Roesner and Adrian Sham for previous slides [Examples/Images thanks to Wikipedia.]

Administrivia

  • Lab 1 Final due next week (Friday 4/29, 8pm)
  • Today
    • Fun Historical Ciphers
    • Crypto Review
    • Crypto Prac4ce
    • CBC-MAC Issue

Caesar Cipher (ShiY Cipher)

  • Plaintext leZers are replaced with leZers a fixed shiY away in the alphabet.
  • Example:
    • Plaintext: The quick brown fox jumps over the lazy dog.
    • Key: ShiY 3 ABCDEFGHIJKLMNOPQRSTUVWXYZ DEFGHIJKLMNOPQRSTUVWXYZABC
    • Ciphertext: WKHTX LFNEU RZQIR AMXPS VRYHU WKHOD CBGRJ

Caesar Cipher (ShiY Cipher)

  • ROT13: shiY 13 (encryp4on and decryp4on are symmetric)
  • What is the key space?
    • 26 possible shiYs.
  • How to aZack shiY ciphers?
    • Brute force.

Subs4tu4on Cipher

  • What is the key space?
  • How to aZack?
    • Frequency analysis. Trigrams:
      1. the
      2. and
      3. tha
      4. ent
      5. ing Bigrams: th 1.52% en 0.55% ng 0.18% he 1.28% ed 0.53% of 0.16% in 0.94% to 0.52% al 0.09% er 0.94% it 0.50% de 0.09% an 0.82% ou 0.50% se 0.08% re 0.68% ea 0.47% le 0.08% nd 0.63% hi 0.46% sa 0.06% at 0.59% is 0.46% si 0.05% on 0.57% or 0.43% ar 0.04% nt 0.56% ti 0.34% ve 0.04% ha 0.56% as 0.33% ra 0.04% es 0.56% te 0.27% ld 0.02% st 0.55% et 0.19% ur 0.02%
        1. ion
        2. tio
        3. for
        4. nde 10.has
          1. nce
          2. edt
          3. tis
          4. oft
          5. sth

26! ~= 2^

Transposi4on Cipher

  • Ciphertext is permuta4on of plaintext.
  • Example: Route cipher
    • Plaintext: WE ARE DISCOVERED, FLEE AT ONCE
    • Arrangement: W R I O R F E O E E E S V E L A N J A D C E D E T C X
    • Key: “spiral inwards, clockwise, starting from top right”
    • Ciphertext: EJXCTEDECDAEWRIORFEONALEVSE

Transposi4on/Subs4tu4on

  • How to tell if ciphertext was encrypted using

subs4tu4on or transposi4on cipher?

  • If leZer frequencies are normal, it’s transposi4on.
  • What happens if you combine subs4tu4on

and transposi4on?

  • Subs4tu4on prevents anagram finding, transposi4on prevents digram/trigram analysis.

Vigenère Cipher (~1467)

  • Polyalphabe4c subs4tu4on cipher: use mul4ple subs4tu4on alphabets.
  • Example:
    • Plaintext: ATTACKATDAWN
    • Key: LEMONLEMONLE
    • Ciphertext: LXFOPVEFRNHR
  • Encrypt:
    • (Key-Row, Msg-Col)
    • Or just addi4on mod 26

Enigma Machine

Uses rotors (subs4tu4on cipher) that change posi4on aYer each key. Key = ini4al seqng of rotors Key space? 26^n for n rotors

Steganography

  • Hidden messages (security through obscurity) [Figure from “Hide and Seek: An Introduc4on to Steganography” by Niels Provos and Peter Honeyman]

Crypto Review

Flavors of Cryptography

  • Symmetric cryptography
    • Both communica4ng par4es have access to a shared random string K, called the key.
  • Asymmetric cryptography
    • Each party creates a public key pk and a secret key sk.

Achieving Privacy (Asymmetric)

Key exchange

  • Diffie-Hellman Key Agreement algorithm
  • RSA key exchange process (Next week!) hZps://technet.microsoY.com/en-us/library/cc962035.aspx