16 Public-Key Cryptography 149
everyone is able to lock away a message in a box. Furthermore, only you are
able to read the messages because you hold the only key opening the boxes.
Thus, your friends may even ask the biggest blabbermouth of the school to
forward the box to you.
This example shows that such a system is possible. However, there is one
drawback. This example requires a big effort. We have to purchase these pad-
locks and we have to distribute them. This would be quite expensive and
labor-intensive.
It would be nice to have a system which provides such a public-key system
without padlocks. This is possible in principle, using the one-way functions
from Chap. 14. Loosely speaking, it is easy to compute the one-way function
in the forward, standard direction, but hard to do the reverse: given a function
value, recover the corresponding argument.
In our case we need some system in which encryption is easy (so that
everyone is able to send us a message) but decryption is hard. However, you
as the legal receiver should be able to decrypt easily. You should keep some
backdoor for this. One possibility would be to use the inverse telephone book
from Chap. 14. However, here we describe a different idea.
A Limited Algebra
Real public-key cryptosystems which employ computers to encrypt and de-
crypt messages use advanced algebra. We do not describe this kind of arith-
metic here. Instead, we illustrate the principles by using a limited algebra.
Within this limited algebra we only use addition, subtraction, and multi-
plication of integers. We explicitly assume that no one is able to do division in
this limited algebra. Just think yourself back at the time when you had just
learned multiplication, but not division. With this limited algebra we now
describe how Bob sends a message to Alice. For our example, this message is
just one number.
The procedure has three parts. First, we describe how to generate the pub-
lic and the private key; then we explain how to encrypt and decrypt messages.
Construction of the Keys
First we need the keys, the private and the public one. The message is going
to be sent from Bob to Alice. Thus, Alice needs the private key to decrypt the
message. To get this private key, Alice thinks up two numbers and multiplies
them. The first of the two numbers becomes the private key. The other one
and the product are the public key. Thus, the private key is just one number
and the public key consists of two numbers, the public factor and the public
product.