3 - Crypto Public Key Attacks Flashcards
What is the key distribution problem and its solution?
Need to share keys
Asymmetric cryptography is the solution
What is Asymmetric (Public Key)?
Uses a different key for encryption and decryption
Depends on hard maths problems
Generate key pairs, one key is private another is public
What are some properties of asymmetric/public keys?
Doesn’t matter if connection is insecure
Can prove someone encrypted something
Can combine encryption using different keys to ensure only recipient can decrypt, and prove author identity, can also prove no alterations were made
How should keys be generated?
Using one way functions
What is a one way function?
Function to generate keys and is computationally infeasible to get private key from public key
What is modular arithmetic?
Clocks work mod 12
E.g. 14 = 2 mod 12
a ≡ b mod n if a % n = b % n
14 % 12 = 2, 2 % 12 = 2
What is prime factorisation?
6 * 11 = 77
391
What is RSA Key Generation?
Pick 2 large distinct random primes (p and q)
Calculate n = pq
Calculate φ(n) = (p-1)(q-1)
Pick e = number less than φ, co-prime to φ
Calculate d
- d*e mod φ(n) = 1
Public key is (e, n)
Private key is (d, n)
Computationally infeasible to compute d from e and n alone
Factorising large numbers
Difficult to find the 2 numbers that make up a very large number (get better definition)
RSA Encryption
Split message into blocks
e.g 070515807052 7080119270718
for each plaintext block B
bᵉ(mod n)
e.g. 1658228449402 5333403068473
RSA Decryption
For each ciphertext block C
Cᵈ(mod n)
What are important features of RSA?
Public key crypto
- public key is published
- private key isn’t
Relies on one way functions
- Modular arithmetic, prime factorisation
What is Diffie-Hellman key exchange?
Establish a shared secret (key) between two parties
Not sharing info, but creating a key together
What are methods for attacking a substitution cipher?
Known letter frequencies, common words and digraphs and trigraphs (th, er, the, ion etc)
Does frequency analysis work on transposition ciphers?
No