RSA Public-Key Encryption and Signature Lab
RSA Public-Key Encryption and Signature Lab
Fundamentals of IT Security
Assignment : RSA (RIvest-Shamir-Adleman)
Group members:
Section - 1
December, 2021
The when this code is compiled it will give us the following private key
So with the given p and q and e values we can generate the following private key
Then we will initialise our values that is provided to us and encrypt the message
We have now found the encrypted message of the word “A top secret!”.
We now have to decrypt the following ciphertext back to it’s ascii form
ciphertext =¿
8 C 0 F 971 DF 2 F 3672 B 28811407E2 DABBE 1 DA 0 FEBBBDFC 7 DCB 67396567 EA 1E2493 F
Since we are told the private/public keys are the same as of the ones from task 2 we
can use them for this section as well
To convert it into ascii format we will use python codecs and use it’s decode method
to decode the text.
In this task we are going to sign “I owe you $2000” using our private key.
To sign this text we will use this formula M ❑d mod (n)❑, where M is our message we
want to sign.
We will first change this text into hex format
We will now sign “I owe you $3000” and see what the changes are.
As we can see we have got a completely different text even though we only changed
1 character in our signed message.
In this task what we are going to do is verify if the message “Launch a missile” is sent
from alice or not.
We are going to use this formula to verify the message S❑e mod (n) where S is the
signature.
Now we will tamper the code a little bit and see if the output changes
When we compile this code we will get.
As we can conclude the message when it is decrypted is not readable suggesting that
this was not actually sent from alice.