An Introduction To Cryptography - متمم

Transcription

An Introduction toCryptography

Copyright 1990-1998 Network Associates, Inc. and its Affiliated Companies. All RightsReserved.PGP*, Version 6.0.211-98. Printed in the United States of America.PGP, Pretty Good, and Pretty Good Privacy are registered trademarks of Network Associates,Inc. and/or its Affiliated Companies in the US and other countries. All other registered andunregistered trademarks in this document are the sole property of their respective owners.Portions of this software may use public key algorithms described in U.S. Patent numbers4,200,770, 4,218,582, 4,405,829, and 4,424,414, licensed exclusively by Public Key Partners; theIDEA(tm) cryptographic cipher described in U.S. patent number 5,214,703, licensed fromAscom Tech AG; and the Northern Telecom Ltd., CAST Encryption Algorithm, licensed fromNorthern Telecom, Ltd. IDEA is a trademark of Ascom Tech AG. Network Associates Inc. mayhave patents and/or pending patent applications covering subject matter in this software or itsdocumentation; the furnishing of this software or documentation does not give you any licenseto these patents. The compression code in PGP is by Mark Adler and Jean-Loup Gailly, usedwith permission from the free Info-ZIP implementation. LDAP software provided courtesyUniversity of Michigan at Ann Arbor, Copyright 1992-1996 Regents of the University ofMichigan. All rights reserved. This product includes software developed by the Apache Groupfor use in the Apache HTTP server project (http://www.apache.org/). Copyright 1995-1997The Apache Group. All rights reserved. See text files included with the software or the PGPweb site for further information. This software is based in part on the work of the IndependentJPEG Group. Soft TEMPEST font courtesy of Ross Anderson and Marcus Kuhn.The software provided with this documentation is licensed to you for your individual useunder the terms of the End User License Agreement and Limited Warranty provided with thesoftware. The information in this document is subject to change without notice. NetworkAssociates Inc. does not warrant that the information meets your requirements or that theinformation is free of errors. The information may include technical inaccuracies ortypographical errors. Changes may be made to the information and incorporated in neweditions of this document, if and when made available by Network Associates Inc.Export of this software and documentation may be subject to compliance with the rules andregulations promulgated from time to time by the Bureau of Export Administration, UnitedStates Department of Commerce, which restrict the export and re-export of certain productsand technical data.Network Associates, Inc. (408) 988-3832 main3965 Freedom CircleSanta Clara, CA 95054http://www.nai.cominfo@nai.com* is sometimes used instead of the for registered trademarks to protect marks registered

LIMITED WARRANTYLimited Warranty. Network Associates warrants that for sixty (60) days from the date oforiginal purchase the media (for example diskettes) on which the Software is contained will befree from defects in materials and workmanship.Customer Remedies. Network Associates' and its suppliers' entire liability and your exclusiveremedy shall be, at Network Associates' option, either (i) return of the purchase price paid forthe license, if any, or (ii) replacement of the defective media in which the Software is containedwith a copy on nondefective media. You must return the defective media to NetworkAssociates at your expense with a copy of your receipt. This limited warranty is void if thedefect has resulted from accident, abuse, or misapplication. Any replacement media will bewarranted for the remainder of the original warranty period. Outside the United States, thisremedy is not available to the extent Network Associates is subject to restrictions under UnitedStates export control laws and regulations.Warranty Disclaimer. To the maximum extent permitted by applicable law, and except for thelimited warranty set forth herein, THE SOFTWARE IS PROVIDED ON AN "AS IS" BASISWITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED. WITHOUT LIMITING THEFOREGOING PROVISIONS, YOU ASSUME RESPONSIBILITY FOR SELECTING THESOFTWARE TO ACHIEVE YOUR INTENDED RESULTS, AND FOR THE INSTALLATIONOF, USE OF, AND RESULTS OBTAINED FROM THE SOFTWARE. WITHOUT LIMITINGTHE FOREGOING PROVISIONS, NETWORK ASSOCIATES MAKES NO WARRANTYTHAT THE SOFTWARE WILL BE ERROR-FREE OR FREE FROM INTERRUPTIONS OROTHER FAILURES OR THAT THE SOFTWARE WILL MEET YOUR REQUIREMENTS. TOTHE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, NETWORK ASSOCIATESDISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOTLIMITED TO IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR APARTICULAR PURPOSE, AND NONINFRINGEMENT WITH RESPECT TO THESOFTWARE AND THE ACCOMPANYING DOCUMENTATION. SOME STATES ANDJURISDICTIONS DO NOT ALLOW LIMITATIONS ON IMPLIED WARRANTIES, SO THEABOVE LIMITATION MAY NOT APPLY TO YOU. The foregoing provisions shall beenforceable to the maximum extent permitted by applicable law.

PrefaceCryptography is the stuff of spy novels and action comics. Kids once saved upOvaltineTM labels and sent away for Captain Midnight’s Secret Decoder Ring.Almost everyone has seen a television show or movie involving a nondescriptsuit-clad gentleman with a briefcase handcuffed to his wrist. The word“espionage” conjures images of James Bond, car chases, and flying bullets.And here you are, sitting in your office, faced with the rather mundane task ofsending a sales report to a coworker in such a way that no one else can read it.You just want to be sure that your colleague was the actual and only recipientof the email and you want him or her to know that you were unmistakably thesender. It’s not national security at stake, but if your company’s competitor gota hold of it, it could cost you. How can you accomplish this?You can use cryptography. You may find it lacks some of the drama of codephrases whispered in dark alleys, but the result is the same: informationrevealed only to those for whom it was intended.Who should read this guideThis guide is useful to anyone who is interested in knowing the basics ofcryptography, and explains the terminology and technology you willencounter as you use PGP products. You will find it useful to read before youbegin working with cryptography.How to use this guideThis guide describes how to use PGP to securely manage your organization’smessages and data storage.Chapter 1, “The Basics of Cryptography,” provides an overview of theterminology and concepts you will encounter as you use PGP products.Chapter 2, “Phil Zimmermann on PGP,” written by PGP’s creator, containsdiscussions of security, privacy, and the vulnerabilities inherent in anysecurity system, even PGP.An Introduction to Cryptographyv

PrefaceFor more informationThere are several ways to find out more about Network Associates and itsproducts.Customer serviceTo order products or obtain product information, contact the NetworkAssociates Customer Care department.You can contact Customer Care at one of the following numbers Mondaythrough Friday between 6:00 A.M. and 6:00 P.M. Pacific time.Phone(408) 988-3832Or write to:Network Associates, Inc.3965 Freedom CircleSanta Clara, CA 95054U.S.A.Technical supportNetwork Associates is famous for its dedication to customer satisfaction. Wehave continued this tradition by making our site on the World Wide Web avaluable resource for answers to technical support issues. We encourage youto make this your first stop for answers to frequently asked questions, forupdates to Network Associates software, and for access to Network Associatesnews and encryption information.World Wide Webhttp://www.nai.comTechnical Support for your PGP product is also available through thesechannels:Phone(408) 988-3832EmailPGPSupport@pgp.comTo provide the answers you need quickly and efficiently, the NetworkAssociates technical support staff needs some information about yourcomputer and your software. Please have this information ready before youcall: PGP product name PGP product versionviAn Introduction to Cryptography

Preface Computer platform and CPU type Amount of available memory (RAM) Operating system and version and type of network Content of any status or error message displayed on screen, or appearingin a log file (not all products produce log files) Email application and version (if the problem involves using PGP with anemail product, for example, the Eudora plug-in)Related readingHere are some documents that you may find helpful in understandingcryptography:Non-Technical and beginning technical books “Cryptography for the Internet,” by Philip R. Zimmermann. ScientificAmerican, October 1998. This article, written by PGP’s creator, is a tutorialon various cryptographic protocols and algorithms, many of which happento be used by PGP. “Privacy on the Line,” by Whitfield Diffie and Susan Eva Landau. MIT Press;ISBN: 0262041677. This book is a discussion of the history and policysurrounding cryptography and communications security. It is an excellentread, even for beginners and non-technical people, and containsinformation that even a lot of experts don't know. “The Codebreakers,” by David Kahn. Scribner; ISBN: 0684831309. This bookis a history of codes and code breakers from the time of the Egyptians to theend of WWII. Kahn first wrote it in the sixties, and published a revisededition in 1996. This book won't teach you anything about howcryptography is accomplished, but it has been the inspiration of the wholemodern generation of cryptographers. “Network Security: Private Communication in a Public World,” by CharlieKaufman, Radia Perlman, and Mike Spencer. Prentice Hall; ISBN:0-13-061466-1. This is a good description of network security systems andprotocols, including descriptions of what works, what doesn't work, andwhy. Published in 1995, it doesn't have many of the latest technologicaladvances, but is still a good book. It also contains one of the most cleardescriptions of how DES works of any book written.An Introduction to Cryptographyvii

PrefaceIntermediate books “Applied Cryptography: Protocols, Algorithms, and Source Code in C,” by BruceSchneier, John Wiley & Sons; ISBN: 0-471-12845-7. This is a good beginningtechnical book on how a lot of cryptography works. If you want to becomean expert, this is the place to start. “Handbook of Applied Cryptography,” by Alfred J. Menezes, Paul C. vanOorschot, and Scott Vanstone. CRC Press; ISBN: 0-8493-8523-7. This is thetechnical book you should read after Schneier’s book. There is a lot ofheavy-duty math in this book, but it is nonetheless usable for those who donot understand the math. “Internet Cryptography,” by Richard E. Smith. Addison-Wesley Pub Co;ISBN: 0201924803. This book describes how many Internet securityprotocols work. Most importantly, it describes how systems that aredesigned well nonetheless end up with flaws through careless operation.This book is light on math, and heavy on practical information. “Firewalls and Internet Security: Repelling the Wily Hacker,” by William R.Cheswick and Steven M. Bellovin. Addison-Wesley Pub Co; ISBN:0201633574. This book is written by two senior researchers at AT&T BellLabs and is about their experiences maintaining and redesigning AT&T'sInternet connection. Very readable.Advanced books “A Course in Number Theory and Cryptography,” by Neal Koblitz.Springer-Verlag; ISBN: 0-387-94293-9. An excellent graduate-levelmathematics textbook on number theory and cryptography. “Differential Cryptanalysis of the Data Encryption Standard,” by Eli Biham andAdi Shamir. Springer-Verlag; ISBN: 0-387-97930-1. This book describes thetechnique of differential cryptanalysis as applied to DES. It is an excellentbook for learning about this technique.viiiAn Introduction to Cryptography

Table of ContentsPreface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . vWho should read this guide . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .vHow to use this guide . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . vFor more information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . viCustomer service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . viTechnical support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . viRelated reading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . viiChapter 1. The Basics of Cryptography . . . . . . . . . . . . . . . . . . . . . . . . . 11Encryption and decryption . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11What is cryptography? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11Strong cryptography . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12How does cryptography work? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12Conventional cryptography . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13Caesar’s Cipher . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13Key management and conventional encryption . . . . . . . . . . . . . . . . . . . . . . . 14Public key cryptography . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14How PGP works . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16Keys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17Digital signatures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18Hash functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19Digital certificates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21Validity and trust . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23Checking validity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23Establishing trust . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24Meta and trusted introducers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24Trust models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24Direct Trust . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25Hierarchical Trust . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25Web of Trust . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26Levels of trust in PGP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26An Introduction to Cryptographyix

Table of ContentsWhat is a passphrase? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27Key splitting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28Technical details . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28Chapter 2. Phil Zimmermann on PGP . . . . . . . . . . . . . . . . . . . . . . . . . . . 29Why I wrote PGP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29The PGP symmetric algorithms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33About PGP data compression routines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35About the random numbers used as session keys . . . . . . . . . . . . . . . . . . . . . 35About the message digest . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36How to protect public keys from tampering . . . . . . . . . . . . . . . . . . . . . . . . . . 37How does PGP keep track of which keys are valid? . . . . . . . . . . . . . . . . . . . 40How to protect private keys from disclosure . . . . . . . . . . . . . . . . . . . . . . . . . . 42What if you lose your private key? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43Beware of snake oil . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43Vulnerabilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48Compromised passphrase and private key . . . . . . . . . . . . . . . . . . . . . . . . . . . 48Public key tampering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49Not Quite Deleted Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49Viruses and Trojan horses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50Swap files or virtual memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51Physical security breach . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52Tempest attacks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52Protecting against bogus timestamps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52Exposure on multi-user systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53Traffic analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54Cryptanalysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54Glossary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77xAn Introduction to Cryptography

The Basics of Cryptography11When Julius Caesar sent messages to his generals, he didn't trust hismessengers. So he replaced every A in his messages with a D, every B with anE, and so on through the alphabet. Only someone who knew the “shift by 3”rule could decipher his messages.And so we begin.Encryption and decryptionData that can be read and understood without any special measures is calledplaintext or cleartext. The method of disguising plaintext in such a way as tohide its substance is called encryption. Encrypting plaintext results inunreadable gibberish called ciphertext. You use encryption to ensure thatinformation is hidden from anyone for whom it is not intended, even thosewho can see the encrypted data. The process of reverting ciphertext to itsoriginal plaintext is called decryption.Figure 1-1 illustrates this intextFigure 1-1. Encryption and decryptionWhat is cryptography?Cryptography is the science of using mathematics to encrypt and decrypt data.Cryptography enables you to store sensitive information or transmit it acrossinsecure networks (like the Internet) so that it cannot be read by anyone exceptthe intended recipient.An Introduction to Cryptography11

The Basics of CryptographyWhile cryptography is the science of securing data, cryptanalysis is the scienceof analyzing and breaking secure communication. Classical cryptanalysisinvolves an interesting combination of analytical reasoning, application ofmathematical tools, pattern finding, patience, determination, and luck.Cryptanalysts are also called attackers.Cryptology embraces both cryptography and cryptanalysis.Strong cryptography“There are two kinds of cryptography in this world: cryptography that will stop yourkid sister from reading your files, and cryptography that will stop major governmentsfrom reading your files. This book is about the latter.”--Bruce Schneier, Applied Cryptography: Protocols, Algorithms, and SourceCode in C.PGP is also about the latter sort of cryptography.Cryptography can be strong or weak, as explained above. Cryptographicstrength is measured in the time and resources it would require to recover theplaintext. The result of strong cryptography is ciphertext that is very difficult todecipher without possession of the appropriate decoding tool. How difficult?Given all of today’s computing power and available time—even a billioncomputers doing a billion checks a second—it is not possible to decipher theresult of strong cryptography before the end of the universe.One would think, then, that strong cryptography would hold up rather wellagainst even an extremely determined cryptanalyst. Who’s really to say? Noone has proven that the strongest encryption obtainable today will hold upunder tomorrow’s computing power. However, the strong cryptographyemployed by PGP is the best available today. Vigilance and conservatism willprotect you better, however, than claims of impenetrability.How does cryptography work?A cryptographic algorithm, or cipher, is a mathematical function used in theencryption and decryption process. A cryptographic algorithm works incombination with a key—a word, number, or phrase—to encrypt the plaintext.The same plaintext encrypts to different ciphertext with different keys. Thesecurity of encrypted data is entirely dependent on two things: the strength ofthe cryptographic algorithm and the secrecy of the key.A cryptographic algorithm, plus all possible keys and all the protocols thatmake it work comprise a cryptosystem. PGP is a cryptosystem.12An Introduction to Cryptography

The Basics of CryptographyConventional cryptographyIn conventional cryptography, also called secret-key or symmetric-keyencryption, one key is used both for encryption and decryption. The DataEncryption Standard (DES) is an example of a conventional cryptosystem thatis widely employed by the Federal Government. Figure 1-2 is an illustration ofthe conventional encryption intextFigure 1-2. Conventional encryptionCaesar’s CipherAn extremely simple example of conventional cryptography is a substitutioncipher. A substitution cipher substitutes one piece of information for another.This is most frequently done by offsetting letters of the alphabet. Two examplesare Captain Midnight’s Secret Decoder Ring, which you may have owned whenyou were a kid, and Julius Caesar’s cipher. In both cases, the algorithm is tooffset the alphabet and the key is the number of characters to offset it.For example, if we encode the word “SECRET” using Caesar’s key value of 3,we offset the alphabet so that the 3rd letter down (D) begins the alphabet.So starting withABCDEFGHIJKLMNOPQRSTUVWXYZand sliding everything up by 3, you getDEFGHIJKLMNOPQRSTUVWXYZABCwhere D A, E B, F C, and so on.An Introduction to Cryptography13

The Basics of CryptographyUsing this scheme, the plaintext, “SECRET” encrypts as “VHFUHW.” Toallow someone else to read the ciphertext, you tell them that the key is 3.Obviously, this is exceedingly weak cryptography by today’s standards, buthey, it worked for Caesar, and it also illustrates how conventionalcryptography works.Key management and conventional encryptionConventional encryption has benefits. It is very fast. It is especially useful forencrypting data that is not going anywhere. However, conventionalencryption alone as a means for transmitting secure data can be quiteexpensive simply due to the difficulty of secure key distribution.Recall a character from your favorite spy movie: the person with a lockedbriefcase handcuffed to his or her wrist. What is in the briefcase, anyway? It’sprobably not the missile launch code/biotoxin formula/invasion plan itself.It’s the key that will decrypt the secret data.For a sender and recipient to communicate securely using conventionalencryption, they must agree upon a key and keep it secret betweenthemselves. If they are in different physical locations, they must trust a courier,the Bat Phone, or some other secure communication medium to prevent thedisclosure of the secret key during transmission. Anyone who overhears orintercepts the key in transit can later read, modify, and forge all informationencrypted or authenticated with that key. From DES to Captain Midnight’sSecret Decoder Ring, the persistent problem with conventional encryption iskey distribution: how do you get the key to the recipient without someoneintercepting it?Public key cryptographyThe problems of key distribution are solved by public key cryptography, theconcept of which was introduced by Whitfield Diffie and Martin Hellman in1975. (There is now evidence that the British Secret Service invented it a fewyears before Diffie and Hellman, but kept it a military secret—and did nothingwith it.)1Public key cryptography is an asymmetric scheme that uses a pair of keys forencryption: a public key, which encrypts data, and a corresponding private, orsecret key for decryption. You publish your public key to the world whilekeeping your private key secret. Anyone with a copy of your public key can thenencrypt information that only you can read. Even people you have never met.1. J H Ellis, The Possibility of Secure Non-Secret Digital Encryption, CESG Report, January 1970.[CESG is the UK’s National Authority for the official use of cryptography.]14An Introduction to Cryptography

The Basics of CryptographyIt is computationally infeasible to deduce the private key from the public key.Anyone who has a public key can encrypt information but cannot decrypt it.Only the person who has the corresponding private key can decrypt theinformation.public keyprivate tFigure 1-3. Public key encryptionThe primary benefit of public key cryptography is that it allows people whohave no preexisting security arrangement to exchange messages securely. Theneed for sender and receiver to share secret keys via some secure channel iseliminated; all communications involve only public keys, and no private keyis ever transmitted or shared. Some examples of public-key cryptosystems areElgamal (named for its inventor, Taher Elgamal), RSA (named for itsinventors, Ron Rivest, Adi Shamir, and Leonard Adleman), Diffie-Hellman(named, you guessed it, for its inventors), and DSA, the Digital SignatureAlgorithm (invented by David Kravitz).Because conventional cryptography was once the only available means forrelaying secret information, the expense of secure channels and keydistribution relegated its use only to those who could afford it, such asgovernments and large banks (or small children with secret decoder rings).Public key encryption is the technological revolution that provides strongcryptography to the adult masses. Remember the courier with the lockedbriefcase handcuffed to his wrist? Public-key encryption puts him out ofbusiness (probably to his relief).An Introduction to Cryptography15

The Basics of CryptographyHow PGP worksPGP combines some of the best features of both conventional and public keycryptography. PGP is a hybrid cryptosystem.When a user encrypts plaintext with PGP, PGP first compresses the plaintext.Data compression saves modem transmission time and disk space and, moreimportantly, strengthens cryptographic security. Most cryptanalysistechniques exploit patterns found in the plaintext to crack the cipher.Compression reduces these patterns in the plaintext, thereby greatlyenhancing resistance to cryptanalysis. (Files that are too short to compress orwhich don’t compress well aren’t compressed.)PGP then creates a session key, which is a one-time-only secret key. This key isa random number generated from the random movements of your mouse andthe keystrokes you type. This session key works with a very secure, fastconventional encryption algorithm to encrypt the plaintext; the result isciphertext. Once the data is encrypted, the session key is then encrypted to therecipient’s public key. This public key-encrypted session key is transmittedalong with the ciphertext to the recipient.plaintext is encryptedwith session keysession key is encryptedwith public keyciphertext encrypted session keyFigure 1-4. How PGP encryption works16An Introduction to Cryptography

The Basics of CryptographyDecryption works in the reverse. The recipient’s copy of PGP uses his or herprivate key to recover the temporary session key, which PGP then uses todecrypt the conventionally-encrypted ciphertext.encrypted messageencryptedsession keyrecipient’s private key usedto decrypt session keyciphertextsession key usedto decrypt ciphertextoriginalplaintextFigure 1-5. How PGP decryption worksThe combination of the two encryption methods combines the convenience ofpublic key encryption with the speed of conventional encryption.Conventional encryption is about 1,000 times faster than public keyencryption. Public key encryption in turn provides a solution to keydistribution and data transmission issues. Used together, performance andkey distribution are improved without any sacrifice in security.KeysA key is a value that works with a cryptographic algorithm to produce aspecific ciphertext. Keys are basically really, really, really big numbers. Keysize is measured in bits; the number representing a 1024-bit key is darn huge.In public key cryptography, the

An Introduction to Cryptography v Preface . "Handbook of Applied Cryptography,"byAlfredJ.Menezes,PaulC.van Oorschot, and Scott Vanstone. CRC Press; ISBN: -8493-8523-7. This is the . technique of differential cryptanalysis as applied to DES. It is an excellent