RSA Encryption Flashcards

1
Q

Advantages of Asymmetric Encryption

A
  1. No pre-shared secret
  2. Key Independent of Sender
  3. Anyone who wants to encrypt can do so
  4. Only a single private key to keep secret
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Disadvantages of Asymmetric Encryption

A
  1. Risk of impersonation attacks
  2. Runs in order 2/3 slower than symmetric algos
  3. No authentication or integrity
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Chosen Plain Text Attack

A

Chosen-Plaintext Attack (CPA) Security:

Setup: Create a pair of keys for encryption.

Adversary’s Role: The adversary gets the public key and access to an encryption tool.

Adversary’s Task: Pick any two different messages.

Challenge: A message is randomly chosen from the two and encrypted.

Adversary’s Guess: Try to guess which message was encrypted.

Winning the Game: If the adversary guesses right, they win.

Main Idea: If the adversary can only guess as good as flipping a coin, the encryption is considered secure against this type of attack.

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

Deterministic Public Key Encryption

A

Deterministic Public-Key Encryption is a type of encryption that always produces the same ciphertext for a given plaintext and key, regardless of how many times the encryption is performed. Examples include the RSA cryptosystem without padding and block ciphers in ECB mode with a constant initialization vector​

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

Is Deterministic Public Key Encryption Secure?

A

No deterministic encryption can be CPA-secure.
Public-key encryption must be randomized.

Deterministic encryption schemes cannot achieve semantic security, which is the property that a ciphertext does not reveal any information about the plaintext.

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

Hybrid Encryption

A
  1. Generate a fresh random symmetric key k
  2. Used the public key pk to encrypt creating c1
  3. Encrypt the message m with k to produce c2
  4. Send both encrypted key c1 and message c2 to the receiver.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Advantages of Hybrid Encryption

A
  1. Faster than public key encryption
  2. Eliminates the need for shared key encryption
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

RSA Assumption

A
  1. Basis: RSA’s security relies on the difficulty of factoring large numbers.
  2. Setup: Setup: RSA parameters (N, e, d) are generated, with d being the inverse of e modulo the totient of N.
  3. Challenge: An adversary is given N (the modulus), e (the public exponent), and y (a number).
  4. Goal: The adversary tries to find x such that x^e is congruent to y modulo N.
  5. Security: RSA is considered secure if no efficient algorithm can solve this for x in a polynomial amount of time. The success of an adversary should be negligible.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

RSA Key Generation

A

Step 1: Choose two large prime numbers, p and q.
Step 2: Calculate N by multiplying p and q.
Step 3: Find the totient of N (represented by φ(N)) as (p-1)(q-1).
Step 4: Select a public exponent e that is coprime with φ(N).
Step 5: Calculate the private exponent d as the multiplicative inverse of e modulo φ(N).
Output: Public key (N, e) and private key (N, d).
Tip: The key length determines how secure the RSA setting will be. Longer keys are typically more secure.

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

RSA Encryption and Decryption

A

KeyGen: pk=(N, e), sk=(N, d) ß GenRSA(1 n )
Enc: Given pk=(N, e) and message m:
c = m^e (mod N)
Dec: Given sk=(d, N) and ciphertext c:
m = c^d (mod N)

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

How Secure is textbook RSA?

A

Textbook RSA is not secure at all and not even a
proper encryption. There are several reasons:

  1. Homorphic properties: Ciphertext operations lead to Plaintext alterations
  2. Lack of Padding
  3. Deterministic Encryption - Given plaintext will always produce the same ciphertext. Can be exploited in Chosen Plaintext Attacks
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

RSA’s characteristics as a pseudo-random trapdoor permutation

A

The slide notes that the only known method to compute the eth root (essentially decrypt without the private key) is by factoring N, which is considered hard.
There is no known reduction to other problems, and there’s evidence suggesting that no such reduction exists, meaning the RSA problem may be intrinsically difficult without factoring N. Essentially, without private exponent the only way to decrypt message is factoring N which is hard in polynomial time.

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

Common Modulus Attack

A

Common Modulus Attack in RSA:

  • Occurs when RSA pairs use the same modulus N
  • Two messages encrypted with different public exponents but same N can be exploited.
  • Using modular arithmatic, an attacker can find the original message without the private key.
  • Avoid by using unique moduli for each key pair.

Key Point: Never reuse the modulus N in multiple RSA key pairs.

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

Common Modulus Expanded

A

The common modulus attack in textbook RSA can occur when the same modulus ( N ) is used with different public exponents. Here’s a simplified explanation of the attack:

  1. Two public keys have the same modulus N but different exponents e_1 and e_2
  2. The attacker gets two ciphertexts that are encrypted from the same message m using these public keys.
  3. With some clever math (the Extended Euclidean Algorithm), the attacker finds two numbers a and b that relate e_1 and e_2.
  4. These numbers are then used to combine the ciphertexts in a special way to cancel out the exponents and reveal the original message m.

This attack is a reminder that each RSA key pair should have a unique modulus to prevent such vulnerabilities.

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

What is Padding

A

Process of adding additional data to the plaintext before encrypting it

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

Why is Padding Neccessary?

A
  1. Non-Determinism and Randomness: Padding adds randomness, ensuring that the same message will encrypt differently each time, and removing deterministic nature of RSA
  2. Prevents chosen ciphertext and plaintext attacks due to RSA now not deterministic and is random.
    3.
17
Q

Types of padding

A

OAEP and PKCS#1 1.5

18
Q

How is RSA in practice used?

A

Hybrid Encryption with padding:

  1. A random key x is chosen
  2. Random key x is passed through a hash function to provide key k for AES encryption for the actual message creating ciphertext c2
  3. The random key ‘x’ is then encrypted using the recipient’s public key ‘pk’ with RSA, applying a padding scheme such as PKCS #1.5 or OAEP to create ciphertext c1
  4. Both c1 and c2 are transmitted to the recepient.
19
Q

Why is Hybrid Encryption Used?

A

No deterministic encryption can be CPA-secure.
Public-key encryption must be randomized.

Also efficiency

20
Q
A