Fact of the weekIn 1977, three MIT professors Ronald Rivest, Adi Shamir and Len Adleman, building on the work of Diffie and Hellmann created a method of encrypting data for transmission which has become a standard for the transmission of sensitive information. This is known as RSA encryption. The method was patented in the US and a company was formed to license the technology. |
In older times, backups of disks were always made to tape. Tape was chosen because it is a relatively cheap medium, which is easily transported. If we want a backup to be protected from the same accident that would destroy the original, we have to store it in a different physical location. Today, the economics of backup have changed and data can often be mirrored to a disk at a different physical location, by using network copying. Tapes are relatively unreliable, so they have low security compared to disks. Operating systems have different preferred ways of making backups, using different software and media. Some things are common to all systems however.
The key principle of backups is redundancy. Redundancy means making multiple copies of data, so that we always have something to fall back on. We can have backups of data, but we can also have backup of services, in case we lose an important piece of hardware. Redundancy is like an insurance policy.
Clearly, making backups of every file is a time-consuming process, and it requires a lot of storage. There are two kinds of backup
Day Level
----------
Mon 0
Tue 1
Wed 2
Thu 3
Fri 4
Sat 1
See how this works. We start with a full dump on Monday evening,
then on Tuesday we dump files which have been modified since Monday,
on Wednesday we dump everything which has changes since Tuesday
and so on, until Saturday, where we summarize everything which has
changed since Monday. If we copy each dump to a different
tape, or other medium, this means we now have potentially several
copies of each modified file on backup, i.e. we have a high
level of redundancy. This may or may not be necessary.
Another well-known sequence which provides a very high level of redundancy is the so-called Towers of Hanoi algorithm. The pattern over a number of weeks goes like this:
0 -> 3 -> 2 -> 5 -> 4 -> 6
1 -> 3 -> 2 -> 5 -> 4 -> 6
1 -> 3 -> 2 -> 5 -> 4 -> 6
1 -> 3 -> 2 -> 5 -> 4 -> 6
(to end of month)
You should work out for yourself, as an exercise, just how
many copies of files are made in this scheme.
There are some things we can do to increase our confidence in data we receive from a foreign source, but when it comes down to it, all we can do is to verify the source of data and the integrity of data. In other words, we can tell with reasonable certainty who sent a message, and we can tell that the message has not been altered by anyone else in getting from the sender to the recipient. Trust must then be implicit.
Checksums or Message digests are non-forgeable digital signatures which quickly summarize the contents of a file. The idea is to create an algorithm which digests the contents of a file and produces a single value which uniquely summarizes its contents. If we change one bit of a file, then the value of the message digest also changes. Popular algorithms include:
MD4
MD5 (Stronger than md4)
SHA1
The MD5 algorithm is free for use in any program, as licensed by RSA who wrote it The
Secure Hash Algorithm is proprietary, owned by the US department of
commerce. It availabilty for use in programs outside of the US is
therefore unclear. The MD5
program can be collected and installed on any system with a C
compiler. Today, functions which implement the algorithm are built
into most languages.
It produces a 128 bit hash of a file, which is represented
in a printable ASCII sequence:, e.g.
cube% md5 .cshrc
MD5 (.cshrc) = 519ab7d30dba4a2d16b86328e025ec72
MD5 signatures are often quoted at security software repositories
so that it is possible to verify the authenticity of software (assuming
the MD5 signature is authentic!)
Another type of signature which is used by PGP, amongst other schemes (see below), is the Message Authentication Code (MAC). This is like a message digest but includes a component encrypted with a private key, in such a way that the receiver of the message can use a public key to check the identity of the sender.
We shall use the GNU Privacy Guard program, for this course, since PGP has become poorly documented and difficult to understand. The principles are the same. PGP is called "pretty good privacy" because it explores the use of public, private key methods to enable encryption and signing. This allows users to send private messages to one another using strong cryptographic methods. Why not perfect security then? The reason is that, while the cryptographic methods might work well, users can still be tricked into trusting false data, so the security of even cryptographic methods is not perfect.
To begin using GPG, you have to create a pair of keys: a private key and a public key. To do this you use:
gpg --gen-keyand follow the prompts (and defaults). You will need to think of a pass-phrase which is long but easy to remember: e.g.
I could tell you my pass-phrase but then I would have to kill youThis will be used to encrypt your private key, so that only you can read it. Of course you should not reveal the pass-phrase to anyone. When the key pair is created, it is hidden in private files. If you want to make your public key available for others, so that they can send you encrypted files, you must extract it as text and mail it to them. The keys are complicated and can be used in binary form, or ASCII form. My public key is extracted with
gpg --export -a mark > filenameand looks something like this:
-----BEGIN PGP PUBLIC KEY BLOCK----- Version: GnuPG v0.9.10 (SunOS) Comment: For info see http://www.gnupg.org mQGiBDtdcNkRBACN4xRpVDv0Zx7tbv5JhD+W1uDJKfiBO7DtZ8IXz2Nv1iuhyCFb QIXAd3zBd6sBrYkMk15bKeNj9hcEnZXtK1gVXPYIi2s03aVhq6fEFdigNlD3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IDsY14AmO0lDn0Lvhs9cf4exxDUH6u/WwIAoMRL 3vBRzQ9ZGYCtvu35++wYl7o+ =ZzKN -----END PGP PUBLIC KEY BLOCK-----When you receive a key from someone else, you can add it to your key-ring by saving the key to a file (exactly as above). GPG looks for the lines
-----BEGIN PGP PUBLIC KEY BLOCK----- -----END PGP PUBLIC KEY BLOCK-----and takes what lies between them, so you don't have to strip away the rest of the message. You should be careful not to get any extra spaces or characters into the file, or the key will be read incorrectly (i.e. don't cut and paste from the screen, save to a file). To add the key from a file, then:
gpg --import filenameIn order to indicate to others that you are sure you know whose key it is, you can sign keys and say how much you trust them, so that others can share in your private knowledge. You should only sign keys that you know to be authentic. Use of signatures is a way of telling others that you think they should trust the information you send them. You can also sign your own public key so that others can verify that it has not been tampered with between you and them.
To sign a key in your keyring,
nexus$ gpg --edit-key sigmund
gpg (GnuPG) 0.9.10; Copyright (C) 1999 Free Software Foundation, Inc.
This program comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it
under certain conditions. See the file COPYING for details.
pub 1024D/BB3B5564 created: 2001-07-24 expires: never trust: -/q
sub 1024g/EEF5CD48 created: 2001-07-24 expires: never
(1) Sigmund Straumsnes <sigmund@example.org>
Command> sign
pub 1024D/BB3B5564 created: 2001-07-24 expires: never trust: -/q
Fingerprint: 2962 8834 FAF4 7684 0E08 1B7B 87E8 916C BB3B 5564
Sigmund Straumsnes <sigmund@example.org>
Are you really sure that you want to sign this key
with your key: "Mark Burgess (Associate Professor, Oslo College) <mark@iu.hio.no>"
Really sign? y
You need a passphrase to unlock the secret key for
user: "Mark Burgess (Associate Professor, Oslo College) <mark@iu.hio.no>"
1024-bit DSA key, ID E63880EC, created 2001-07-24
gpg -r recipient --encrypt filename --output newfile e.g. gpg -r sigmund --encrypt sig.msgThis results in a file called filename.gpg which I can then mail or give to that person. Note that with asymmetric encryption, I encrypt specially for one recipient.
gpg --decrypt filename --output newfileSince I need my private key to decipher the message, I have to type in my pass-phrase. The result is a newfile.
PGP occasionally warns us that a public key might not be trustworthy. How do we really know that it is the right key for the right person? For instance, suppose I receive an encrypted file from Sigmund. I decrypt it like this:
gpg --decrypt filenameHow do I know it came from Sigmund? The answer is I don't really know, unless I watched Sigmund send me the message, and I am sure that the message was not altered in passage. Anyone could claim to be Sigmund.
We decide which keys are to be trusted or not. Our trust is conferred by signing a key with our own. If we find a key which has been signed by several trustworthy individuals, we might be more inclined to trust the authenticity of the key, assuming that we trust them. (This leads to a so-called Web of Trust) For instance, I have just received Sigmund's public key. Since I watched him send it to me, I believe that it is his. I can sign the key with my signature like this:
nexus% gpg --clearsign filename (or just -s for a binary file)When ever you sign something (and use you private key) you have to give your passphrase, in order to unlock it. (This is because, on most systems, others can access your files -- e.g. anyone on Windows 95, or the superuser on Unix). This results in a new file filename.asc. (Ascii, signed message)
This is a service to me and to anyone else who trusts my signature. Now when I try to decode a message from him:
nexus$ gpg sig.msg.asc gpg: Signature made Tue Jul 24 15:39:27 2001 MET DST using DSA key ID E63880EC gpg: Good signature from "Mark Burgess (Associate Professor, Oslo College) "
Let's define some notation for representing encrytion and signing.
| Public keys: | capital letters |
| Private keys: | small letters |
| Encryption with public key A: | { "message" }A |
| Signing with private key b: | ( "message" )b |
A -> B : {( "I love you!!" )a}B
Alas, Bob does not like Alice and wants to embarrass her. He
decrypts Alice's message, leaving her signed message,
{( "I love you!!" )a}B -> ( "I love you!!" )a
and re-encrypts the message for Charlie to read:
B -> C : {( "I love you!!" )a}C
Now, when Charlie descrypts the message, he sees Alice's
signature and believes that Alice loves him. The very security
assured by signing will now incriminate Alice.
This is more serious if the message is "I.O.U. $1,000,000".
A -> C : ({"My patent...." }B)a
Chalie laughs, knowing he is now rich. He strips off Alice's
signature and signs the message himself.
({ "My patent" }B}a -> { "I love you!!" }B
{ "I love you!!" }B -> ({ "I love you!!" }B)c
He then sends it to Bob, the patent lawyer:
C -> B: ({"My patent...." }B)c
It now appears that the idea comes from Charlie.
We see that encryption mechanisms, while useful, are not an assurance of security.
Thought of the weekIf you would wish another to keep your secret, first keep it yourself. |