1 - Classical Symmetric Algorithms Flashcards
Caesar/Shift cipher
key K 1 to 25
Replace each plaintext character with letter K positions further
Inverse = backwards
Components of a cryptosystem
Set of possible plaintexts
… ciphertexts
… keys (keyspace)
the encryption function E(K,m) (K key is parameter)
the decryption function D(K,c)
The encryption (E) and decryption function (D) much be such that..
w/r to a fixed K (key)
- For fixed K, different messages are encrypted to different cipher texts. injective/one to one
- For fixed K, E/D are inverses
Exhaustive Keysearch Attack
Try decrypting c using all possible keys in turn, until result makes sense.
Combatted by large keyspace
Key is string of n bits. How many keys?
2 to the power of n
How many keys in a 128bit key
2 to the power of 128
Absolute minimum number of bits
80bits. Most common 128
Substitution Cipher
Plaintext: alphabet
ciphertext: 26 characters
Key: A substitution table of two rows (top - OG, bottom - cipher)
Encryption/Decryption: Substitute the letters
How can context be used to crack a cipher?
The environment or known patterns of the plaintext can be used.
How many possible keys in a substitution cipher
26!
26 factorial = 403291461126605635584000000
26 possibilities on first char, 25 on second, 24 on third
How can letter frequencies be used to crack a cipher?
Some letters are more frequent in languages and so, patterns can be recognised using this fact.
Vigenere cipher
Key: sequence of n numbers from 0 to 26.
Shifts applied corresponding to each number in the key
Vigenere Cipher: Number of keys
26 to the power of n
Permutation cipher: Concept
anagrams
Split message into fixed length blocks and apply same permutation in each block
Permutation Example Key
1 2 3 4 5
3 1 5 2 4
Plaintext: nobod y here
ciphertext: oondb hryee
Inverse:
1 2 3 4 5
2 4 1 5 3