Documente Academic
Documente Profesional
Documente Cultură
Basics
Cryptography - the science of secret writing (hiding the meaning of a message)
Cryptanalysis - the science of breaking cryptosystems
Symmetric ciphers - encryption & decryption methods with the same key
Asymmetric ciphers - encryption & decryption methods with different keys
Cryptographic protocols - applications of ciphers (TLS)
Cryptography is usually associated with modern electronic communication:
Email encryption (SSL/TLS)
Secure website access (RSA, SHA256)
Bank cards, IDs, passports, …
Symmetric Cipher
Encryption algorithm/function: 𝑦 = 𝑒𝑘 (𝑥)
Decryption algorithm/function: 𝑥 = 𝑑𝑘 (𝑦)
Encryption and decryption are inverse operations if the same key k is used on both sides:
𝑑𝑘 (𝑦) = 𝑑𝑘 (𝑒𝑘 (𝑥)) = 𝑥
The problem of secure communication is reduced to secure transmission and storage of the key k
Cryptanalysis
There is no mathematical proof of security for any practical cipher
The only way to have assurance that a cipher is secure is to try to break it (and fail)!
Kerckhoff‘s Principle: Cryptosystem should be secure even if the attacker knows all details about the
system, with the exception of the secret key.
Classical attack:
Mathematical analysis (exploit the internal structure of a cipher)
Brute-force attack (exhaustive key search)
Implementation attack: reverse engineering, power measurement
Social engineering: trick a user into giving up his password
Brute-Force Attack
Treats the cipher as a black-box.
Requires (at least) one plaintext-ciphertext pair (𝒙𝑶 , 𝒚𝟎 )
Checks all possible keys until
𝑑𝑘 (𝑦0 ) = 𝑥0
Key length (bit) - Key space - Security life time
64 - 264 - Short term (few days or less)
128 - 2128 - Long-term (several decades in the absence of quantum computers)
256 - 2256 - Long-term (also resistant against quantum computers)
Substitution Cipher
Substitution Cipher - substitute each letter with another one randomly.
Key: a substitution table
Attack 1: Brute-Force Attack
Try every possible substitution table until the plaintext is recovered.
26! ≈ 288
88
Search through 2 keys is completely infeasible
Substitution cipher isn’t secure.
Attack 2: Letter Frequency Analysis
Letters have different frequencies
Modular Arithmetic (notebook and slide)
Integer Ring (notebook and slide)
Shift(Caesar) Cipher
Plaintext letter is shifted by a fixed number of positions in the alphabet
For 𝑥, 𝑦, 𝑘 ∈ 𝑍26 :
Encryption: 𝑦 = 𝑒𝑘 (𝑥) = 𝑥 + 𝑘 𝑚𝑜𝑑 26
Decryption: 𝑥 = 𝑑𝑘 (𝑦) = 𝑦 − 𝑘 𝑚𝑜𝑑 26
Affine Cipher
Generalization of shift cipher
p/t is encrypted by multiplying the p/t by one key followed by adding another key.
Key is a pair 𝑘 = (𝑎, 𝑏)
For 𝑥, 𝑦, 𝑘 ∈ 𝑍26 :
Encryption: 𝑦 = 𝑒𝑘 (𝑥) = 𝑎 ∗ 𝑥 + 𝑏 𝑚𝑜𝑑 26
Decryption: 𝑥 = 𝑑𝑘 (𝑦) = 𝑎−1 (𝑦 − 𝑏) 𝑚𝑜𝑑 26