Bird
Raised Fist0
Cybersecurityknowledge~20 mins

Asymmetric encryption (RSA, ECC) in Cybersecurity - Practice Problems & Coding Challenges

Choose your learning style10 modes available

Start learning this pattern below

Jump into concepts and practice - no test required

or
Recommended
Test this pattern10 questions across easy, medium, and hard to know if this pattern is strong
Challenge - 5 Problems
🎖️
Asymmetric Encryption Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
How does asymmetric encryption differ from symmetric encryption?

Which statement best explains the key difference between asymmetric and symmetric encryption?

AAsymmetric encryption uses two different keys, while symmetric encryption uses the same key for both encryption and decryption.
BAsymmetric encryption is faster than symmetric encryption because it uses simpler algorithms.
CAsymmetric encryption uses the same key for encryption and decryption, while symmetric encryption uses two different keys.
DAsymmetric encryption does not require keys, while symmetric encryption requires keys.
Attempts:
2 left
💡 Hint

Think about how keys are used in each encryption type.

📋 Factual
intermediate
2:00remaining
Key size comparison between RSA and ECC

Which of the following correctly compares the typical key sizes of RSA and ECC for similar security levels?

AKey size does not affect security in RSA or ECC.
BECC keys are generally much larger than RSA keys for the same security level.
CRSA and ECC keys are usually the same size for the same security level.
DRSA keys are generally much larger than ECC keys for the same security level.
Attempts:
2 left
💡 Hint

Consider which algorithm is known for smaller keys with strong security.

🚀 Application
advanced
2:00remaining
Choosing encryption for a mobile app

You are designing a mobile app that requires secure communication but has limited processing power and battery life. Which asymmetric encryption method is best suited?

ARSA, because it is widely used and easy to implement.
BNeither RSA nor ECC; symmetric encryption is better for mobile apps.
CECC, because it provides strong security with smaller keys and less computation.
DUse both RSA and ECC together to maximize security.
Attempts:
2 left
💡 Hint

Think about efficiency and resource use on mobile devices.

🔍 Analysis
advanced
2:00remaining
Security risk of private key exposure

What is the main security risk if the private key in an RSA or ECC system is exposed?

AAn attacker can decrypt messages meant only for the key owner and can impersonate the owner.
BThe public key becomes invalid and cannot be used anymore.
COnly the encrypted messages sent before exposure are at risk, not future messages.
DThe encryption algorithm automatically changes keys to prevent risk.
Attempts:
2 left
💡 Hint

Consider what the private key controls in asymmetric encryption.

❓ Reasoning
expert
2:00remaining
Why is ECC preferred over RSA in modern cryptography?

Which reason best explains why ECC is increasingly preferred over RSA in modern cryptographic systems?

AECC is easier to implement correctly than RSA, reducing programming errors.
BECC offers equivalent security with smaller keys, leading to faster computations and lower power consumption.
CRSA keys are no longer secure against modern attacks, while ECC keys are unbreakable.
DECC does not require a private key, simplifying key management.
Attempts:
2 left
💡 Hint

Think about efficiency and security trade-offs in cryptography.

Practice

(1/5)
1. What is the main purpose of asymmetric encryption like RSA and ECC?
easy
A. To use the same key for both encrypting and decrypting
B. To store passwords in plain text
C. To use two different keys: one to encrypt and one to decrypt
D. To speed up internet connections

Solution

  1. Step 1: Understand key usage in asymmetric encryption

    Asymmetric encryption uses two keys: a public key to encrypt and a private key to decrypt messages.
  2. Step 2: Compare with symmetric encryption

    Symmetric encryption uses the same key for both encrypting and decrypting, which is different from asymmetric encryption.
  3. Final Answer:

    To use two different keys: one to encrypt and one to decrypt -> Option C
  4. Quick Check:

    Asymmetric encryption = two keys (public/private) [OK]
