Exam Question Revision Notes Flashcards

This is from practicing questions: Keep updating with new findings! (82 cards)

1
Q

Why is RSA rarely used to encrypt data?

A
  • 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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is an example of a pseudorandom number generator that is not suitable for cryptography?

A

The Linear Congruential Generator (LCG)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Why is Linear Congruential Generator not cryptographically secure?

A

If an attacker knows a few output values, then they can determine the internal state and predict all future values.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How is second preimage resistance defined?

A

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 well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How is preimage resistance defined?

A

Preimage Resistance:
Given a hash value, it should be computationally hard to find a message such that H(message) = hash

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How is collision resistance defined?

A

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)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What cryptographic examples are there that could be weakened due to collisions in the hash function?

A
  • SHA-1
  • MD5
  • RSA
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How could hash collisions affect RSA?

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

In the context of GF(x), what do the operators: + and * mean?

A

+ = 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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Is perfect secrecy needed in practice?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Why is the One Time Pad (OTP) not used in practice, despite having perfect secrecy?

A
  • 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 well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

How does the padding scheme PKCS7 work?

A

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 well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

How does the receiver recognise padded bytes when using PKCS7?

A

The last byte will tell the receiver how many bytes of padding there are, and therefore how many to remove before decryption.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What benefits does Galois Counter Mode (GCM) contain?

A
  • 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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What are some drawbacks of Galois Counter Mode (GCM)?

A
  • More complex implementation
  • Nonce re-use is catastrophic to security
  • May not be ideal on devices without AES hardware acceleration
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

How can DES decrypt data even though its S-Boxes are invertible?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

Why are Elliptic Curves preferred in modern systems compared to modular arithmetic as the basis for a discrete logarithm problem?

A
  • 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 well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

How do you perform an equation with the point of infinity included in Elliptic Curves?

A

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 well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

How is Diffie-Hellman vulnerable to Man-In-The-Middle attacks?

A

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 well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

How could you attack Diffie-Hellman with a man-in-the-middle attack?

A
  • 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 well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

How can you defend against a man-in-the-middle attack?

A

Use authenticated key exchanges i.e. incorporate digital signatures or use public certificates/PKI to verify identities

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

How can a private key be calculated from the public key in RSA?

A

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)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

Is it practical to calculate the private key as an attacker in RSA?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

