Cryptography and Network
Security Chapter 2
Outline
• We will consider:
– classical cipher techniques and terminology
– monoalphabetic substitution ciphers
– cryptanalysis using letter frequencies
– Playfair cipher
– polyalphabetic ciphers
– transposition ciphers
– product ciphers and rotor machines
– steganography
Chapter 2 – Classical Encryption Techniques
Symmetric Encryption
• or conventional / private-key / single-key
• sender and recipient share a common key
• all classical encryption algorithms are
private-key
• was only type prior to invention of public-
key in 1970’s
• and by far most widely used
Some Basic Terminology
• plaintext - original message
• ciphertext - coded message
• cipher - algorithm for transforming plaintext to ciphertext
• key - info used in cipher known only to sender/receiver
• encipher (encrypt) - converting plaintext to ciphertext
• decipher (decrypt) - recovering ciphertext from plaintext
• cryptography - study of encryption principles/methods
• cryptanalysis (codebreaking) - study of principles/
methods of deciphering ciphertext without knowing key
• cryptology - field of both cryptography and
cryptanalysis
Symmetric Cipher Model
Requirements
• two requirements for secure use of symmetric encryption:
– a strong encryption algorithm
– a secret key known only to sender / receiver
• mathematically have:
• Y = E(K,X)
• X = D(K,Y)
• assume encryption algorithm is known
• implies a secure channel to distribute key
Cryptography
• can characterize cryptographic system by:
– type of encryption operations used
• substitution
• transposition
• product
– number of keys used
• single-key or private
• two-key or public
– way in which plaintext is processed
• block
• stream
Cryptanalysis
• objective to recover key not just message
• general approaches:
– cryptanalytic attack
– brute-force attack
• if either succeed all key use compromised
Cryptanalytic Attacks
• ciphertext only
– only know algorithm & ciphertext, is statistical, must know or be able to identify plaintext
• known plaintext
– attacker knows/suspects plaintext & ciphertext
• chosen plaintext
– attacker selects plaintext and gets ciphertext
• chosen ciphertext
– attacker selects ciphertext and gets plaintext
• chosen text
– attacker selects plaintext or ciphertext to en/decrypt
More Definitions
•unconditional security
•– no matter how much computer power or time is
available, the cipher cannot be broken … since
the ciphertext provides insufficient information
to uniquely determine the corresponding plaintext
•computational security
•given limited computing resources (eg. time
needed for calculations is greater than age of
universe), the cipher cannot be broken
Classical Substitution Ciphers
• letters of plaintext are replaced by other
letters or by numbers or symbols
•or
• plaintext is viewed as a sequence of bits,
and substitution involves replacing
plaintext bit patterns with ciphertext bit
• patterns
Caesar Cipher
• earliest known substitution cipher
• by Julius Caesar
• first attested use in military affairs
• replaces each letter by 3rd letter on
• example:
• meet me after the toga party
PHHW PH DIWHU WKH WRJD SDUWB
Caesar Cipher
•can define transformation as:
• 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
•mathematically give each letter a number
• 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 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
•then have Caesar cipher as:
c = E(k,p) = (p + k) mod 26 p
= D(k,c) = (c – k) mod 26