home *** CD-ROM | disk | FTP | other *** search
/ PC World 1999 February / PCWorld_1999-02_cd.bin / software / servis / Pgp31 / pgp-intro.doc < prev    next >
Text File  |  1998-03-14  |  79KB  |  1,247 lines

  1.  
  2. PGP-INTRO(7)                     User Manual                     PGP-INTRO(7)
  3.  
  4. SECURITY FEATURES AND VULNERABILITIES, By Phil Zimmermann
  5.   "Whatever you do will be insignificant, but it is very important that you
  6.   do it." -Mahatma Gandhi.
  7.  
  8. Why I wrote PGP
  9.   It's personal. It's private. And it's no one's business but yours. You may
  10.   be planning a political campaign, discussing your taxes, or having a secret
  11.   romance. Or you may be communicating with a political dissident in a
  12.   repressive country. Whatever it is, you don't want your private electronic
  13.   mail (e-mail) or confidential documents read by anyone else. There's noth-
  14.   ing wrong with asserting your privacy. Privacy is as apple-pie as the Con-
  15.   stitution.
  16.  
  17.   The right to privacy is spread implicitly throughout the Bill of Rights.
  18.   But when the US Constitution was framed, the Founding Fathers saw no need
  19.   to explicitly spell out the right to a private conversation. That would
  20.   have been silly. Two hundred years ago, all conversations were private. If
  21.   someone else was within earshot, you could just go out behind the barn and
  22.   have your conversation there. No one could listen in without your
  23.   knowledge. The right to a private conversation was a natural right, not
  24.   just in a philosophical sense, but in a law-of-physics sense, given the
  25.   technology of the time. But with the coming of the information age, start-
  26.   ing with the invention of the telephone, all that has changed. Now most of
  27.   our conversations are conducted electronically. This allows our most inti-
  28.   mate conversations to be exposed without our knowledge. Cellular phone
  29.   calls may be monitored by anyone with a radio. Electronic mail, sent across
  30.   the Internet, is no more secure than cellular phone calls. E-mail is
  31.   rapidly replacing postal mail, becoming the norm for everyone, not the
  32.   novelty it was in the past. And e-mail can be routinely and automatically
  33.   scanned for interesting keywords, on a large scale, without detection. This
  34.   is like driftnet fishing.
  35.  
  36.   Perhaps you think your e-mail is legitimate enough that encryption is
  37.   unwarranted. If you really are a law-abiding citizen with nothing to hide,
  38.   then why don't you always send your paper mail on postcards? Why not submit
  39.   to drug testing on demand? Why require a warrant for police searches of
  40.   your house? Are you trying to hide something? If you hide your mail inside
  41.   envelopes, does that mean you must be a subversive or a drug dealer, or
  42.   maybe a paranoid nut? Do law-abiding citizens have any need to encrypt
  43.   their e-mail?
  44.  
  45.   What if everyone believed that law-abiding citizens should use postcards
  46.   for their mail? If a nonconformist tried to assert his privacy by using an
  47.   envelope for his mail, it would draw suspicion. Perhaps the authorities
  48.   would open his mail to see what he's hiding. Fortunately, we don't live in
  49.   that kind of world, because everyone protects most of their mail with
  50.   envelopes. So no one draws suspicion by asserting their privacy with an
  51.   envelope. There's safety in numbers. Analogously, it would be nice if
  52.   everyone routinely used encryption for all their e-mail, innocent or not,
  53.   so that no one drew suspicion by asserting their e-mail privacy with
  54.   encryption. Think of it as a form of solidarity. Until now, if the govern-
  55.   ment wanted to violate the privacy of ordinary citizens, they had to expend
  56.   a certain amount of expense and labor to intercept and steam open and read
  57.   paper mail. Or they had to listen to and possibly transcribe spoken tele-
  58.   phone conversation, at least before automatic voice recognition technology
  59.   became available. This kind of labor-intensive monitoring was not practical
  60.   on a large scale. This was only done in important cases when it seemed
  61.   worthwhile.
  62.  
  63.   Senate Bill 266, a 1991 omnibus anti-crime bill, had an unsettling measure
  64.   buried in it. If this non-binding resolution had become real law, it would
  65.   have forced manufacturers of secure communications equipment to insert spe-
  66.   cial "trap doors" in their products, so that the government can read
  67.   anyone's encrypted messages. It reads: "It is the sense of Congress that
  68.   providers of electronic communications services and manufacturers of elec-
  69.   tronic communications service equipment shall ensure that communications
  70.   systems permit the government to obtain the plain text contents of voice,
  71.   data, and other communications when appropriately authorized by law." It
  72.   was this bill that led me to publish PGP electronically for free that year,
  73.   shortly before the measure was defeated after rigorous protest from civil
  74.   libertarians and industry groups. The 1994 Digital Telephony bill mandated
  75.   that phone companies install remote wiretapping ports into their central
  76.   office digital switches, creating a new technology infrastructure for
  77.   "point-and-click" wiretapping, so that federal agents no longer have to go
  78.   out and attach alligator clips to phone lines. Now they'll be able to sit
  79.   in their headquarters in Washington and listen in on your phone calls. Of
  80.   course, the law still requires a court order for a wiretap. But while tech-
  81.   nology infrastructures can persist for generations, laws and policies can
  82.   change overnight. Once a communications infrastructure optimized for sur-
  83.   veillance becomes entrenched, a shift in political conditions may lead to
  84.   abuse of this new-found power. Political conditions may shift with the
  85.   election of a new government, or perhaps more abruptly from the bombing of
  86.   a Federal building.
  87.  
  88.   A year after the 1994 Digital Telephony bill passed, the FBI disclosed
  89.   plans to require the phone companies to build into their infrastructure the
  90.   capacity to simultaneously wiretap one percent of all phone calls in all
  91.   major US cities. This would represent more than a thousandfold increase
  92.   over previous levels in the number of phones that could be wiretapped. In
  93.   previous years, there were only about 1000 court-ordered wiretaps in the US
  94.   per year, at the federal, state, and local levels combined. It's hard to
  95.   see how the government could even employ enough judges to sign enough wire-
  96.   tap orders to wiretap 1% of all our phone calls, much less hire enough
  97.   federal agents to sit and listen to all that traffic in real time. The only
  98.   plausible way of processing that amount of traffic is a massive Orwellian
  99.   application of automated voice recognition technology to sift through it
  100.   all, searching for interesting keywords or searching for a particular
  101.   speaker's voice. If the government doesn't find the target in the first 1%
  102.   sample, the wiretaps can be shifted over to a different 1% until the target
  103.   is found, or until everyone's phone line has been checked for subversive
  104.   traffic. The FBI says they need this capacity to plan for the future. This
  105.   plan sparked such outrage that it was defeated in Congress, at least this
  106.   time around, in 1995. But the mere fact that the FBI even asked for these
  107.   broad powers is revealing of their agenda. And the defeat of this plan
  108.   isn't so reassuring when you consider that the 1994 Digital Telephony bill
  109.   was also defeated the first time it was introduced, in 1993.
  110.  
  111.   Advances in technology will not permit the maintenance of the status quo,
  112.   as far as privacy is concerned. The status quo is unstable. If we do noth-
  113.   ing, new technologies will give the government new automatic surveillance
  114.   capabilities that Stalin could never have dreamed of. The only way to hold
  115.   the line on privacy in the information age is strong cryptography.
  116.  
  117.   You don't have to distrust the government to want to use cryptography. Your
  118.   business can be wiretapped by business rivals, organized crime, or foreign
  119.   governments. The French government, for example, is notorious for using its
  120.   signals intelligence apparatus against US companies to help French corpora-
  121.   tions get a competitive edge. Ironically, US government restrictions on
  122.   cryptography have weakened US corporate defenses against foreign
  123.   intelligence and organized crime.
  124.  
  125.   The government knows what a pivotal role cryptography is destined to play
  126.   in the power relationship with its people. In April 1993, the Clinton
  127.   administration unveiled a bold new encryption policy initiative, which was
  128.   under development at National Security Agency (NSA) since the start of the
  129.   Bush administration. The centerpiece of this initiative is a government-
  130.   built encryption device, called the "Clipper" chip, containing a new clas-
  131.   sified NSA encryption algorithm. The government has been trying to
  132.   encourage private industry to design it into all their secure communication
  133.   products, like secure phones, secure FAX, etc. AT&T has put Clipper into
  134.   their secure voice products. The catch: At the time of manufacture, each
  135.   Clipper chip will be loaded with its own unique key, and the government
  136.   gets to keep a copy, placed in escrow. Not to worry, though-the government
  137.   promises that they will use these keys to read your traffic only "when duly
  138.   authorized by law." Of course, to make Clipper completely effective, the
  139.   next logical step would be to outlaw other forms of cryptography.
  140.  
  141.   The government initially claimed that using Clipper would be voluntary,
  142.   that no one would be forced to use it instead of other types of cryptogra-
  143.   phy. But the public reaction against the Clipper chip has been strong,
  144.   stronger than the government anticipated. The computer industry has monol-
  145.   ithically proclaimed its opposition to using Clipper. FBI director Louis
  146.   Freeh responded to a question in a press conference in 1994 by saying that
  147.   if Clipper failed to gain public support, and FBI wiretaps were shut out by
  148.   non-government-controlled cryptography, his office would have no choice but
  149.   to seek legislative relief. Later, in the aftermath of the Oklahoma City
  150.   tragedy, Mr. Freeh testified before the Senate Judiciary Committee that
  151.   public availability of strong cryptography must be curtailed by the govern-
  152.   ment (although no one had suggested that cryptography was used by the
  153.   bombers).
  154.  
  155.   The Electronic Privacy Information Center (EPIC) obtained some revealing
  156.   documents under the Freedom of Information Act. In a "briefing document"
  157.   titled "Encryption: The Threat, Applications and Potential Solutions," and
  158.   sent to the National Security Council in February 1993, the FBI, NSA and
  159.   Department of Justice (DOJ) concluded that:
  160.  
  161.   "Technical solutions, such as they are, will only work if they are incor-
  162.   porated into all encryption products. To ensure that this occurs, legisla-
  163.   tion mandating the use of Government-approved encryption products or adher-
  164.   ence to Government encryption criteria is required."
  165.  
  166.   The government has a track record that does not inspire confidence that
  167.   they will never abuse our civil liberties. The FBI's COINTELPRO program
  168.   targeted groups that opposed government policies. They spied on the anti-
  169.   war movement and the civil rights movement. They wiretapped the phone of
  170.   Martin Luther King Jr. Nixon had his enemies list. And then there was the
  171.   Watergate mess. Congress now seems intent on passing laws curtailing our
  172.   civil liberties on the Internet. At no time in the past century has public
  173.   distrust of the government been so broadly distributed across the political
  174.   spectrum, as it is today. If we want to resist this unsettling trend in the
  175.   government to outlaw cryptography, one measure we can apply is to use cryp-
  176.   tography as much as we can now while it is still legal. When use of strong
  177.   cryptography becomes popular, it's harder for the government to criminalize
  178.   it. Thus, using PGP is good for preserving democracy.
  179.  
  180.   If privacy is outlawed, only outlaws will have privacy. Intelligence agen-
  181.   cies have access to good cryptographic technology. So do the big arms and
  182.   drug traffickers. But ordinary people and grassroots political organiza-
  183.   tions mostly have not had access to affordable "military grade" public-key
  184.   cryptographic technology. Until now.
  185.  
  186.   PGP empowers people to take their privacy into their own hands. There's a
  187.   growing social need for it. That's why I created it.
  188.  
  189. Encryption Basics
  190.   First, some elementary terminology. Suppose you want to send a message to a
  191.   colleague, whom we'll call Alice, and you don't want anyone but Alice to be
  192.   able to read it. You can encrypt, or encipher the message, which means
  193.   scrambling it up in a hopelessly complicated way, rendering it unreadable
  194.   to anyone except you and Alice. You supply a cryptographic key to encrypt
  195.   the message, and Alice must use the same key to decipher or decrypt it. At
  196.   least that's how it works in conventional "secret-key" encryption.
  197.  
  198.   A single key is used for both encryption and decryption. This means that
  199.   this key must be initially transmitted via secure channels so that both
  200.   parties can know it before encrypted messages can be sent over insecure
  201.   channels. This may be inconvenient. If you have a secure channel for
  202.   exchanging keys, then why do you need cryptography in the first place?
  203.  
  204. How Public Key Cryptography Works
  205.   In public key cryptography, everyone has two related complementary keys, a
  206.   public key and a private key. Each key unlocks the code that the other key
  207.   makes. Knowing the public key does not help you deduce the corresponding
  208.   private key. The public key can be published and widely disseminated across
  209.   a communications network.
  210.  
  211.   This protocol provides privacy without the need for the same kind of secure
  212.   channels that conventional secret key encryption requires. Anyone can use a
  213.   recipient's public key to encrypt a message to that person, and that reci-
  214.   pient uses her own corresponding private key to decrypt that message. No
  215.   one but the recipient can decrypt it, because no one else has access to
  216.   that private key. Not even the person who encrypted the message with the
  217.   recipient's public key can decrypt it.
  218.  
  219. How Your Files and Messages are Encrypted
  220.   Because the public key encryption algorithm is much slower than conven-
  221.   tional single-key encryption, encryption is better accomplished by using
  222.   the process described below.
  223.  
  224.   A high-quality fast conventional secret-key encryption algorithm is used to
  225.   encipher the message. This original unenciphered message is called "plain-
  226.   text." In a process invisible to the user, a temporary random key, created
  227.   just for this one "session," is used to conventionally encipher the plain-
  228.   text file. Then the recipient's public key is used to encipher this tem-
  229.   porary random conventional key. This public-key-enciphered conventional
  230.   "session" key is sent along with the enciphered text (called "ciphertext")
  231.   to the recipient.
  232.  
  233. The PGP Symmetric Algorithms
  234.   PGP offers a selection of different secret-key algorithms to encrypt the
  235.   actual message. By secret key algorithm, we mean a conventional, or sym-
  236.   metric, block cipher that uses the same key to both encrypt and decrypt.
  237.   The three symmetric block ciphers offered by PGP are CAST, Triple-DES, and
  238.   IDEA. They are not "home-grown" algorithms. They were all developed by
  239.   teams of cryptographers with distinguished reputations.
  240.  
  241.   For the cryptographically curious, all three ciphers operate on 64-bit
  242.   blocks of plaintext and ciphertext. CAST and IDEA have key sizes of 128
  243.   bits, while triple-DES uses a 168-bit key.   Like Data Encryption Standard
  244.   (DES), any of these ciphers can be used in cipher feedback (CFB) and cipher
  245.   block chaining (CBC) modes. PGP uses them in 64-bit CFB mode. I included
  246.   the CAST encryption algorithm in PGP because it shows promise as a good
  247.   block cipher with a 128-bit key size, it's very fast, and it's free. Its
  248.   name is derived from the initials of its designers, Carlisle Adams and
  249.   Stafford Tavares of Northern Telecom (Nortel). Nortel has applied for a
  250.   patent for CAST, but they have made a commitment in writing to make CAST
  251.   available to anyone on a royalty-free basis. CAST appears to exceptionally
  252.   well-designed, by people with good reputations in the field. The design is
  253.   based on a very formal approach, with a number of formally provable asser-
  254.   tions that give good reasons to believe that it probably requires key
  255.   exhaustion to break its 128-bit key. CAST has no weak or semiweak keys.
  256.   There are strong arguments that CAST is completely immune to both linear
  257.   and differential cryptanalysis, the two most powerful forms of cryp-
  258.   tanalysis in the published literature, both of which have been effective in
  259.   cracking DES. While CAST is too new to have developed a long track record,
  260.   its formal design and the good reputations of its designers will undoubt-
  261.   edly attract the attentions and attempted cryptanalytic attacks of the rest
  262.   of the academic cryptographic community. I'm getting nearly the same prel-
  263.   iminary gut feeling of confidence from CAST that I got years ago from IDEA,
  264.   the cipher I selected for use in earlier versions of PGP. At that time,
  265.   IDEA was also too new to have a track record, but it has held up well.
  266.  
  267.   The IDEA (International Data Encryption Algorithm) block cipher is based on
  268.   the design concept of "mixing operations from different algebraic groups."
  269.   It was developed at ETH in Zurich by James L. Massey and Xuejia Lai, and
  270.   published in 1990. Early published papers on the algorithm called it IPES
  271.   (Improved Proposed Encryption Standard), but they later changed the name to
  272.   IDEA. So far, IDEA has resisted attack much better than other ciphers such
  273.   as FEAL, REDOC-II, LOKI, Snefru and Khafre. And IDEA is more resistant than
  274.   DES to Biham and Shamir's highly successful differential cryptanalysis
  275.   attack, as well as attacks from linear cryptanalysis. As this cipher con-
  276.   tinues to attract attack efforts from the most formidable quarters of the
  277.   cryptanalytic world, confidence in IDEA is growing with the passage of
  278.   time. Sadly, the biggest obstacle to IDEA's acceptance as a standard has
  279.   been the fact that Ascom Systec holds a patent on its design, and unlike
  280.   DES and CAST, IDEA has not been made available to everyone on a royalty-
  281.   free basis.
  282.  
  283.   As a hedge, PGP includes three-key triple-DES in its repertoire of avail-
  284.   able block ciphers. The DES was developed by IBM in the mid-1970s. While it
  285.   has a good design, its 56-bit key size is too small by today's standards.
  286.   Triple-DES is very strong, and has been well-studied for many years, so it
  287.   might be a safer bet than the newer ciphers such as CAST and IDEA. Triple-
  288.   DES is the DES applied three times to the same block of data, using three
  289.   different keys, except that the second DES operation is run backwards, in
  290.   decrypt mode. Although triple-DES is much slower than either CAST or IDEA,
  291.   speed is usually not critical for e-mail applications. While triple-DES
  292.   uses a key size of 168 bits, it appears to have an effective key strength
  293.   of at least 112 bits against an attacker with impossibly immense data
  294.   storage capacity to use in the attack. According to a paper presented by
  295.   Michael Weiner at Crypto96, any remotely plausible amount of data storage
  296.   available to the attacker would enable an attack that would require about
  297.   as much work as breaking a 129-bit key. Triple-DES is not encumbered by any
  298.   patents.
  299.  
  300.   PGP public keys that were generated by PGP Version 5.0 or later have infor-
  301.   mation embedded in them that tells a sender what block ciphers are under-
  302.   stood by the recipient's software, so that the sender's software knows
  303.   which ciphers can be used to encrypt. DSS/Diffie-Hellman public keys will
  304.   accept CAST, IDEA, or triple-DES as the block cipher, with CAST as the
  305.   default selection. At present, for compatibility reasons, RSA keys do not
  306.   provide this feature. Only the IDEA cipher is used by PGP to send messages
  307.   to RSA keys, because older versions of PGP only supported RSA and IDEA.
  308.  
  309. Data Compression
  310.   PGP normally compresses the plaintext before encrypting it, because it's
  311.   too late to compress the plaintext after it has been encrypted; encrypted
  312.   data is incompressible. Data compression saves modem transmission time and
  313.   disk space and, more importantly, strengthens cryptographic security. Most
  314.   cryptanalysis techniques exploit redundancies found in the plaintext to
  315.   crack the cipher. Data compression reduces this redundancy in the
  316.   plaintext, thereby greatly enhancing resistance to cryptanalysis. It takes
  317.   extra time to compress the plaintext, but from a security point of view
  318.   it's worth it.
  319.  
  320.   Files that are too short to compress, or that just don't compress well, are
  321.   not compressed by PGP. In addition, the program recognizes files produced
  322.   by most popular compression programs, such as PKZIP, and does not try to
  323.   compress a file that has already been compressed.
  324.  
  325.   For the technically curious, the program uses the freeware ZIP compression
  326.   routines written by Jean-Loup Gailly, Mark Adler, and Richard B. Wales.
  327.   This ZIP software uses compression algorithms that are functionally
  328.   equivalent to those used by PKWare's PKZIP 2.x. This ZIP compression
  329.   software was selected for PGP mainly because it has a really good compres-
  330.   sion ratio and because it's fast.
  331.  
  332. About the Random Numbers used as Session Keys
  333.   PGP uses a cryptographically strong pseudo-random number generator for
  334.   creating temporary session keys.  If this random seed file does not exist,
  335.   it is automatically created and seeded with truly random numbers derived
  336.   from your random events gathered by the PGP program from the timing of your
  337.   keystroke and mouse movements.
  338.  
  339.   This generator reseeds the seed file each time it is used, by mixing in new
  340.   material partially derived from the time of day and other truly random
  341.   sources. It uses the conventional encryption algorithm as an engine for the
  342.   random number generator. The seed file contains both random seed material
  343.   and random key material used to key the conventional encryption engine for
  344.   the random generator.
  345.  
  346.   This random seed file should be protected from disclosure, to reduce the
  347.   risk of an attacker deriving your next or previous session keys. The
  348.   attacker would have a very hard time getting anything useful from capturing
  349.   this random seed file, because the file is cryptographically laundered
  350.   before and after each use. Nonetheless, it seems prudent to try to keep it
  351.   from falling into the wrong hands. If possible, make the file readable only
  352.   by you. If this is not possible, do not let other people indiscriminately
  353.   copy disks from your computer.
  354.  
  355. How Decryption Works
  356.   The decryption process is just the reverse of encryption. The recipient's
  357.   private key is used to recover the temporary session key, and then that
  358.   session key is used to run the fast conventional secret-key algorithm to
  359.   decipher the large ciphertext message.
  360.  
  361. How Digital Signatures Work
  362.   PGP uses digital signatures to provide message authentication. The sender's
  363.   own private key can be used to encrypt a message digest, thereby "signing"
  364.   the message. A message digest is a 160-bit or a 128-bit cryptographically
  365.   strong one-way hash function. It is somewhat analogous to a "checksum" or
  366.   CRC error checking code, in that it compactly represents the message and is
  367.   used to detect changes in the message. Unlike a CRC, however, it is
  368.   believed to be computationally infeasible for an attacker to devise a sub-
  369.   stitute message that would produce an identical message digest. The message
  370.   digest gets encrypted by the sender's private key, creating a digital sig-
  371.   nature of the message.
  372.  
  373.   The recipient (or anyone else) can verify the digital signature by using
  374.   the sender's public key to decrypt it. This proves that the sender was the
  375.   true originator of the message, and that the message has not been subse-
  376.   quently altered by anyone else, because the sender alone possesses the
  377.   private key that made that signature. Forgery of a signed message is not
  378.   feasible, and the sender cannot later disavow his signature.
  379.  
  380. About the Message Digest
  381.   The message digest is a compact (160-bit, or 128-bit) "distillate" of your
  382.   message or file checksum. You can also think of it as a "fingerprint" of
  383.   the message or file. The message digest "represents" your message, such
  384.   that if the message were altered in any way, a different message digest
  385.   would be computed from it. This makes it possible to detect any changes
  386.   made to the message by a forger. A message digest is computed using a cryp-
  387.   tographically strong one-way hash function of the message. It should be
  388.   computationally infeasible for an attacker to devise a substitute message
  389.   that would produce an identical message digest. In that respect, a message
  390.   digest is much better than a checksum, because it is easy to devise a dif-
  391.   ferent message that would produce the same checksum. But like a checksum,
  392.   you can't derive the original message from its message digest.
  393.  
  394.   The message digest algorithm now used in PGP (Version 5.0 and later) is
  395.   called SHA, which stands for Secure Hash Algorithm, designed by the NSA for
  396.   National Institute of Standards and Technology (NIST). SHA is a 160-bit
  397.   hash algorithm. Some people might regard anything from the NSA with suspi-
  398.   cion, because the NSA is in charge of intercepting communications and
  399.   breaking codes. But keep in mind that the NSA has no interest in forging
  400.   signatures, and the government would benefit from a good unforgeable digi-
  401.   tal signature standard that would preclude anyone from repudiating their
  402.   signatures. That has distinct benefits for law enforcement and intelligence
  403.   gathering. Also, SHA has been published in the open literature and has been
  404.   extensively peer reviewed by most of the best cryptographers in the world
  405.   who specialize in hash functions, and the unanimous opinion is that SHA is
  406.   extremely well designed. It has some design innovations that overcome all
  407.   the observed weaknesses in message digest algorithms previously published
  408.   by academic cryptographers. All new versions of PGP use SHA as the message
  409.   digest algorithm for creating signatures with the new DSS keys that comply
  410.   with the NIST Digital Signature Standard. For compatibility reasons, new
  411.   versions of PGP still use MD5 for RSA signatures, because older versions of
  412.   PGP used MD5 for RSA signatures.
  413.  
  414.   The message digest algorithm used by older versions of PGP is the MD5 Mes-
  415.   sage Digest Algorithm, placed in the public domain by RSA Data Security,
  416.   Inc. MD5 is a 128-bit hash algorithm. In 1996, MD5 was all but broken by
  417.   Hans Dobbertin, a German cryptographer. While MD5 was not completely broken
  418.   at that time, it was discovered to have such serious weaknesses that no one
  419.   should keep using it to generate signatures. Further work in this area
  420.   might completely break it, thus allowing signatures to be forged. If you
  421.   don't want to someday find your PGP digital signature on a forged confes-
  422.   sion, you might be well advised to migrate to the new PGP DSS keys as your
  423.   preferred method for making digital signatures, because DSS uses SHA as its
  424.   secure hash algorithm.
  425.  
  426. How to Protect Public Keys from Tampering
  427.   In a public key cryptosystem, you don't have to protect public keys from
  428.   exposure. In fact, it's better if they are widely disseminated. But it's
  429.   important to protect public keys from tampering, to make sure that a public
  430.   key really belongs to whom it appears to belong to. This may be the most
  431.   important vulnerability of a public key cryptosystem. See "Protecting Your
  432.   Keys" in Chapter 3 [of the Windows documentation] for procedures. Let's
  433.   first look at a potential disaster, then describe how to safely avoid it
  434.   with PGP. Suppose you want to send a private message to Alice. You download
  435.   Alice's public key certificate from an electronic bulletin board system
  436.   (BBS). You encrypt your letter to Alice with this public key and send it to
  437.   her through the BBS's e-mail facility.
  438.  
  439.   Unfortunately, unbeknownst to you or Alice, another user named Charlie has
  440.   infiltrated the BBS and generated a public key of his own with Alice's user
  441.   ID attached to it. He covertly substitutes his bogus key in place of
  442.   Alice's real public key. You unwittingly use this bogus key belonging to
  443.   Charlie instead of Alice's public key. All looks normal because this bogus
  444.   key has Alice's user ID. Now Charlie can decipher the message intended for
  445.   Alice because he has the matching private key. He may even re-encrypt the
  446.   deciphered message with Alice's real public key and send it on to her so
  447.   that no one suspects any wrongdoing. Furthermore, he can even make
  448.   apparently good signatures from Alice with this private key because every-
  449.   one will use the bogus public key to check Alice's signatures.
  450.  
  451.   The only way to prevent this disaster is to prevent anyone from tampering
  452.   with public keys. If you got Alice's public key directly from Alice, this
  453.   is no problem. But that may be difficult if Alice is a thousand miles away,
  454.   or is currently unreachable.
  455.  
  456.   Perhaps you could get Alice's public key from a mutually trusted friend
  457.   David, who knows he has a good copy of Alice's public key. David could sign
  458.   Alice's public key, vouching for the integrity of Alice's public key. David
  459.   would create this signature with his own private key.
  460.  
  461.   This would create a signed public key certificate, and would show that
  462.   Alice's key had not been tampered with. This requires that you have a known
  463.   good copy of David's public key to check his signature. Perhaps David could
  464.   provide Alice with a signed copy of your public key also. David is thus
  465.   serving as an "Introducer" between you and Alice.
  466.  
  467.   This signed public key certificate for Alice could be uploaded by David or
  468.   Alice to the BBS, and you could download it later. You could then check the
  469.   signature via David's public key and thus be assured that this is really
  470.   Alice's public key. No impostor can fool you into accepting his own bogus
  471.   key as Alice's because no one else can forge signatures made by David.
  472.  
  473.   A widely trusted person could even specialize in providing this service of
  474.   "introducing" users to each other by providing signatures for their public
  475.   key certificates. This trusted person could be regarded as a "Certifying
  476.   Authority." Any public key certificates bearing the Certifying Authority's
  477.   signature could be trusted as truly belonging to whom they appear to belong
  478.   to. All users who wanted to participate would need a known good copy of
  479.   just the Certifying Authority's public key, so that the Certifying
  480.   Authority's signatures could be verified. In some cases, the Certifying
  481.   Authority may also act as a key server, allowing users on a network to look
  482.   up public keys by asking the key server, but there is no reason why a key
  483.   server must also certify keys.
  484.  
  485.   A trusted centralized Certifying Authority is especially appropriate for
  486.   large impersonal centrally controlled corporate or government institutions.
  487.   Some institutional environments use hierarchies of Certifying Authorities.
  488.   For more decentralized environments, allowing all users to act as trusted
  489.   introducers for their friends would probably work better than a centralized
  490.   key certification authority.
  491.  
  492.   One of the attractive features of PGP is that it can operate equally well
  493.   in a centralized environment with a Certifying Authority or a more decen-
  494.   tralized environment where individuals exchange personal keys.   This whole
  495.   business of protecting public keys from tampering is the single most diffi-
  496.   cult problem in practical public key applications. It is the "Achilles
  497.   heel" of public key cryptography, and a lot of software complexity is tied
  498.   up in solving this one problem. You should use a public key only after you
  499.   are sure that it is a good public key that has not been tampered with, and
  500.   that it actually belongs to the person with whom it purports to be associ-
  501.   ated.  You can be sure of this if you got this public key certificate
  502.   directly from its owner, or if it bears the signature of someone else that
  503.   you trust, from whom you already have a good public key. Also, the user ID
  504.   should have the full name of the key's owner, not just her first name. No
  505.   matter how tempted you are, you should never give in to expediency and
  506.   trust a public key you downloaded from a bulletin board, unless it is
  507.   signed by someone you trust. That uncertified public key could have been
  508.   tampered with by anyone, maybe even by the system administrator of the bul-
  509.   letin board.
  510.  
  511.   If you are asked to sign someone else's public key certificate, make cer-
  512.   tain that it really belongs to that person named in the user ID of that
  513.   public key certificate. This is because your signature on her public key
  514.   certificate is a promise by you that this public key really belongs to her.
  515.   Other people who trust you will accept her public key because it bears your
  516.   signature. It may be ill-advised to rely on hearsay-don't sign her public
  517.   key unless you have independent first hand knowledge that it really belongs
  518.   to her. Preferably, you should sign it only if you got it directly from
  519.   her.
  520.  
  521.   In order to sign a public key, you must be far more certain of that key's
  522.   ownership than if you merely want to use that key to encrypt a message. To
  523.   be convinced of a key's validity enough to use it, certifying signatures
  524.   from trusted introducers should suffice. But to sign a key yourself, you
  525.   should require your own independent firsthand knowledge of who owns that
  526.   key. Perhaps you could call the key's owner on the phone and read the key
  527.   fingerprint to her, to confirm that the key you have is really her key-and
  528.   make sure you really are talking to the right person.
  529.  
  530.   Bear in mind that your signature on a public key certificate does not vouch
  531.   for the integrity of that person, but only vouches for the integrity (the
  532.   ownership) of that person's public key. You aren't risking your credibility
  533.   by signing the public key of a sociopath, if you are completely confident
  534.   that the key really belongs to him. Other people would accept that key as
  535.   belonging to him because you signed it (assuming they trust you), but they
  536.   wouldn't trust that key's owner. Trusting a key is not the same as trusting
  537.   the key's owner.
  538.  
  539.   It would be a good idea to keep your own public key on hand with a collec-
  540.   tion of certifying signatures attached from a variety of "introducers," in
  541.   the hopes that most people will trust at least one of the introducers who
  542.   vouch for the validity of your public key. You could post your key with its
  543.   attached collection of certifying signatures on various electronic bulletin
  544.   boards. If you sign someone else's public key, return it to them with your
  545.   signature so that they can add it to their own collection of credentials
  546.   for their own public key.
  547.  
  548.   PGP keeps track of which keys on your public keyring are properly certified
  549.   with signatures from introducers that you trust. All you have to do is tell
  550.   PGP which people you trust as introducers, and certify their keys yourself
  551.   with your own ultimately trusted key. PGP can take it from there, automati-
  552.   cally validating any other keys that have been signed by your designated
  553.   introducers. And of course you can directly sign more keys yourself.
  554.  
  555.   Make sure that no one else can tamper with your own public keyring. Check-
  556.   ing a newly signed public key certificate must ultimately depend on the
  557.   integrity of the trusted public keys that are already on your own public
  558.   keyring. Maintain physical control of your public keyring, preferably on
  559.   your own personal computer rather than on a remote timesharing system, just
  560.   as you would do for your private key. This is to protect it from tampering,
  561.   not from disclosure. Keep a trusted backup copy of your public keyring and
  562.   your private key on write-protected media.
  563.  
  564.   Since your own trusted public key is used as a final authority to directly
  565.   or indirectly certify all the other keys on your keyring, it is the most
  566.   important key to protect from tampering. You may wish to keep a backup copy
  567.   on a write-protected floppy disk.
  568.  
  569.   PGP generally assumes that you will maintain physical security over your
  570.   system and your keyrings, as well as your copy of PGP itself. If an
  571.   intruder can tamper with your disk, then in theory he can tamper with the
  572.   program itself, rendering moot the safeguards the program may have to
  573.   detect tampering with keys.
  574.  
  575.   One somewhat complicated way to protect your own whole public keyring from
  576.   tampering is to sign the whole ring with your own private key.  You could
  577.   do this by making a detached signature certificate of the public keyring.
  578.  
  579. How Does PGP Keep Track of Which Keys are Valid?
  580.   Before you read this section, you should read the previous section on "How
  581.   to Protect Public Keys from Tampering."
  582.  
  583.   PGP keeps track of which keys on your public keyring are properly certified
  584.   with signatures from introducers that you trust. All you have to do is tell
  585.   PGP which people you trust as introducers, and certify their keys yourself
  586.   with your own ultimately trusted key. PGP can take it from there, automati-
  587.   cally validating any other keys that have been signed by your designated
  588.   introducers. And of course you may directly sign more keys yourself.
  589.  
  590.   There are two entirely separate criteria PGP uses to judge a public key's
  591.   usefulness - don't get them confused:
  592.   1.      Does the key actually belong to whom it appears to belong? In other
  593.   words, has it been certified with a trusted signature?
  594.   2.      Does it belong to someone you can trust to certify other keys?  PGP
  595.   can calculate the answer to the first question. To answer the second ques-
  596.   tion, you must tell PGP explicitly. When you supply the answer to question
  597.   2, PGP can then calculate the answer to question 1 for other keys signed by
  598.   the introducer you designated as trusted.
  599.  
  600.   Keys that have been certified by a trusted introducer are deemed valid by
  601.   PGP. The keys belonging to trusted introducers must themselves be certified
  602.   either by you or by other trusted introducers.  PGP also allows for the
  603.   possibility of you having several shades of trust for people to act as
  604.   introducers. Your trust for a key's owner to act as an introducer does not
  605.   just reflect your estimation of their personal integrity-it should also
  606.   reflect how competent you think they are at understanding key management
  607.   and using good judgment in signing keys.  You can designate a person as
  608.   untrusted, marginally trusted, or completely trusted to certify other pub-
  609.   lic keys. This trust information is stored on your keyring with their key,
  610.   but when you tell PGP to copy a key off your keyring, PGP will not copy the
  611.   trust information along with the key, because your private opinions on
  612.   trust are regarded as confidential. When PGP is calculating the validity of
  613.   a public key, it examines the trust level of all the attached certifying
  614.   signatures. It computes a weighted score of validity e.g.  two marginally
  615.   trusted signatures are deemed as credible as one fully trusted signature.
  616.   The program's skepticism is adjustable-for example, you may tune PGP to
  617.   require two fully trusted signatures or three marginally trusted signatures
  618.   to judge a key as valid.
  619.  
  620.   Your own key is "axiomatically" valid to PGP, needing no introducers signa-
  621.   ture to prove its validity. PGP knows which public keys are yours, by look-
  622.   ing for the corresponding private keys on the private key. PGP also assumes
  623.   you ultimately trust yourself to certify other keys.
  624.  
  625.   As time goes on, you will accumulate keys from other people whom you may
  626.   want to designate as trusted introducers. Everyone else will choose their
  627.   own trusted introducers. And everyone will gradually accumulate and distri-
  628.   bute with their key a collection of certifying signatures from other peo-
  629.   ple, with the expectation that anyone receiving it will trust at least one
  630.   or two of the signatures. This will cause the emergence of a decentralized
  631.   fault tolerant web of confidence for all public keys.
  632.  
  633.   This unique grass-roots approach contrasts sharply with standard public key
  634.   management schemes developed by government or other monolithic institu-
  635.   tions, such as Internet Privacy Enhanced Mail (PEM), which are based on
  636.   centralized control and mandatory centralized trust. The standard schemes
  637.   rely on a hierarchy of Certifying Authorities who dictate who you must
  638.   trust. The program's decentralized probabilistic method for determining
  639.   public key legitimacy is the centerpiece of its key management architec-
  640.   ture. PGP lets you alone choose who you trust, putting you at the top of
  641.   your own private certification pyramid. PGP is for people who prefer to
  642.   pack their own parachutes.
  643.  
  644.   Note that while this decentralized, grass-roots approach is emphasized
  645.   here, it does not mean that PGP does not perform equally as well in the
  646.   more hierarchical, centralized public key management schemes. Large cor-
  647.   porate users, for example, will probably want a central figure or person
  648.   who signs all the employees' keys. PGP handles that centralized scenario as
  649.   a special degenerate case of PGP's more generalized trust model.
  650.  
  651. How to Protect Private Keys from Disclosure
  652.   Protect your own private key and your passphrase very carefully. If your
  653.   private key is ever compromised, you'd better get the word out quickly to
  654.   all interested parties before someone else uses it to make signatures in
  655.   your name. For example, they could use it to sign bogus public key certifi-
  656.   cates, which could create problems for many people, especially if your sig-
  657.   nature is widely trusted. And of course, a compromise of your own private
  658.   key could expose all messages sent to you.
  659.  
  660.   To protect your private key, you can start by always keeping physical con-
  661.   trol of your private key. Keeping it on your personal computer at home is
  662.   OK, or keep it in your notebook computer that you can carry with you. If
  663.   you must use an office computer that you don't always have physical control
  664.   of, then keep your public and private keyrings on a write-protected remov-
  665.   able floppy disk, and don't leave it behind when you leave the office. It
  666.   wouldn't be a good idea to allow your private key to reside on a remote
  667.   timesharing computer, such as a remote dial-in UNIX system. Someone could
  668.   eavesdrop on your modem line and capture your passphrase and then obtain
  669.   your actual private key from the remote system. You should only use your
  670.   private key on a machine that is under your physical control. See Chapter 5
  671.   [of the Windows documentation] for additional information.
  672.  
  673.   Don't store your passphrase anywhere on the computer that has your private
  674.   key file. Storing both the private key and the passphrase on the same com-
  675.   puter is as dangerous as keeping your PIN in the same wallet as your
  676.   Automatic Teller Machine bank card. You don't want somebody to get their
  677.   hands on your disk containing both the passphrase and the private key file.
  678.   It would be most secure if you just memorize your passphrase and don't
  679.   store it anywhere but your brain. If you feel you must write down your
  680.   passphrase, keep it well protected, perhaps even more well protected than
  681.   the private key file.
  682.  
  683.   And keep backup copies of your private key-remember, you have the only copy
  684.   of your private key, and losing it will render useless all the copies of
  685.   your public key that you have spread throughout the world.
  686.  
  687.   The decentralized non-institutional approach PGP supports for management of
  688.   public keys has its benefits, but unfortunately this also means we can't
  689.   rely on a single centralized list of which keys have been compromised. This
  690.   makes it a bit harder to contain the damage of a private key compromise.
  691.   You just have to spread the word and hope everyone hears about it.
  692.  
  693.   If the worst case happens - your private key and passphrase are both
  694.   compromised (hopefully you will find this out somehow) - you will have to
  695.   issue a "key compromise" certificate. This kind of certificate is used to
  696.   warn other people to stop using your public key. You can use PGP to create
  697.   such a certificate by using the Revoke command from the PGPkeys menu. Then
  698.   you must somehow send this compromise certificate to everyone else on the
  699.   planet, or at least to all your friends and their friends, et cetera. Their
  700.   own PGP software will install this key compromise certificate on their
  701.   public keyrings and will automatically prevent them from accidentally using
  702.   your public key ever again. You can then generate a new private/public key
  703.   pair and publish the new public key. You could send out one package con-
  704.   taining both your new public key and the key compromise certificate for
  705.   your old key.
  706.  
  707. What If You Lose Your Private Key?
  708.   Normally, if you want to revoke your own private key, you can use the
  709.   Revoke command from the PGPkeys menu to issue a revocation certificate,
  710.   signed with your own private key.
  711.  
  712.   But what can you do if you lose your private key, or if your private key is
  713.   destroyed? You can't revoke it yourself, because you must use your own
  714.   private key to revoke it, and you don't have it anymore. You ask each per-
  715.   son you signed your key to retire his/her certification. Then anyone
  716.   attempting to use your key based upon the trust of one of your introducers
  717.   will know not to trust your public key.
  718.  
  719. Beware of Snake Oil
  720.   When examining a cryptographic software package, the question always
  721.   remains, why should you trust this product? Even if you examined the source
  722.   code yourself, not everyone has the cryptographic experience to judge the
  723.   security. Even if you are an experienced cryptographer, subtle weaknesses
  724.   in the algorithms could still elude you.
  725.  
  726.   When I was in college in the early seventies, I devised what I believed was
  727.   a brilliant encryption scheme. A simple pseudorandom number stream was
  728.   added to the plaintext stream to create ciphertext. This would seemingly
  729.   thwart any frequency analysis of the ciphertext, and would be uncrackable
  730.   even to the most resourceful government intelligence agencies. I felt so
  731.   smug about my achievement.
  732.  
  733.   Years later, I discovered this same scheme in several introductory cryptog-
  734.   raphy texts and tutorial papers. How nice. Other cryptographers had thought
  735.   of the same scheme. Unfortunately, the scheme was presented as a simple
  736.   homework assignment on how to use elementary cryptanalytic techniques to
  737.   trivially crack it. So much for my brilliant scheme.
  738.  
  739.   From this humbling experience I learned how easy it is to fall into a false
  740.   sense of security when devising an encryption algorithm. Most people don't
  741.   realize how fiendishly difficult it is to devise an encryption algorithm
  742.   that can withstand a prolonged and determined attack by a resourceful
  743.   opponent. Many mainstream software engineers have developed equally naive
  744.   encryption schemes (often even the very same encryption scheme), and some
  745.   of them have been incorporated into commercial encryption software packages
  746.   and sold for good money to thousands of unsuspecting users.
  747.  
  748.   This is like selling automotive seat belts that look good and feel good,
  749.   but snap open in even the slowest crash test. Depending on them may be
  750.   worse than not wearing seat belts at all. No one suspects they are bad
  751.   until a real crash. Depending on weak cryptographic software may cause you
  752.   to unknowingly place sensitive information at risk. You might not otherwise
  753.   have done so if you had no cryptographic software at all. Perhaps you may
  754.   never even discover your data has been compromised.
  755.  
  756.   Sometimes commercial packages use the Federal Data Encryption Standard
  757.   (DES), a fairly good conventional algorithm recommended by the government
  758.   for commercial use (but not for classified information, oddly enough-Hmmm).
  759.   There are several "modes of operation" DES can use, some of them better
  760.   than others. The government specifically recommends not using the weakest
  761.   simplest mode for messages, the Electronic Codebook (ECB) mode. But they do
  762.   recommend the stronger and more complex Cipher Feedback (CFB) or Cipher
  763.   Block Chaining (CBC) modes.
  764.  
  765.   Unfortunately, most of the commercial encryption packages I've looked at
  766.   use ECB mode. When I've talked to the authors of a number of these imple-
  767.   mentations, they say they've never heard of CBC or CFB modes, and didn't
  768.   know anything about the weaknesses of ECB mode. The very fact that they
  769.   haven't even learned enough cryptography to know these elementary concepts
  770.   is not reassuring. And they sometimes manage their DES keys in
  771.   inappropriate or insecure ways. Also, these same software packages often
  772.   include a second faster encryption algorithm that can be used instead of
  773.   the slower DES. The author of the package often thinks his proprietary fas-
  774.   ter algorithm is as secure as DES, but after questioning him I usually dis-
  775.   cover that it's just a variation of my own brilliant scheme from college
  776.   days. Or maybe he won't even reveal how his proprietary encryption scheme
  777.   works, but assures me it's a brilliant scheme and I should trust it. I'm
  778.   sure he believes that his algorithm is brilliant, but how can I know that
  779.   without seeing it?
  780.  
  781.   In all fairness I must point out that in most cases these terribly weak
  782.   products do not come from companies that specialize in cryptographic tech-
  783.   nology.
  784.  
  785.   Even the really good software packages, that use DES in the correct modes
  786.   of operation, still have problems. Standard DES uses a 56-bit key, which is
  787.   too small by today's standards, and may now be easily broken by exhaustive
  788.   key searches on special high-speed machines. The DES has reached the end of
  789.   its useful life, and so has any software package that relies on it.
  790.  
  791.   There is a company called AccessData (87 East 600 South, Orem, Utah 84058,
  792.   phone 1-800-658-5199) that sells a package for $185 that cracks the built-
  793.   in encryption schemes used by WordPerfect, Lotus 1-2-3, MS Excel, Symphony,
  794.   Quattro Pro, Paradox, MS Word, and PKZIP. It doesn't simply guess
  795.   passwords-it does real cryptanalysis. Some people buy it when they forget
  796.   their password for their own files. Law enforcement agencies buy it too, so
  797.   they can read files they seize. I talked to Eric Thompson, the author, and
  798.   he said his program only takes a split second to crack them, but he put in
  799.   some delay loops to slow it down so it doesn't look so easy to the custo-
  800.   mer.
  801.  
  802.   In the secure telephone arena, your choices look bleak. The leading con-
  803.   tender is the STU-III (Secure Telephone Unit), made by Motorola and AT&T
  804.   for $2000-$3000, and used by the government for classified applications. It
  805.   has strong cryptography, but requires some sort of special license from the
  806.   government to buy this strong version. A commercial version of the STU-III
  807.   is available that is watered down for NSA's convenience, and an export ver-
  808.   sion is available that is even more severely weakened. Then there is the
  809.   $1200 AT&T Surity 3600, which uses the government's famous Clipper chip for
  810.   encryption, with keys escrowed with the government for the convenience of
  811.   wiretappers. Then of course, there are the analog (non-digital) voice
  812.   scramblers that you can buy from the spy-wannabe catalogs, that are really
  813.   useless toys as far as cryptography is concerned, but are sold as "secure"
  814.   communications products to customers who just don't know any better.
  815.  
  816.   In some ways, cryptography is like pharmaceuticals. Its integrity may be
  817.   absolutely crucial. Bad penicillin looks the same as good penicillin. You
  818.   can tell if your spreadsheet software is wrong, but how do you tell if your
  819.   cryptography package is weak? The ciphertext produced by a weak encryption
  820.   algorithm looks as good as ciphertext produced by a strong encryption algo-
  821.   rithm. There's a lot of snake oil out there. A lot of quack cures. Unlike
  822.   the patent medicine hucksters of old, these software implementors usually
  823.   don't even know their stuff is snake oil. They may be good software
  824.   engineers, but they usually haven't even read any of the academic litera-
  825.   ture in cryptography. But they think they can write good cryptographic
  826.   software. And why not? After all, it seems intuitively easy to do so. And
  827.   their software seems to work okay.
  828.  
  829.   Anyone who thinks they have devised an unbreakable encryption scheme either
  830.   is an incredibly rare genius or is naive and inexperienced.  Unfortunately,
  831.   I sometimes have to deal with would-be cryptographers who want to make
  832.   "improvements" to PGP by adding encryption algorithms of their own design.
  833.  
  834.   I remember a conversation with Brian Snow, a highly placed senior crypto-
  835.   grapher with the NSA. He said he would never trust an encryption algorithm
  836.   designed by someone who had not "earned their bones" by first spending a
  837.   lot of time cracking codes. That did make a lot of sense. I observed that
  838.   practically no one in the commercial world of cryptography qualified under
  839.   this criterion. "Yes," he said with a self assured smile, "And that makes
  840.   our job at NSA so much easier." A chilling thought. I didn't qualify
  841.   either.
  842.  
  843.   The government has peddled snake oil too. After World War II, the US sold
  844.   German Enigma ciphering machines to third world governments. But they
  845.   didn't tell them that the Allies cracked the Enigma code during the war, a
  846.   fact that remained classified for many years. Even today many UNIX systems
  847.   worldwide use the Enigma cipher for file encryption, in part because the
  848.   government has created legal obstacles against using better algorithms.
  849.   They even tried to prevent the initial publication of the RSA algorithm in
  850.   1977. And they have for many years squashed essentially all commercial
  851.   efforts to develop effective secure telephones for the general public.
  852.  
  853.   The principal job of the US government's National Security Agency is to
  854.   gather intelligence, principally by covertly tapping into people's private
  855.   communications (see James Bamford's book, The Puzzle Palace). The NSA has
  856.   amassed considerable skill and resources for cracking codes. When people
  857.   can't get good cryptography to protect themselves, it makes NSA's job much
  858.   easier. NSA also has the responsibility of approving and recommending
  859.   encryption algorithms. Some critics charge that this is a conflict of
  860.   interest, like putting the fox in charge of guarding the hen house. In the
  861.   1980s, NSA had been pushing a conventional encryption algorithm that they
  862.   designed (the COMSEC Endorsement Program), and they won't tell anybody how
  863.   it works because that's classified. They wanted others to trust it and use
  864.   it. But any cryptographer can tell you that a well-designed encryption
  865.   algorithm does not have to be classified to remain secure. Only the keys
  866.   should need protection. How does anyone else really know if NSA's classi-
  867.   fied algorithm is secure? It's not that hard for NSA to design an encryp-
  868.   tion algorithm that only they can crack, if no one else can review the
  869.   algorithm. And now with the Clipper chip, the NSA is pushing SKIPJACK,
  870.   another classified cipher they designed. Are they deliberately selling
  871.   snake oil?
  872.  
  873.   There are three main factors that have undermined the quality of commercial
  874.   cryptographic software in the US.
  875.  
  876.   -    The first is the virtually universal lack of competence of implemen-
  877.   tors of commercial encryption software (although this is starting to change
  878.   since the publication of PGP). Every software engineer fancies himself a
  879.   cryptographer, which has led to the proliferation of really bad crypto
  880.   software. -    The second is the NSA deliberately and systematically
  881.   suppressing all the good commercial encryption technology, by legal intimi-
  882.   dation and economic pressure. Part of this pressure is brought to bear by
  883.   stringent export controls on encryption software which, by the economics of
  884.   software marketing, has the net effect of suppressing domestic encryption
  885.   software. -    The other principle method of suppression comes from the
  886.   granting all the software patents for all the public key encryption algo-
  887.   rithms to a single company, affording a single choke point to suppress the
  888.   spread of this technology (although this crypto patent cartel broke up in
  889.   the fall of 1995).
  890.  
  891.   The net effect of all this is that before PGP was published, there was
  892.   almost no highly secure general purpose encryption software available in
  893.   the US.
  894.  
  895.   I'm not as certain about the security of PGP as I once was about my brilli-
  896.   ant encryption software from college. If I were, that would be a bad sign.
  897.   But I don't think PGP contains any glaring weaknesses (although I'm pretty
  898.   sure it contains bugs). I have selected the best algorithms from the pub-
  899.   lished literature of civilian cryptologic academia. For the most part, they
  900.   have been individually subject to extensive peer review. I know many of the
  901.   world's leading cryptographers, and have discussed with some of them many
  902.   of the cryptographic algorithms and protocols used in PGP. It's well
  903.   researched, and has been years in the making. And I don't work for the NSA.
  904.   But you don't have to trust my word on the cryptographic integrity of PGP,
  905.   because source code is available to facilitate peer review.
  906.  
  907.   And one more point about my commitment to cryptographic quality in PGP:
  908.   Since I first developed and released PGP for free in 1991, I spent three
  909.   years under criminal investigation by US Customs for PGP's spread overseas,
  910.   with risk of criminal prosecution and years of imprisonment (by the way,
  911.   you didn't see the government getting upset about other cryptographic
  912.   software - it's PGP that really set them off - what does that tell you
  913.   about the strength of PGP?). I have earned
  914.    my reputation on the cryptographic integrity of my products. I will not
  915.   betray my commitment to our right to privacy, for which I have risked my
  916.   freedom. I'm not about to allow a product with my name on it to have any
  917.   secret back doors.
  918.  
  919. Vulnerabilities
  920.   No data security system is impenetrable. PGP can be circumvented in a
  921.   variety of ways. In any data security system, you have to ask yourself if
  922.   the information you are trying to protect is more valuable to your attacker
  923.   than the cost of the attack. This should lead you to protecting yourself
  924.   from the cheapest attacks, while not worrying about the more expensive
  925.   attacks.
  926.  
  927.   Some of the discussion that follows may seem unduly paranoid, but such an
  928.   attitude is appropriate for a reasonable discussion of vulnerability
  929.   issues.
  930.  
  931.   "If all the personal computers in the world-260 million-were put to work on
  932.   a single PGP-encrypted message, it would still take an estimated 12 million
  933.   times the age of the universe, on average, to break a single message."
  934.     -William Crowell,
  935.     Deputy Director, National Security Agency, March 20, 1997.
  936.  
  937. Compromised passphrase and Private Key
  938.   Probably the simplest attack is if you leave your passphrase for your
  939.   private key written down somewhere. If someone gets it and also gets your
  940.   private key file, they can read your messages and make signatures in your
  941.   name.
  942.  
  943.   Here are some recommendations for protecting your passphrase: 1.      Don't
  944.   use obvious passphrases that can be easily guessed, such as the names of
  945.   your kids or spouse. 2.      Use spaces and a combination of numbers and
  946.   letters in your passphrase. If you make your passphrase a single word, it
  947.   can be easily guessed by having a computer try all the words in the dic-
  948.   tionary until it finds your password. That's why a passphrase is so much
  949.   better than a password. A more sophisticated attacker may have his computer
  950.   scan a book of famous quotations to find your passphrase. 3.      Be
  951.   creative. Use an easy to remember but hard to guess passphrase; you can
  952.   easily construct one by using some creatively nonsensical sayings or very
  953.   obscure literary quotes.
  954.  
  955. Public Key Tampering
  956.   A major vulnerability exists if public keys are tampered with. This may be
  957.   the most crucially important vulnerability of a public key cryptosystem, in
  958.   part because most novices don't immediately recognize it. The importance of
  959.   this vulnerability, and appropriate hygienic countermeasures, are detailed
  960.   in the section "How to Protect Public Keys from Tampering" earlier in this
  961.   chapter.
  962.  
  963.   To summarize: When you use someone's public key, make certain it has not
  964.   been tampered with. A new public key from someone else should be trusted
  965.   only if you got it directly from its owner, or if it has been signed by
  966.   someone you trust. Make sure no one else can tamper with your own public
  967.   keyring. Maintain physical control of both your public keyring and your
  968.   private key, preferably on your own personal computer rather than on a
  969.   remote timesharing system. Keep a backup copy of both keyrings.
  970.  
  971. Not Quite Deleted Files
  972.   Another potential security problem is caused by how most operating systems
  973.   delete files. When you encrypt a file and then delete the original plain-
  974.   text file, the operating system doesn't actually physically erase the data.
  975.   It merely marks those disk blocks as deleted, allowing the space to be
  976.   reused later. It's sort of like discarding sensitive paper documents in the
  977.   paper recycling bin instead of the paper shredder. The disk blocks still
  978.   contain the original sensitive data you wanted to erase, and will probably
  979.   eventually be overwritten by new data at some point in the future. If an
  980.   attacker reads these deleted disk blocks soon after they have been deallo-
  981.   cated, he could recover your plaintext. In fact this could even happen
  982.   accidentally, if for some reason something went wrong with the disk and
  983.   some files were accidentally deleted or corrupted. A disk recovery program
  984.   may be run to recover the damaged files, but this often means some previ-
  985.   ously deleted files are resurrected along with everything else. Your confi-
  986.   dential files that you thought were gone forever could then reappear and be
  987.   inspected by whomever is attempting to recover your damaged disk. Even
  988.   while you are creating the original message with a word processor or text
  989.   editor, the editor may be creating multiple temporary copies of your text
  990.   on the disk, just because of its internal workings. These temporary copies
  991.   of your text are deleted by the word processor when it's done, but these
  992.   sensitive fragments are still on your disk somewhere.
  993.  
  994.   The only way to prevent the plaintext from reappearing is to somehow cause
  995.   the deleted plaintext files to be overwritten. Unless you know for sure
  996.   that all the deleted disk blocks will soon be reused, you must take posi-
  997.   tive steps to overwrite the plaintext file, and also any fragments of it on
  998.   the disk left by your word processor. You can take care of any fragments of
  999.   the plaintext left on the disk by using any of the disk utilities available
  1000.   that can overwrite all of the unused blocks on a disk. For example, the
  1001.   Norton Utilities for MS-DOS can do this.
  1002.  
  1003. Viruses and Trojan Horses
  1004.   Another attack could involve a specially-tailored hostile computer virus or
  1005.   worm that might infect PGP or your operating system. This hypothetical
  1006.   virus could be designed to capture your Passphrase or private key or deci-
  1007.   phered messages, and covertly write the captured information to a file or
  1008.   send it through a network to the virus's owner. Or it might alter PGP's
  1009.   behavior so that signatures are not properly checked. This attack is
  1010.   cheaper than cryptanalytic attacks.
  1011.  
  1012.   Defending against this falls under the category of defending against viral
  1013.   infection generally. There are some moderately capable anti-viral products
  1014.   commercially available, and there are hygienic procedures to follow that
  1015.   can greatly reduce the chances of viral infection. A complete treatment of
  1016.   anti-viral and anti-worm countermeasures is beyond the scope of this docu-
  1017.   ment. PGP has no defenses against viruses, and assumes your own personal
  1018.   computer is a trustworthy execution environment. If such a virus or worm
  1019.   actually appeared, hopefully word would soon get around warning everyone.
  1020.  
  1021.   Another similar attack involves someone creating a clever imitation of PGP
  1022.   that behaves like PGP in most respects, but doesn't work the way it's sup-
  1023.   posed to. For example, it might be deliberately crippled to not check
  1024.   signatures properly, allowing bogus key certificates to be accepted. You
  1025.   should make an effort to get your copy of PGP directly from Pretty Good
  1026.   Privacy.
  1027.  
  1028.   There are other ways to check PGP for tampering, using digital signatures.
  1029.   You could use another trusted version of PGP to check the signature on a
  1030.   suspect version of PGP. But this will not help at all if your operating
  1031.   system is infected, nor will it detect if your original copy of pgp.exe has
  1032.   been maliciously altered in such a way as to compromise its own ability to
  1033.   check signatures. This test also assumes that you have a good trusted copy
  1034.   of the public key that you use to check the signature on the PGP execut-
  1035.   able.
  1036.  
  1037.   Swap Files or Virtual Memory PGP was originally developed for MS-DOS, a
  1038.   primitive operating system by today's standards. But as it was ported to
  1039.   other more complex operating systems, such as Microsoft Windows or the
  1040.   Macintosh OS, a new vulnerability emerged. This vulnerability stems from
  1041.   the fact that these fancier operating systems use a technique called vir-
  1042.   tual memory.
  1043.  
  1044.   Virtual memory allows you to run huge programs on your computer that are
  1045.   bigger than the space available in your computer's semiconductor memory
  1046.   chips. This is handy because software has become more and more bloated
  1047.   since graphical user interfaces became the norm, and users started running
  1048.   several large applications at the same time. The operating system uses the
  1049.   hard disk to store portions of your software that aren't being used at the
  1050.   moment. This means that the operating system might, without your knowledge,
  1051.   write out to disk some things that you thought were kept only in main
  1052.   memory. Things like keys, passphrases, or decrypted plaintext. PGP does not
  1053.   keep that kind of sensitive data lying around in memory for longer than
  1054.   necessary, but these is some chance that the operating system could write
  1055.   it out to disk anyway.
  1056.  
  1057.   The data is written out to some scratchpad area of the disk, known as a
  1058.   swap file. Data is read back in from the swap file as needed, so that only
  1059.   part of your program or data is in physical memory at any one time. All
  1060.   this activity is invisible to the user, who just sees the disk chattering
  1061.   away. Microsoft Windows swaps chunks of memory, called pages, using a Least
  1062.   Recently Used (LRU) page replacement algorithm. This means pages that have
  1063.   not been accessed for the longest period of time are the first ones to be
  1064.   swapped to the disk. This approach suggest that in most cases the risk is
  1065.   fairly low that sensitive data will be swapped out to disk, because PGP
  1066.   doesn't leave it in memory for very long. But we don't make any guarantees.
  1067.  
  1068.   This swap file may be accessed by anyone who can get physical access to
  1069.   your computer. If you are concerned about this problem, you may be able to
  1070.   solve it by obtaining special software that overwrites your swap file.
  1071.   Another possible cure is to turn off your operating system's virtual memory
  1072.   feature. Microsoft Windows allows for this, and so does the Mac OS. Turning
  1073.   off virtual memory means you might need to have more physical RAM chips
  1074.   installed in order to fit everything in RAM.
  1075.  
  1076. Physical Security Breach
  1077.   A physical security breach may allow someone to physically acquire your
  1078.   plaintext files or printed messages. A determined opponent might accomplish
  1079.   this through burglary, trash-picking, unreasonable search and seizure, or
  1080.   bribery, blackmail or infiltration of your staff. Some of these attacks may
  1081.   be especially feasible against grassroots political organizations that
  1082.   depend on a largely volunteer staff.
  1083.  
  1084.   Don't be lulled into a false sense of security just because you have a
  1085.   cryptographic tool. Cryptographic techniques protect data only while it's
  1086.   encrypted-direct physical security violations can still compromise plain-
  1087.   text data or written or spoken information.
  1088.  
  1089.   This kind of attack is cheaper than cryptanalytic attacks on PGP.
  1090.  
  1091. Tempest Attacks
  1092.   Another kind of attack that has been used by well-equipped opponents
  1093.   involves the remote detection of the electromagnetic signals from your com-
  1094.   puter. This expensive and somewhat labor-intensive attack is probably still
  1095.   cheaper than direct cryptanalytic attacks. An appropriately instrumented
  1096.   van can park near your office and remotely pick up all of your keystrokes
  1097.   and messages displayed on your computer video screen. This would compromise
  1098.   all of your passwords, messages, etc. This attack can be thwarted by prop-
  1099.   erly shielding all of your computer equipment and network cabling so that
  1100.   it does not emit these signals. This shielding technology is known as "Tem-
  1101.   pest," and is used by some government agencies and defense contractors.
  1102.   There are hardware vendors who supply Tempest shielding commercially.
  1103.  
  1104. Protecting Against Bogus Timestamps
  1105.   A somewhat obscure vulnerability of PGP involves dishonest users creating
  1106.   bogus timestamps on their own public key certificates and signatures. You
  1107.   can skip over this section if you are a casual user and aren't deeply into
  1108.   obscure public-key protocols.
  1109.  
  1110.   There's nothing to stop a dishonest user from altering the date and time
  1111.   setting of his own system's clock, and generating his own public-key certi-
  1112.   ficates and signatures that appear to have been created at a different
  1113.   time. He can make it appear that he signed something earlier or later than
  1114.   he actually did, or that his public/private key pair was created earlier or
  1115.   later. This may have some legal or financial benefit to him, for example by
  1116.   creating some kind of loophole that might allow him to repudiate a signa-
  1117.   ture.
  1118.  
  1119.   I think this problem of falsified timestamps in digital signatures is no
  1120.   worse than it is already in handwritten signatures. Anyone may write a date
  1121.   next to their handwritten signature on a contract with any date they
  1122.   choose, yet no one seems to be alarmed over this state of affairs. In some
  1123.   cases, an "incorrect" date on a handwritten signature might not be associ-
  1124.   ated with actual fraud. The timestamp might be when the signator asserts
  1125.   that he signed a document, or maybe when he wants the signature to go into
  1126.   effect.
  1127.  
  1128.   In situations where it is critical that a signature be trusted to have the
  1129.   actual correct date, people can simply use notaries to witness and date a
  1130.   handwritten signature. The analog to this in digital signatures is to get a
  1131.   trusted third party to sign a signature certificate, applying a trusted
  1132.   timestamp. No exotic or overly formal protocols are needed for this. Wit-
  1133.   nessed signatures have long been recognized as a legitimate way of deter-
  1134.   mining when a document was signed.
  1135.  
  1136.   A trustworthy Certifying Authority or notary could create notarized signa-
  1137.   tures with a trustworthy timestamp. This would not necessarily require a
  1138.   centralized authority. Perhaps any trusted introducer or disinterested
  1139.   party could serve this function, the same way real notary publics do now.
  1140.   When a notary signs other people's signatures, it creates a signature cer-
  1141.   tificate of a signature certificate. This would serve as a witness to the
  1142.   signature the same way real notaries now witness handwritten signatures.
  1143.   The notary could enter the detached signature certificate (without the
  1144.   actual whole document that was signed) into a special log controlled by the
  1145.   notary. Anyone can read this log. The notary's signature would have a
  1146.   trusted timestamp, which might have greater credibility or more legal sig-
  1147.   nificance than the timestamp in the original signature.
  1148.  
  1149.   There is a good treatment of this topic in Denning's 1983 article in IEEE
  1150.   Computer (see the Recommended Introductory Readings section, below). Future
  1151.   enhancements to PGP might have features to easily manage notarized signa-
  1152.   tures of signatures, with trusted timestamps.
  1153.  
  1154. Exposure on Multi-user Systems
  1155.   PGP was originally designed for a single-user PC under your direct physical
  1156.   control. If you run PGP at home on your own PC your encrypted files are
  1157.   generally safe, unless someone breaks into your house, steals your PC and
  1158.   convinces you to give them your passphrase (or your passphrase is simple
  1159.   enough to guess).
  1160.  
  1161.   PGP is not designed to protect your data while it is in plaintext form on a
  1162.   compromised system. Nor can it prevent an intruder from using sophisticated
  1163.   measures to read your private key while it is being used. You will just
  1164.   have to recognize these risks on multi-user systems, and adjust your expec-
  1165.   tations and behavior accordingly. Perhaps your situation is such that you
  1166.   should consider only running PGP on an isolated single-user system under
  1167.   your direct physical control.
  1168.  
  1169. Traffic Analysis
  1170.   Even if the attacker cannot read the contents of your encrypted messages,
  1171.   he may be able to infer at least some useful information by observing where
  1172.   the messages come from and where they are going, the size of the messages,
  1173.   and the time of day the messages are sent. This is analogous to the
  1174.   attacker looking at your long distance phone bill to see who you called and
  1175.   when and for how long, even though the actual content of your calls is unk-
  1176.   nown to the attacker. This is called traffic analysis. PGP alone does not
  1177.   protect against traffic analysis. Solving this problem would require spe-
  1178.   cialized communication protocols designed to reduce exposure to traffic
  1179.   analysis in your communication environment, possibly with some crypto-
  1180.   graphic assistance.
  1181.  
  1182. Cryptanalysis
  1183.   An expensive and formidable cryptanalytic attack could possibly be mounted
  1184.   by someone with vast supercomputer resources, such as a government intelli-
  1185.   gence agency. They might crack your RSA key by using some new secret fac-
  1186.   toring breakthrough. But civilian academia has been intensively attacking
  1187.   it without success since 1978.
  1188.  
  1189.   Perhaps the government has some classified methods of cracking the IDEA
  1190.   conventional encryption algorithm used in PGP. This is every
  1191.   cryptographer's worst nightmare. There can be no absolute security guaran-
  1192.   tees in practical cryptographic implementations.
  1193.  
  1194.   Still, some optimism seems justified. The IDEA algorithm's designers are
  1195.   among the best cryptographers in Europe. It has had extensive security
  1196.   analysis and peer review from some of the best cryptanalysts in the unclas-
  1197.   sified world. It appears to have some design advantages over DES in with-
  1198.   standing differential cryptanalysis.
  1199.  
  1200.   Besides, even if this algorithm has some subtle unknown weaknesses, PGP
  1201.   compresses the plaintext before encryption, which should greatly reduce
  1202.   those weaknesses. The computational workload to crack it is likely to be
  1203.   much more expensive than the value of the message.
  1204.  
  1205.   If your situation justifies worrying about very formidable attacks of this
  1206.   caliber, then perhaps you should contact a data security consultant for
  1207.   some customized data security approaches tailored to your special needs.
  1208.  
  1209.   In summary, without good cryptographic protection of your data communica-
  1210.   tions, it may have been practically effortless and perhaps even routine for
  1211.   an opponent to intercept your messages, especially those sent through a
  1212.   modem or e-mail system. If you use PGP and follow reasonable precautions,
  1213.   the attacker will have to expend far more effort and expense to violate
  1214.   your privacy.
  1215.  
  1216.   If you protect yourself against the simplest attacks, and you feel confi-
  1217.   dent that your privacy is not going to be violated by a determined and
  1218.   highly resourceful attacker, then you'll probably be safe using PGP. PGP
  1219.   gives you Pretty Good Privacy.
  1220.  
  1221. Recommended Introductory Readings
  1222.   Bacard Andre, "Computer Privacy Handbook," Peachpit Press, 1995
  1223.   Garfinkel Simson, "Pretty Good Privacy," O'Reilly & Associates, 1995
  1224.   Schneier Bruce, "Applied Cryptography: Protocols, Algorithms, and
  1225.   Source Code in C, Second Edition," John Wiley & Sons, 1996
  1226.   Schneier Bruce, "E-mail Security," John Wiley & Sons, 1995
  1227.   Stallings William, "Protect Your Privacy," Prentice Hall, 1994
  1228.  
  1229. Other Readings:
  1230.   Lai Xuejia, "On the Design and Security of Block Ciphers," Institute for
  1231.   Signal and Information Processing, ETH-Zentrum, Zurich, Switzerland, 1992
  1232.   Lai Xuejia, Massey James L., Murphy Sean" Markov Ciphers and Differential
  1233.   Cryptanalysis," Advances in Cryptology-EUROCRYPT'91
  1234.   Rivest Ronald, "The MD5 Message Digest Algorithm," MIT Laboratory for Com-
  1235.   puter Science, 1991
  1236.   Wallich Paul, "Electronic Envelopes," Scientific American, Feb. 1993, page
  1237.   30.
  1238.   Zimmermann Philip, "A Proposed Standard Format for RSA Cryptosystems,"
  1239.   Advances in Computer Security, Vol. III, edited by Rein Turn, Artech House,
  1240.   1988 Chapter 6.
  1241.  
  1242. SEE ALSO
  1243.   pgpe(1), pgpv(1), pgps(1), pgpk(1), pgp.cfg(5), pgp-integration(7), pgp-
  1244.   prz(7), http://www.pgp.com (US versions) and http://www.pgpi.com (Interna-
  1245.   tional versions)
  1246.  
  1247.