Lecture 1 and 2: Intro Flashcards
Explain meaning of “cryptography” and “cryptanalysis”
Cryptography: Protection side
Cryptanalysis: Attacker side, trying to find weakness’
Explain the terms “secret key” and “public algorithm”
Secret keys: The key should be kept secret, be known only to authorised users
Public algorithm”: The algorithm should be public, accessible to all. E.g., to facilitate standardisation and transparency
Explain difference between asymmetric and symmetric encryption
Asymmetric: A key pair of a public key and a private key is used, where the recipients public key is used to encrypt the message which can then only be decrypted with the recipients private key
Symmetric: The same key is used for both encryption and decryption
What are some requirements for communication with symmetric encryption?
- Strong encryption algorithm
- Secure key transfer
- Keeping key secure
Explain some basic methods of cryptanalysis
- Rely on nature of algorithm
- Use knowledge of plaintext characteristics
- Use sample plaintext-cipher text pairs
- Exploit characteristics of algorithm to deduce plaintext or key
Give examples of mathematical properties used in encryption
- Factoring: given N=pq, p
Explain Message Authentication, and what is is used for
- Protects against active attacks
- Verifies that received message is authentic
- Can use conventional encryption, or
- Separate authentication mechanisms
What are three requirements in order for a message to be “authentic”?
- Contents unaltered
- From authentic source
- Timely and in correct sequence
Explain how Message Authentication Codes are used, a problem linked to using them, and how this problem is solved
- Sender has message, and appends MAC with algorithm
- Receiver uses algorithm to calculate MAC of message, and then compares this MAC to the one received
- Problem: malicious users can intercept, change message, and apply new MAC
- Solution: Use keys to encrypt message
Explain what a Secure Hash Function does, and its most important feature
- A secure hash function turns an arbitrarily long message into a fixed-length hash
- Hash functions work one way only, the hash cannot be reversed
Explain some hash function requirements
- Applied to any size data
- H produces fixed-length output
- H(x) is relatively easy to compute for any given x
- One way property
- Weak collision resistance; infeasible to find y ≠ x such that H(y) = H(x)
- Strong collision resistance; infeasible to find any pair (x, y) such that H(x) = H(y)
Explain how the private and public keys in RSA are created
Choose two random prime numbers.:
p=61
q=53
n=pq
n=61∗53=3233
Compute the totient
ϕ(n)=(p−1)(q−1)
ϕ(n)=(61−1)(53−1)=3120
Choose e>1 coprime to 3120
e=17
Choose d to satisfy de modϕ(n)≡1
d=2753
17∗2753=46801=1+15∗3120
The public key is (n=3233,
e=17).
For a padded message
m, the encryption function
c=m^e mod n becomes:
c=m^17 mod 3233
The private key is (n=3233, d=2753).
The decryption function
m=c^d mod n becomes:
m=c^2753 modn 3233
For example, to encrypt
m=123, we calculate c=123^17 mod 3233=855
To decrypt c=855, we calculate
m=855^2753 mod 3233=123
Explain a “Certificate”, its uses and the process of appending one to a message (when sending a message)
- It is used to ensure that certain properties, that have been certified by a central authority, are valid
Process:
o Hash our certificate
o Encrypt using private key, derived from certificate authority
o Then, we take the encrypted value and append it to our certificate
o Now, recipient can use the public key from certificate authority to get out hash
o Can then compare this with expected value
Explain a “Digital Envelope”, what it’s used for and how it works
- Used to improve speed/performance, compared to using asymmetrical keys
Process: - Sender creates message and appends secret key
- Encrypt this message with secret key, creating cipher text
- Encrypts secret key with public key of recipient
- Recipient uses their private key to decrypt the message, and retrieve the secret key
- The secret key can now be used for symmetrical encryption of messages
Explain the Diffie-Hellman algorithm, how it works
- Choose q, a so that q is prime, a is primitive root of q
- User A generates key: choose private X_A < q, calculate public Y_A = a^X_A mod q
- User B: private X_B < q, public Y_B=a^X_B mod q
- Exchange public Y
- User A calculates secret key: K=Y_B^X_A mod q
- User B: K=Y_A^X_B mod q