Hint: Remember: public key encrypts, private key decrypts [OK]
Common Mistakes:
  • Confusing asymmetric with symmetric encryption
  • Thinking one key is used for both encrypting and decrypting
  • Believing encryption speeds up internet
  • Assuming passwords are stored in plain text
2. Which of the following is a correct statement about RSA keys?
easy
A. RSA does not use any mathematical operations
B. RSA uses a single key for both encryption and decryption
C. RSA keys are always 128 bits long
D. RSA keys are generated using large prime numbers

Solution

  1. Step 1: Recall RSA key generation method

    RSA keys are created by multiplying two large prime numbers to form the public and private keys.
  2. Step 2: Check other options for correctness

    RSA does not use a single key, keys are not fixed at 128 bits, and it heavily relies on math operations.
  3. Final Answer:

    RSA keys are generated using large prime numbers -> Option D
  4. Quick Check:

    RSA key generation = large primes [OK]
Hint: RSA keys come from multiplying big prime numbers [OK]
Common Mistakes:
  • Thinking RSA uses one key only
  • Assuming RSA keys have fixed small size
  • Ignoring the role of prime numbers
  • Believing RSA avoids math operations
3. Consider this simplified RSA encryption example:
public_key = (e=3, n=33)
private_key = (d=7, n=33)
message = 4
encrypted = (message^e) mod n
decrypted = (encrypted^d) mod n

What is the decrypted message?
medium
A. 4
B. 7
C. 3
D. 9

Solution

  1. Step 1: Calculate encrypted message

    encrypted = (4^3) mod 33 = 64 mod 33 = 31
  2. Step 2: Calculate decrypted message

    decrypted = (31^7) mod 33. Calculating 31^7 mod 33 gives 4 (using modular exponentiation).
  3. Final Answer:

    4 -> Option A
  4. Quick Check:

    Decrypted message matches original message [OK]
Hint: Encrypt then decrypt returns original message [OK]
Common Mistakes:
  • Forgetting to apply modulo operation
  • Mixing up public and private keys
  • Incorrectly calculating powers
  • Assuming encrypted equals decrypted
4. A developer wrote this ECC key generation snippet but it fails:
private_key = generate_ecc_key()
public_key = private_key * G

What is the likely error?
medium
A. Public key is generated by multiplying G by private key, not the other way
B. Private key must be a point, not a number
C. Private key cannot be used to generate public key
D. Multiplying private key by G is incorrect; should add G

Solution

  1. Step 1: Understand ECC key generation

    In ECC, the public key is generated by multiplying the base point G by the private key scalar.
  2. Step 2: Identify the error in code

    The code multiplies private_key by G, but the correct order is G multiplied by private_key.
  3. Final Answer:

    Public key is generated by multiplying G by private key, not the other way -> Option A
  4. Quick Check:

    ECC public key = G * private key [OK]
Hint: Order matters: base point times private key [OK]
Common Mistakes:
  • Reversing multiplication order
  • Confusing addition with multiplication
  • Thinking private key is a point
  • Believing private key can't generate public key
5. Why might ECC be preferred over RSA for securing mobile devices?
hard
A. RSA is faster and more efficient on mobile devices
B. ECC uses smaller keys for similar security, saving battery and space
C. ECC keys are easier to guess than RSA keys
D. ECC does not require a private key

Solution

  1. Step 1: Compare key sizes and efficiency

    ECC achieves strong security with smaller keys compared to RSA, which helps reduce processing power and battery use on mobiles.
  2. Step 2: Evaluate other options

    ECC keys are not easier to guess; RSA is generally slower on mobiles; ECC requires private keys like RSA.
  3. Final Answer:

    ECC uses smaller keys for similar security, saving battery and space -> Option B
  4. Quick Check:

    ECC = smaller keys, better for mobiles [OK]
Hint: Smaller keys mean less power use on mobiles [OK]
Common Mistakes:
  • Thinking ECC keys are weaker
  • Assuming RSA is faster on mobiles
  • Believing ECC doesn't use private keys
  • Ignoring battery and space constraints