Exam Question Revision Notes Flashcards
This is from practicing questions: Keep updating with new findings! (82 cards)
Why is RSA rarely used to encrypt data?
- RSA is slow and computationally intensive
- RSA uses large keys (2048+ bits), which becomes less efficient for large data
- RSA is deterministic without padding, so it is weaker without safeguards
What is an example of a pseudorandom number generator that is not suitable for cryptography?
The Linear Congruential Generator (LCG)
Why is Linear Congruential Generator not cryptographically secure?
If an attacker knows a few output values, then they can determine the internal state and predict all future values.
How is second preimage resistance defined?
Second preimage resistance:
Given a message, it should be computationally hard to find a different message m’, which isn’t the same as the original message, such that:
Hashed first message = Hashed second message
How is preimage resistance defined?
Preimage Resistance:
Given a hash value, it should be computationally hard to find a message such that H(message) = hash
How is collision resistance defined?
Collision resistance:
Given any two messages, it should be impossible to find two messages that are not equal but have the same hash:
m1, m2 -> H(m1) should not equal H(m2)
What cryptographic examples are there that could be weakened due to collisions in the hash function?
- SHA-1
- MD5
- RSA
How could hash collisions affect RSA?
If collisions are easy, then an attacker can create a different message that, when hashed is the exact same as the original message, and then pass it through the digital signature process using RSA. The message will then appear valid, and they will have a forged, yet signed, message
In the context of GF(x), what do the operators: + and * mean?
+ = Bitwise XOR applied e.g. 0 and 1 = 1, 0 and 0 OR 1 and 1 = 0
* = Actually multiply the values together in decimal format, then re-convert back into binary.
Is perfect secrecy needed in practice?
No, so long as the algorithm remains computationally secure and is combined with good key management, then it is suitable enough for the real world.
Why is the One Time Pad (OTP) not used in practice, despite having perfect secrecy?
- Requires a unique key for every single message
- Each key needs to be the exact same length as the message
- Key management is incredibly tricky for the amount of keys OTP would require for sustained service
How does the padding scheme PKCS7 work?
PKCS7 works by taking a message, and adding padding on to the end of it, either to increase its size to fit the block, or to double its size so as to fit two blocks.
It will add as many bytes as required by the encryption scheme, and the value in each byte will be set to the amount of bytes the scheme has to fill in. Example: If 6 bytes needed to be added, then each byte will have their value set to 06, hex for 6 in decimal.
How does the receiver recognise padded bytes when using PKCS7?
The last byte will tell the receiver how many bytes of padding there are, and therefore how many to remove before decryption.
What benefits does Galois Counter Mode (GCM) contain?
- Authentication is built in by providing confidentiality and integrity
- Parallelisable encryption: GCM can encrypt multiple blocks at once
- No padding needed due to it working on Counter Mode
What are some drawbacks of Galois Counter Mode (GCM)?
- More complex implementation
- Nonce re-use is catastrophic to security
- May not be ideal on devices without AES hardware acceleration
How can DES decrypt data even though its S-Boxes are invertible?
DES is built on a Feistel network. This means that the round function that includes the S-Boxes doesn’t need to be invertible. The overall encryption process remains reversible because only one half of the data is transformed in each round, and the result is XORed with the other half. For decryption, you apply the same operations, but in reverse order using the sub-keys in the opposite sequence.
Why are Elliptic Curves preferred in modern systems compared to modular arithmetic as the basis for a discrete logarithm problem?
- It is more efficient and has stronger security properties
- Uses significantly smaller key sizes
- Stronger security per bit due to cyclic groups and maximum order generators
- Resist attacks better on the Discrete Logarithm Problem in elliptic curve groups
How do you perform an equation with the point of infinity included in Elliptic Curves?
Ignore it entirely, and figure out the inversion of the point. In the example. POI - P, where P = (4, 2), you simply convert point y to a minus, then work out the value of it after modulus has been applied. Then you have your point
How is Diffie-Hellman vulnerable to Man-In-The-Middle attacks?
Diffie-Hellman’s key exchange is unauthenticated, as there is no inherent mechanism to verify that the party you’re exchanging keys with is legitimate.
How could you attack Diffie-Hellman with a man-in-the-middle attack?
- Attacker intercepts public key of person 1
- Sends their own E value to person 2
- Person 2 sends back their B value, which is intercepted
- Attacker sends their own F value to person 1
- Attacker now lets each party calculate using their keys, whilst also holding a copy of both
How can you defend against a man-in-the-middle attack?
Use authenticated key exchanges i.e. incorporate digital signatures or use public certificates/PKI to verify identities
How can a private key be calculated from the public key in RSA?
Using the public key (n, e), the private key (d) is calculated such that:
d * e is equivalent to 1 mod Euler’s Totient(n)
Is it practical to calculate the private key as an attacker in RSA?
For small keys, it is computationally feasible using methods such as General Number Field Sieve (GNFS)
For large keys, it is computationally infeasible. In RSA, the average key size is 2048 bits or longer, so it should be unbreakable.
What are the main differences between probabilistic encryption schemes and deterministic schemes?
Deterministic - Always produces the same ciphertext for the same plaintext and key
Probabilistic - Introduce randomness into the process, ensuring the same plaintext encrypted multiple times yields different ciphertexts.