What are the main differences between probabilistic encryption schemes and deterministic schemes?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
What are some properties of probabilistic encryption schemes?
- Randomised outputs, even with identical inputs of plaintext key pairs, the output ciphertext varies - Semantic security - Is indistinguishable from other outputs - Non-deterministic mapping - No mapping from plaintext to ciphertext
26
What are some properties of deterministic encryption schemes?
- Repeatability: For a fixed key and message, the ciphertext is always the same - Predictability: If an attacker knows or guesses the plaintext, they can confirm it by comparing ciphertexts - Not semantically secure: Due to repeated results when using same parameters
27
Why is Extended Euclidean used in mathematical concepts?
It can be used to easily find the multiplicative inverse for the number that has modulo being applied to it e.g. finding the multiplicative inverse of 15 mod 52
28
What is the Euclidean algorithm used for in cryptographical systems?
It is used to identify if a number has a multiplicative inverse, and if it does, then to apply the Extended Euclidean algorithm to find it and use it for further calculations.
29
What is an example of an Authenticated Encryption (AEAD) Scheme and how does it implement authentication?
Galois Counter Mode: Implements authentication by including an authentication tag that is defined from using arithmetic in GF(2^128).
30
How does AEAD provide benefits over a normal symmetric cipher?
AEAD provides message authenticity, as well as incorporating confidentiality and integrity into its scheme.
31
How is AES a better alternative than Triple DES?
- Significantly faster - Better key management - Higher resistance to attacks such as Differential Cryptanalysis
32
What are some drawbacks with Triple DES?
- Vulnerable to man-in-the-middle attacks, due to effective 112-bit security - Much slower than most alternatives, due to the three uses of DES
33
What is Perfect Forward Secrecy?
Perfect Forward Secrecy is the term surrounding the situation where, if an attacker compromises a future communication between two parties, then the previous communications are still secure.
34
How is Perfect Forward Secrecy typically implemented?
It's implemented through the use of session/ephemeral keys, which are generated through the use of current session data.
35
What is an example of a communication scheme that incorporates Perfect Forward Secrecy?
Elliptic Curve Diffie-Hellman (ECDH) - Uses ephemeral keys
36
If an elliptic curve is not a standard curve, then what possible security issue might exist?
- Attacks using small subgroup attacks. If an attacker can cause a system to operate on a point from a subgroup of small order, then they may gather partial information regarding private keys
37
If a generator is used for a standard elliptic curve that is not a maximum order generator, what security issue could arise from this?
- If the generator is not a maximum point order generator, then the generator will not span the full cyclic subgroup of the curve, causing the effective key space to be reduced. - It also opens the door to certain types of attacks, such as Polland's Rho or invalid curve attacks
38
What does RSA's security rely on?
The Integer Factorisation Problem (IFP), which represents the difficulty in factoring n, p and q from RSA into it's prime components to calculate Euler(n), which in turn, is used to calculate the private key.
39
How could an attacker attempt to calculate the private key in RSA?
An attacker would have to calculate Euler(n), so as to satisfy the equation: d * e is equivalent to 1 mod (Euler(n)) As such, to calculate Euler(n), you need to find the factors of N = p * q, which invokes the Integer Factorisation Problem, which is computationally infeasible.
40
What makes an LCG weak and not suitable as a PRNG for cryptographic systems?
- Deterministic and are thus predictable, which makes them unsuitable for cryptographic systems - LCGs are also linear (clue in the name), and therefore allow attackers to predict the next value after only a few outputs.
41
What makes a CSPRNG suited for cryptographic purposes?
- Use unpredictable seeds - Produce output that is non-linear - Resistant to reverse-engineering
42
What are Message Authentication Code's use cases? (MACs)
Commonly used in symmetric protocols
43
What do MACs not support compared to digital signatures?
Non-repudiation MACs use symmetric keys i.e. same shared key, whereas digital signatures use asymmetric keys, which allows for non-repudiation.
44
Why is key-reuse discouraged in cryptographic systems?
If a key is used multiple times e.g. both encryption and authentication, then an attacker could not only decrypt messages, but also forge valid messages.
45
What is an example of a catastrophic problem that could arise in a system with key re-use?
Stream ciphers are especially vulnerable to this, as if they re-use the same key, then all future communications are liable to being exposed by an attacker.
46
What is a primitive polynomial?
A primitive polynomial is one that generates a maximum-length sequence in an LFSR
47
What is a primitive polynomial's role in security?
It ensures that the keystream cycles through all non-zero bit states before repeating, which is critical in achieving statistical randomness in the keystream.
48
Why is a static nonce in a stream cipher a critical security issue?
Using a key, a nonce generates the keystream. If the nonce is the exact same each time, then the keystream will also be the exact same each time. This means that, if an attacker got a hold of the keystream, they could then XOR it with any message, past or future, and retrieve the original plaintext message.
49
What is the formula surrounding the Elliptic Curve Discrete Logarithm Problem?
Given a curve, listed as C, a primitive root, called P, and a point aP, what is a?
50
Why is the Elliptic Curve Discrete Logarithm Problem hard to solve?
It is difficult to figure out a as there is no feasible time algorithm, such as Index Calculus, that can solve the problem on general curves.
51
How do you determine if a point lies on the line in an elliptic curve?
Plug the points directly into the equation, and then solve both sides. If they are equivalent, then the point lies on the curve, otherwise it does not.
52
How do you calculate the inverse of a point in an elliptic curve?
P = (x, y) -P = (x, -y) Therefore, just invert the point, and then apply modulus to it until you have a positive number. Then -P becomes: -P = (x, -y mod number) Example: P = (5, 22) with a mod of 29 -P = (5, -22 mod 29) -P = (5, 7)
53
What is a side-channel attack?
It's a type of attack that exploits information leakage from the physical implementation of a cryptographic algorithm, rather than directly attacking the cryptographic algorithm itself.
54
What is an example attack on a system that is a side-channel attack?
Using timing information for RSA. If you can identify how long RSA decryption takes to infer bits of the private key, then you can identify the private key structure.
55
What is an advantage of using Elgamal in encryption, and what is a different advantage of using Elgamal in Digital Signatures?
Encryption: Semantic security built in due to the Discrete Logarithm Problem Digital Signatures: Unforgeability if implemented securely
56
What is a disadvantage of using Elgamal in encryption, and what is a different disadvantage of using Elgamal in Digital Signatures?
Encryption: Ciphertext expansion, as it doubles the size of the plaintext Digital Signatures: Vulnerable to re-used nonce attacks, reusing k allows full private key recovery
57
What is Kreckhoff's principle?
The security of the cryptosystem must lie in the choice of its keys only. Everything else should be considered public knowledge
58
What is the formal definition of Confusion?
Obscure the relationship between the plaintext, ciphertext and key
59
What is the formal definition of Diffusion?
Influence of each key bit or plaintext bit should be distributed throughout the ciphertext
60
How is Confusion implemented in block ciphers?
Confusion is implemented through the use of S-Boxes in order to make the relationship between key and ciphertext more complex
61
How is Diffusion implemented in block ciphers?
Diffusion is typically implemented through the use of specific operations, like ShiftRows and MixColumns in AES, which spread input bits over many output bits.
62
What is an inherent advantage of stream ciphers?
Stream ciphers tend to be very fast and quite memory-efficient
63
What is an inherent advantage of block ciphers?
Block ciphers use padding to set the message length to the block's desired size. As such, it has inherently increased security due to the addition of padding to the message.
64
What is an inherent disadvantage of stream ciphers?
Stream ciphers are very vulnerable to keystream re-use, such as poor nonce management.
65
What is an inherent disadvantage of block ciphers?
They are more complex to implement correctly.
66
What are the four stages of AES, in order of execution?
- SubBytes - ShiftRows - MixColumns - AddRoundKey
67
What does SubBytes do in AES?
It's a nonlinear substitution step that involves the use of S-Boxes, that uses a lookup table based on the multiplicative inverse of GF(2^8), followed by an affine transformation
68
What does ShiftRows do in AES?
ShiftRows will take each row in the state matrix, and shift them to the left corresponding to their row number. Example: Row 1 - Shifts once Row 3 - Shifts three times
69
What does MixColumns do in AES?
MixColumns will treat each column as a 4-byte vector and as a polynomial, and multiply it by a fixed matrix based on GF(2^8).
70
What does AddRoundKey do in AES?
AddRoundKey will take each byte of the state matrix, and XOR it with the corresponding byte from the round key.
71
How does ECB (Electronic Code Book) Mode work?
ECB works by: - Dividing the plaintext into fixed-size blocks - Encrypting each block independently using the same key - Concatenate ciphertext blocks into a single ciphertext
72
What are some advantages of using ECB mode?
- Easy to implement and understand - Parallelisable - No padding issues if the plaintext is a multiple of the block size
73
What are some disadvantages of using ECB mode?
- No diffusion across blocks - Pattern leakage - Vulnerable to block replay or rearrangement attacks
74
What is the security issue with using ECB Mode?
It's not semantically secure, as an attacker can infer relationships between plaintext blocks by analysing ciphertext repetition
75
What is an example case where the attacker can gain relationship information when something is encrypted using ECB?
Encrypting an image e.g. Uni of Nottingham logo, preserves visible patterns. As such, encrypted images retain their basic structure
76
How do digital signatures work?
- An entity sends a hash of the given message with their private key - The receiver then verifies it using the sender's public key
77
How do digital signatures establish authenticity and non-repudiation?
Only the sender could have created the signature, and if the message is changed, then the signature fails.
78
How are Message Authentication Codes (MACs) created?
They are created through the use of a shared secret key, which is why it is used in symmetric encryption.
79
What is an existential forgery attack?
An existential forgery attack assumes an attacker can create a message/signature pair that is valid, even if the message is nonsensical. There are no constraints on the message creation process in the scheme it attacks.
80
What is a selective forgery attack?
The attacker is able to create a valid message/signature pair, where they have selected the message in advance.
81
What is a universal forgery attack?
A type of attack where the attacker can select any message and create a valid message/signature pair
82
What is the difference between PKCS#1 v1.5 and PSSRSA?
PSSRSA, also known as just PSS, is a probabilistic padding scheme, which means that the digital signature, if repeated, will produce different results. Meanwhile, PKCS#1 v1.5 is a deterministic scheme, which could lead to attackers gaining information after repeated digital signatures are created.