CS 341: Cryptography
RSA Party Instructions
The second attempt at a party will happen from 8:30-9:40AM Wednesday, February 2. Code and results will
be due by 11:59PM the same day.
What to do
- Test your program on the Example results
below to make sure you get the same results I got.
- Generate a new key set. Go to
this key submission page and post your (e, n).
- Pick a nearby partner with whom to exchange messages.
Each of you should choose a message from your list, encode it,
encrypt it using your partner's encryption key, and e-mail your
message to your partner. When you get your partner's message, decrypt
it using your own decryption key, decode it, and see whether you received
the message that was sent.
- Do the same thing again (with a new message), but this
time, sign your message by computing D_you(E_recipient(M)).
- Create a signed, encrypted message
D_you(E_somebody(M)) and post it at
this message-posting page.
For every such message that gets posted, your job by the end of the
day today is to identify the sender, the intended recipient,
and the message.
Here are results from my implementation. I generated these items and stored them
in like this:
python rsa.py --keygen
echo "Take my advice. Don't mess with the emu." > message.txt
python rsa.py --encode < message.txt > encoded.txt
python rsa.py --encrypt 000000000013 EF3D4B594AB5 < encoded.txt > encrypted.txt
python rsa.py --decrypt 25C64EF5D19B EF3D4B594AB5 < encrypted.txt > decrypted.txt
python rsa.py --decode < decrypted.txt > decoded.txt
Key:
n: EF3D4B594AB5
e: 000000000013
d: 25C64EF5D19B
Original message:
Take my advice. Don't mess with the emu.<newline>
Encoded message:
0054616B6520006D7920616400766963652E0020446F6E270074206D6573
0073207769740068207468650020656D752E00000000000A
Encrypted message:
09634F194D4357EC3A1C31ABE9FF09D17340525F5BEA908372FB843AAC85
0B2EEACF23B16F2F019E16B24A84F5685A2F14CF3E120180
Decrypted message:
0054616B6520006D7920616400766963652E0020446F6E270074206D6573
0073207769740068207468650020656D752E00000000000A
Decoded message:
Take my advice. Don't mess with the emu.<newline>