by Neal R. Wagner
Copyright © 2001 by Neal R. Wagner. All rights reserved.
NOTE: This site is obsolete. See book draft (in PDF):
Each separate user constructs a public encryption algorithm E and a private decryption algorithm D. Thus Alice has a pair EA and DA, and similarly Bob has EB and DB.
Each matching pair E and D of algorithms has the properties:
The RSA public key cryptosystem also has the following pleasant property:
The word ``efficient'' means that that calculation uses an acceptable amount of resources, while ``intractible'' means roughly that this computation uses more resources than the secrecy of the message is worth. (This varies with time, as computations get cheaper.)
Alice makes her public algorithm publically available, by publishing it or by putting online, and so does every other user. She keeps her secret algorithm completely to herself. (No one else must know it.)
Here the term ``key'' is used to mean the same as ``algorithm'' above. Suppose as above that Alice and Bob have public key and private key pairs: (EA, DA) for Alice and (EB, DB) for Bob. There is some key distribution authority that keeps the public keys EA and EB and makes them available to anyone requesting them. (Using signature techniques discussed later, the authority can convince a requester that he or she is getting the correct keys.)
Bob sends a secret message M to Alice: Bob gets Alice's public key EA from the authority. Bob calculates EA(M) = C and sends C to Alice. Only Alice knows the decryption key, so only Alice can compute DA(C) = DA(EA(M)) = M. Unless there is some failure in the system, Alice knows that no one intercepting the transmission of C will be able to recover the message M. However, anyone might have sent her this message, and even Bob might have leaked the message to others.
Bob signs a message M and sends it to Alice: This mode uses the special property 4. above of the RSA cryptosystem. (Other systems usually don't have property 4., but it is still possible to create digital signatures in a more complicated way.) Bob uses his secret decryption key on the message itself (rather than on ciphertext). For RSA, the collection of all possible messages is the same as the collection of all possible ciphertexts: any integer less than some fixed integer n. Thus Bob calculates DB(M) = S. At the other end, Alice can retrieve Bob's public key EB from the key authority and use it to recover the message, by calculating EB(S) = EB(DB(M)) = M. Anyone can fetch Bob's public key and do this calculation, so there is no secrecy here, but assuming the system does not break down (that the key authority works and that the cryptosystem is not leaked or stolen or broken), only Bob can have signed this message, so it must have originated with him.
Bob can use this same method to broadcast a message intended for everyone, and anyone can verify using Bob's public key that the message can only have originated with him.
Bob signs a secret message M and sends it to Alice: This can be done in two ways, with Bob using his secret key DB and Alice's public key EA: Calculate either EA(DB(M)) = C, or DB(EA(M)) = C'. In either case, Alice reverses the process, using her secret key DA and Bob's public key EB. There is one other slight problem with the RSA cryptosystem, because the maximum size of plaintext or ciphertext is less than an integer nA for Alice, and is less than a different integer nB for Bob. What happens then depends on which of these two integers is larger, for if nA is the larger, then EA(M) might be too large to be handled by DB using a single block, so one would have the awkward business of breaking this into two blocks. However, in this case one can calculate DB(M) first, and this is definitely less than the block size of the key EA. In case the sizes are reversed, just do the two steps above in the opposite order also, so there is no need for more than one block even for a signed and secret message.
Notice that Alice knows the message must have originated with Bob, and that no one else can read it, giving both authentication and secrecy.
Bob uses a hash function to sign an arbitrarily long message using only one block: Here one just signs the hash code of the message. These matters will be discussed more thoroughly in the section on hash functions.