Lecture 23

Cryptography,
Prime Factorizations,
and Public Key encryption


Background: One can think of encryption as a mapping between the ascii character set {a,b,c,...,z,A,B,C,...,Z,0,1,...,9,...} and itself which takes a subset of characters S1 and maps it to another set S2.

Early methods created a 1-1 correspondence between characters. Such schemes were in use in ancient times (e.g. by Julius Caesar!).

Decryption amounts to finding the inverse of the mapping.

One of the earliest methods for encoding information involved what is called symmetric encryption, that is using the same key to encode and decode information. The DES (Data Encryption Standard) is used by the Federal government.

The major difficulty with this method is that you have to transfer the key between sender and receiver, which is generally not secure.


To resolve this problem, in 1976 Martin Hellman and Whitfield Diffie proposed a public-key encryption system.

Assymetric encryption is based on two keys, rather than one. The public key can be distributed to anyone. The private key is secret.

If I want to encrypt a message to you, I take your public key, and my private key, and encode the message. I can then send it to you, and only you can decode it!

If I encrypt something with my private key, it can be un-encrypted using my freely available public key, but by no other key! In this way, I create a "digital signature." You can be sure that it has been sent by the user whose public key you have.

However, what if I distribute a public key, claiming that it came from someone else. I then send a message using my private key, and the recipieent thinks that it came from some one else. We have to guarantee that the public keys belong to the right people. This is the function of certificate authorities. They issue a public/private key combination after validating that the requester is who they say they are.


Here is an example of what you have to go through to get Thawte's 128 bit "super-certificate."

VeriSign is another blue-chip certificate authority.

You can see a list of trusted CA's in IExplorer by going to Tools -> Internet Options... -> Content -> Certificates ... -> Trusted Root Certificate Authorities

In Netscape and Mozilla, it can be found under Edit -> Preferences -> Privacy & Security -> Certificates -> Manage Certificates ... -> Authorities


The PGP (Pretty Good Privacy) algorithm is widely used to encrypt e-mails. The source code is available, if you sign a licensing agreement. There is also an international PGP site.

The mathematics of the RSA algorithm.

Here is an example of using RSA to generate a public/private key using prime numbers.


Real time encryption of ethernet traffic can be accomplished via SSL (secure sockets layer).

There are free, public, certificate authorities such as www.cacert.org.


References: