Pretty Good Security: Fact of The Week
Pretty Good Security: Fact of The Week
Pretty Good Security: Fact of The Week
Chapter 11, 12 Gollman: Computer Security Chapter 8, 9 Bishop: Introduction to Computer Security Chapter 9, 10 Bishop: Computer Security: Art and Science
Backups (redundancy)
Just about everyone who has used a computer system has experienced losing important data in some kind of accident. There are many reasons why data get lost: it might be due to carelessness or natural disaster. The purpose of a backup is to make a copy of data which is unlikely to be lost or destroyed by the same act as the original. 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 dierent physical location. Today, the economics of backup have changed and data can often be mirrored to a disk at a dierent physical location, by using network copying. Tapes are relatively unreliable, so they have low security compared to disks. Operating systems have dierent preferred ways of making backups, using dierent 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 1
we lose an important piece of hardware. Redundancy is like an insurance policy. Clearly, making backups of every le is a time-consuming process, and it requires a lot of storage. There are two kinds of backup Full dump: copies every le on a source medium to a backup medium. Incremental or dierential dump: copies les according to the level of the dump. A level 0 dump copies everything. A level 1 dump copies everything which has changed since the last level 0 dump. A level 2 dump copies everything which has changed since the last level 1 dump or level 0 dump and so on. (i.e. all levels which are lower). Incremental dumps are applied according to some pattern. There are various philosophies about how to choose the backup types. Here is a simple sequence: 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 les which have been modied 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 dierent tape, or other medium, this means we now have potentially several copies of each modied le 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 1 1 1 -> -> -> -> 3 3 3 3 -> -> -> -> 2 2 2 2 -> -> -> -> 5 5 5 5 -> -> -> -> 4 4 4 4 -> -> -> -> 6 6 6 6
(to end of month) You should work out for yourself, as an exercise, just how many copies of les are made in this scheme? 2
The MD5 algorithm is free for use in any program, as licensed by RSA (http://www.rsasecurity.com/) who wrote it. The Secure Hash Algorithm is proprietary, owned by the US department of commerce. Its availability 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 le, 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.
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-key and follow the prompts (and defaults). You will need to think of a passphrase which is long but easy to remember: e.g. I could tell you my pass-phrase but then I would have to kill you This 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 les. If you want to make your public key available for others, so that they can send you encrypted les, you must extract it as text and perhaps mail it to them, or make it available on the web. The keys are complicated and can be used in binary form, or ASCII form. My public key is extracted with gpg --export -a mark > filename and 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 QIXAd3zBd6sBrYkMk15bKeNj9hcEnZXtK1gVXPYIi2s03aVhq6fEFdigNlD3qWBE vP5rMg1sa5uxcHd813FQC8LJPjRsHwUQ7lk7wkXc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vBRzQ9ZGYCtvu35++wYl7o+ =ZzKN -----END PGP PUBLIC KEY BLOCK----When you receive a key from someone else, you can add it to your keyring by saving the key to a le (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 dont have to strip away the rest of the message. You should be careful not to get any extra spaces or characters into the le, or the key will be read incorrectly (i.e. dont cut and paste from the screen, save to a le). To add the key from a le, then: gpg --import filename In 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 sub (1) 1024D/BB3B5564 created: 2001-07-24 expires: never 1024g/EEF5CD48 created: 2001-07-24 expires: never Sigmund Straumsnes <sigmund@example.org> trust: -/q
Command> sign pub 1024D/BB3B5564 created: 2001-07-24 expires: never 6 trust: -/q
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
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 le from Sigmund. I decrypt it like this: gpg --decrypt filename How do I know it came from Sigmund? The answer is I dont 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 nd 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 Sigmunds 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 (in my own keyring): 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 les e.g. anyone on Windows 95, or the superuser on Unix). This results in a new le lename.asc. (Ascii, signed message) This is a service to me and to anyone else who trusts my signature. I can now make this new signed signature available to others, perhaps through a key server. 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) "
Now, when Charlie decrypts the message, he sees Alices 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. Encrypt+sign : Inventor Alice encrypts a document describing her secret biotechnology patent, worth millions, for Bob, the patent lawyer. She signs the message so that Bob knows it is authentic. Unfortunately, her so-called friend Charlie (still angry about her falsied affections) intercepts the message along the way: A C : ({My patent}B )a Charlie laughs, knowing he is now rich. He strips o Alices signature and signs the message himself. ({My patent}B )a {My patent}B {My patent}B ({My patent}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. The solution to these attacks is to ENCRYPT-SIGN-ENCRYPT messages. Note that symmetrical ciphers are not susceptible to these attacks. We see that encryption mechanisms, while useful, are not an assurance of security.
10