Communication using Public Key Encryption

Bob composes a message, M to Alice. He encrypts it with P. He
sends EP(M) to Alice.

Alice decrypts it with the secret key, computing
DS(EP(M)) = M and reads the message.

The trick is to come up with algorithms and key pairs where knowing P
doesn't help Eve find S.

One such trick is factoring, which is the basis of the RSA
(Rivest-Shamir-Adelman method). If P is the product of
two very large prime numbers, and S is related to those prime
factors, Eve can only find S by factoring P.

Quiz Question Nr. 1

Encryption is:

information that cannot be read without special information

the process of converting plaintext into ciphertext

the process of converting ciphertext into plaintext

the process of cracking the code with the use of a computer program

Quiz Question Nr. 2

Which of the following codes is not a kind of cryptographic code?

The Caesar Code

The Vigenere Code

The ASCII Code

The Enigma Code

Quiz Question Nr. 3

Assuming a Caesar code with rotation 10 and the use of the
whole ASCII
character set of 128 characters for typing a message, which of the
following numbers will represent the letter
lowercase z (its ASCII code is 122) in the
ciphertext?

2

4

16

132

Do you see any problem with the setup described in Quiz Question Nr. 3?

Quiz Question Nr. 4

Which of the following statements about breaking the Caesar Code is TRUE?

It is secure against all but brute-force attacks.

It can be broken only with the help of a computer to execute many trial-and-error runs.

It can be broken with the help of ASCII encoding and the modulo operator.

It can be broken with the help of statistical analysis.

Quiz Question Nr. 5

The Vigenere Cipher is more secure if:

the codeword is short

the codeword is long

a different codeword is used for every message

the codeword has a known length

Quiz Question Nr. 6

Systems that use private keys are

unbreakable.

difficult to break, depending on the algorithm

difficult to break, depending on the private key

difficult to break, depending on the algorithm and private key

Quiz Question Nr. 7

Which of the following statements is TRUE?

Public key encryption is insecure because it needs two keys.

Public key encryption is secure because it needs two keys.

Public key encryption is insecure because everyone knows your public key.

Public key encryption is secure because no one else knows your private key.

Task 1: Play the RSA game with a friend

For simplicity, I may just demo this on a single machine, but you can
test that I'm not cheating by doing the exercise.

Notice how big the Public Modulo (p*q) is. This is the
value of n. Imagine trying to factor that to get p and q!

Skip down to below the solid line to the pair of boxes labeled
plaintext and ciphertext in hex. (Notice how you now
understand what hex means: since the encryption is going to be
a long string of bits, hex is incredibly useful here..)

Type in a message (plaintext) and encrypt it. Erase the plaintext
and decrypt it.

Exercise Using the RSA Cipher

Let's make this a bit more realistic. Choose a partner (say from the
row in front of or behind you, so you can't easily look onto her
monitor, though it doesn't really matter). One of you will be
the sender and the other the receiver.

The receiver uses this
customized receiver version of Herbert
Hanewinkel's form to create a key pair.q

She transmits the public key to the sender. Specifically, she
sends the last field of the form above the horizontal line, the
input labeled OpenPGP Multi Precision Integer (MPI) of Public Key
(base64). (This is an encoding of both e and n, in one
relatively compact representation.)

(For a less-realistic but faster short-cut, just use two
different browsers on the same machine, say Chrome and
Firefox. One is the sender and one is the receiver. You can then
just copy/paste between browsers instead of using email.)

The sender copies the packed public key into this
customized public
version of the RSA encryption form. She clicks on the button to
unpack e and n from the public key.

The sender encrypts her message. The message can be anything.
It doesn't even have to be private. If you're feeling stumped,
send the identity of the important character who dies
in Harry Potter and the Half-Blood Prince and who kills
him. This is an important secret; don't assume everyone has
read the book.

The sender then copy/pastes the ciphertext into an email message
and emails it to the receiver.

The receiver copy/pastes the ciphertext into the same RSA form,
above (the one that knows the decryption key) and decrypts the
message.

Verify that the message was transmitted correctly and secretly.

Notice the contrast between using public key and private key
encryption. In private key encryption, as with Caesar and
Vigenère, both the sender and receiver have the key and do pretty
much the same thing. Thus, codes like that are
called symmetric cryptosystems. In public key encryption, on
the other hand, the sender and receiver do very different things. The
receiver has to generate the public key that allows her to receive
messages that only she can read; the sender doesn't know anything that
Eve doesn't know. Thus, public key systems are also
called asymmetric cryptosystems.

Quiz Question Nr. 8

Public key encryption is useful because:

it is used by people who want to keep their communication secret from the government

it is used by websites such as Google, Facebook, Tumblr, etc.

it is used for financial transactions on the web

all of the above

But, of course, the most important thing it does is solve the key
distribution problem.

Quiz Question Nr. 9

Which of the following is TRUE:

the public key encrypts a message that is decrypted by the private key

the private key encrypts a message that is decrypted by the public key

both A and B

neither A nor B

Summary

We hope that after these activities you can:

understand how encryption and decryption work

understand the difference between private and publick key cryptography

the uses of private and public key cryptography

Solutions

Will be posted later, visit again after
.

Quiz questions:

1. B
2. C ASCII just represents text using numbers
3. B because 122+10 = 132, but 132-128 is 4. The problem is that 4 is
not a printable character, so we should boost them up to printable characters
4. D
5. B or C
6. D
7. D
8. D, of course
9. C