Published on

COMP2700 - Week 7 - Introduction to Cryptography

Table of Contents

Symmetric Cryptography

  • Also known as private-key, single-key, secret-key cryptography

Problem: If Alice and Bob would like to communicate via an unsecure channel, then a third party, should not be able to understand the communications

Encrypted and decrypted with respective functions

Symmetric Cryptography
  • xx is the plaintext

  • yy is the ciphertext

  • KK is the key

  • Set of all keys K1,K2,...,Kn{K_1,K_2, ... , K_n}

  • Encryption equation -> y=eK(x)y = e_K(x)

  • Decryption equation -> x=dK(y)x = d_K(y)

Note that encryption and decryption are inverse operations if the same key KK is used on both sides and must be transmitted via a secure channel between Alice and Bob. System is secure iff attacker doesn't learn the key KK.

dK(y)=dK(eK(x))=xd_K(y) = d_K(e_K(x)) = x

Note: Problem of secure communication reduced to secure transmission and storage of key KK

Cryptanalysis

Why do we need Cryptanalysis

  • No unconditional mathematical proof of security for any practical cipher

Kerckhoff's Principle

A cryptosystem should be secure even if the attacker knows all details about the system, with the exception of the secret key.

Attacking Cryptosystems

Attacking cryptosystems
  • Classical Attacks
    • Mathematical Analysis
    • Brute-force Attack
  • Implementation Attack -> Extract key through reverse engineering or power measurement
  • Social Engineering -> Trick user into giving up password

Brute-force attack

  • Requires at least 1 plaintext-ciphertext pair (x0,y0)(x_0,y_0)
  • Check all possible keys until condition is fulfilled

dK(y0)=?x0d_K(y_0) =^? x_0

Substitution Cipher

  • Encrypt letters rather than bits
    • Replace each plaintext letter by another letter
Brute-force
  • Try all possible permutations until an intelligent plaintext appears

  • Possible keys -> 26×25×...×2×1=26!28826 \times 25 \times ... \times 2 \times 1 = 26! \approx 2^88

Frequency Analysis
Letter frequencies in English

Frequency of letters can give away/break sub-ciphers

Example

Letter frequency example

Modular Arithmetic

Cryptosystems based on sets of numbers

  1. Discrete -> Sets with integers are partially useful
    • i.e. no floating point numbers, integers only
  2. Finite -> If we only compute with a finitely many numbers

Definition Let a,r,ma,r,m be integers and m>0m > 0. We write

armodma \equiv r \medspace mod \medspace m

if (ar)(a - r) is divisible by mm

  • mm is called the modulus
  • rr is called the remainder

Add stuff

Properties of Modular Arithmetic

Algebraic View