Question: Problem 3 , Part 1 Alice sends a message ( M ) to Bob, encrypted using the public RSA key to get C 1 =
Problem Part
Alice sends a message M to Bob, encrypted using the public RSA key to get C
Eve intercepts the encrypted ciphertext, and wants uncover m using a chosen ciphertext attack, based on the fact that RSA is homomorphic under multiplication.
If Eve performs a homomorphic multiplication of C by what will be Eve's ciphertext c
Write a function that performs a homomorphic multiplication of c by x
PUBKEY
C
# RSA Encryption
# @param m Int plaintext
# @param key Int Int the public key
# @return Int ciphertext
def encryptm key:
n e key
return me n
# Performs homomorphic multiplication on encrypted ciphertext
# @param c Int original ciphertext
# @param x Int number to multiply by
# @param key Int Int the encryption key
# @return Int new ciphertext
def homomorphicmultiplicationc x key:
# PROBLEM PART
YOUR WORK HERE
Problem Part : In a chosen ciphertext attack, the attacker chooses a ciphertext C and gets its corresponding decrypted plaintext p
Write a function showing how Eve can uncover Alice's plaintext M from C
# Bob decrypts using private key
# @param c Int ciphertext
# @return Int plaintext
def decryptc:
d
return cd PUBKEY
# Eve can uncover Alice's plaintext using the chosen ciphertext
# @param x Int the multiplier
# @param p Int the decryption of ciphertext homomorphically multipled by x
# @param key Int Int the public key
# @return Int the original plaintext
def evex p key:
# PROBLEM PART
# YOUR WORK HERE
PROBLEM PART : How can padding prevent this attack? Write a padding function.
P# Simple padding function for messages
# @param m Int plaintext
# @return Int padded plaintext
def padm:
# PROBLEM PART
# YOUR WORK HERE
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
