Lecture 5: Classical Encryption Part 1 (introduction, transposition ciphers, simple substitution ciphers, Caesar cipher, random simple substitution cipher) Flashcards
What are the two facets of cryptology?
- cryptography
2. cryptanalysis
What is cryptography?
study of designing cryptosystems
science of secret writing
transformations of data depending on a secret (key)
What is cryptanalysis?
study of breaking cryptosystems
What is cryptography used to provide?
- confidentiality
2. authentication (or integrity)
What is confidentiality in terms of cryptography?
key is needed to read mesage
What is authentication in terms of cryptography?
key is needed to write message (with digital signature)
What does a cryptosystem consist of?
- Set of plaintexts (holding original message)
- Set of ciphertexts (holding encrypted message)
- Set of keys
- Function → encryption/encipherment → transforms plaintext into ciphertext
- Inverse function → decryption/decipherment → transforms ciphertext back into plaintext
What is another name for ciphertext?
cryptogram
What are the main characteristics of a symmetric key cipher?
- Encryption and decryption keys knowing ONLY to sender & receiver
- Secure channel for transmission of keys
What are main characteristics of an asymmetric key cipher?
- Each participant has public key & private key
* Possibly working for both encryption of messages and creation of digital signatures
What is another name for a symmetric key cipher?
secret key cipher
What is another name of an asymmetric key cipher?
public key cipher
What is the notation for an encryption function for a symmetric encryption algorithm?
E
What is the notation for an decryption function for a symmetric encryption algorithm?
D
What is the notation for a message/plaintext for a symmetric encryption algorithm?
M
What is the notation for a cryptogram/ciphertext for a symmetric encryption algorithm?
C
What is the notation for a shared secret key for a symmetric encryption algorithm?
K
How is encryption denoted as for a symmetric encryption algorithm?
C = E(M,K)
How is decryption denoted as for a symmetric encryption algorithm?
M = D(C,K)
What are some resources available to an adversary?
- computational capability
* system inputs/outputs
What may the adversary’s goal be?
- retrieving whole secret key
- distinguishing two messages (e.g. YES and NO) → may want to send message rather than control system and this may be enough info
What is exhaustive key search?
Try all possible keys
Can you prevent exhaustive key search?
No, so all cryptosystems must have enough keys to make search too difficult computationally
Is it possible that an adversary finds key without trying exhaustive key search?
Yes
Is it possible that an adversary breaks cryptosystem without finding key?
Yes, e.g. ciphertext may leak info about key
What is a minimum standard for a cryptosystem?
Prevention of exhaustive search
What is the ciphertext only attack?
attacker has access to ONLY intercepted ciphertexts
What is the known plaintext attack?
attacker knows a small amount of plaintexts and their corresponding ciphertexts
What is the chosen plaintext attack?
attacker can obtain ciphertext from some plaintext that it has selected (attack has “insider encryptor” available who helps trigger attack)
What is the chosen ciphertext attack?
attacker can obtain plaintext from some ciphertext that is has selected (attack has “inside decryptor” available who decrypts attacker’s chosen ciphertext)
When is a cryptosystem seen as highly insecure?
if it can be practically attacked using only intercepted ciphertexts
What attacks should a cryptosystem be secure against?
chosen plaintext and chosen ciphertext attacks
What sort of attack is practical for an attacker?
ciphertext attacks
What is Kerckhoffs’ Principle?
attacker has complete knowledge of ciphertext i.e. decryption key is only item unknown to attacker
What is using a secret, non-standard algorithm an example of?
security through obscurity
=> severe problems
What do statistical attacks depend on?
using redundancy of alphabet
What info helps in a statistical attack?
distribution of single letters, diagrams (double letters) and trigrams (triple letters)
What are the most frequent letters (including space) in English (top 3)?
space
E
N
What are the most frequent digrams in English?
E + space
space + A
In terms of transposition ciphers, what two operations do historical ciphers combine?
transposition
substitution
Define the transposition operation
characters in plaintext mixed up with each other (permuted) → limited to plaintext’s alphabet
Define the substitution operation
each character (resp. set of characters) replaced by different character
Explain how transposition ciphers work
- Permuting characters in fixed period d and permutation f
- Plaintext seen as a matrix of rows of length d
- Permuting rows/cols and outputting in row/col order
- E.g. permutation of rows and outputting in column order
- Number off cols in random order → x cols have x! possible keys
https://www.youtube.com/watch?v=sHsnH1u03e4
Explain simple transposition cipher
- Key → (d,f)
- Each block of d characters is re-ordered using permutation f
- d! permutations of length d → d x (d - 1) x (d-2) x … x 2 x 1 → take ball without replacement i.e. one less permutation choice
How can we identify a transposition cipher?
Frequency distribution of ciphertext = frequency distribution of plaintext characters
Can we solve transposition ciphers by hand if d is small? If so, how?
Yes, using anagramming
What is anagramming?
restoring disarranged characters to original position
How can you optimize the trials for attempting to solve a transposition cipher?
Knowledge of plaintext language diagrams and trigrams
How can we speed up the process of solving a transposition cipher?
automate the process
Compare the permutation done in a transposition and substitution cipher
Transposition ciphers permutes PLAINTEXT chars while substitution ciphers permute ALPHABET chars
What is the general idea of a simple substitution cipher?
each char in plaintext alphabet replaced b character in ciphertext alphabet following substitution table
What is a simple substitution cipher also called?
monoalphabetic substitution cipher
Explain the Caesar cipher
Moving ith letter of alphabet to (i+j)th letter s.t.c key is j → every char moved by j positions to right
What is the encryption function for the caesar cipher?
Ci = (Mi + j) mod n
What is the decryption function for the caesar cipher?
Mi = (Ci - j) mod n
What is n in the caesar cipher?
Either n = 26 or n = 27 (includes space) → size of alphabet
How do you perform cryptanalysis on caesar cipher?
Finding where one of the most frequent chars is shifted to –> count freqs –> trial mapping
Explain how the random simple substitution cipher works
Assigning random char of alphabet to another char in alphabet
How are encryption and decryption defined as for random substitution cipher?
defined by substitution table that randomly permutes alphabet
How many keys if random substitution cipher alphabet has 26 chars?
26! keys
if say A=C, then can’t assign A again → selection without replacement
What is caesar cipher a special case of?
substitution cipher
Can you do frequency analysis for random substitution cipher?
Yes, but solving by hand is tedious → many trials and errors