home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / sci / crypt / 4497 < prev    next >
Encoding:
Text File  |  1992-11-09  |  24.3 KB  |  515 lines

  1. Newsgroups: sci.crypt
  2. Path: sparky!uunet!newsgate.watson.ibm.com!yktnews!admin!wo0z!lwloen
  3. From: lwloen@rchland.vnet.ibm.com (Larry Loen)
  4. Subject: temporary, independent FAQ
  5. Sender: news@rchland.ibm.com
  6. Message-ID: <1992Nov09.152315.20637@rchland.ibm.com>
  7. Date: Mon, 09 Nov 1992 15:23:15 GMT
  8. Reply-To: lwloen@vnet.ibm.com
  9. Disclaimer: This posting represents the poster's views, not necessarily those of IBM
  10. Nntp-Posting-Host: wo0z.rchland.ibm.com
  11. Organization: IBM Rochester
  12. Lines: 501
  13.  
  14. "temporary, independent" sci.crypt Frequently Asked Questions
  15.  
  16. There a group is putting together a fine FAQ for this
  17. topic.  However, in my brief tenure on Internet, there seems to
  18. be a consistent cry for some form of FAQ and postings that also
  19. cry for one.  After a discussion with a former member of the
  20. FAQ group, I've decided to post this from time to time.
  21.  
  22. This is an attempt to answer many basic questions in hope of
  23. providing a lot of the benefit of a FAQ without the burden of
  24. being a complete answer to all relevant questions.  There is no
  25. desire or attempt to replace the other group's work; this is more
  26. of a stopgap.  However, beginners should find this very helpful.
  27.  
  28. Note:  References to a "Megabarfoocorp" are intended to be
  29. fictional.
  30.  
  31. Q1:  What is cryptography?  How, basically, does it work?
  32.   What are the basic terms used to describe cryptography?
  33.  
  34.   Cryptography is the art and science of hiding data in plain sight.
  35.   It is also the art and science of stealing data hidden in plain sight.
  36.   There are at least three players.  The first is the one who has
  37.   the original data, which is presumed to have high value to
  38.   others.  This data is presumed to reside in a safe place that
  39.   no one but the originator and his/her friends can see.  (If the
  40.   originator cannot physically secure the original data,
  41.   cryptography is a waste of time).  Now, for cryptography to be
  42.   necessary, the data must, for some reason, have to be
  43.   transmitted over some public means such as a telephone line, a
  44.   letter through the mail; any means that cannot be physically
  45.   secured by the owner to a legitimate receiver of the data.  The
  46.   receiver is the second party.
  47.  
  48.   Cryptography is any transformation of the data into a form it is hoped
  49.   that cannot be recovered in a timely manner by an unknown party,
  50.   which is called here 'the opponent'.  The transformation is not
  51.   some physical means, such as hiding the data on microfilm or
  52.   some such; it is some mathematical transformation of the
  53.   original data that the receiver on the other end knows how to
  54.   undo.
  55.  
  56.   The process of scrambling (transforming) the data is called
  57.   'encryption'.  Unscrambling is called decryption.  An
  58.   encryption system has two basic parts.  1) A general
  59.   transformation process called the encryption algorithm.  2) A
  60.   customization of that algorithm called a cipher key.  The
  61.   sender and the receiver must find a secure means to exchange
  62.   the cipher key.  That is, the same public means used to send
  63.   the encrypted data cannot be used.  This may be a difficult
  64.   problem, and has a variety of solutions, but will be assumed
  65.   solved for now.  Once the key is successfully exchanged, the
  66.   two parties can separately implement the encryption algorithm
  67.   and its inverse, the decryption algorithm.
  68.  
  69.   At this point, the data can be transmitted in its encrypted form
  70.   using the agreed-to key to customize the general algorithm to a
  71.   particular version that transforms the data.  Since the
  72.   encrypted data is sent over some insecure medium, it is assumed
  73.   that an opponent (the third party) may intercept the data,
  74.   possibly without being detected, and analyze the encrypted
  75.   text, also called cipher text.
  76.  
  77.   In theory, any encryption system can be defeated, given enough
  78.   time.  The amount of time it takes cannot always be predicted.
  79.   This is because the opponent can supply extra information
  80.   that might reduce the computation time a great deal.  For one
  81.   thing, the sender and receiver may make a very poor choice of
  82.   cipher key.  If the opponent has a list of poor keys, a
  83.   computer may permit a large list of such keys to be tried;
  84.   if the poor key actually used is on the list, the opponent wins
  85.   even if the encryption system is otherwise secure.
  86.  
  87.   All methods the opponent dreams up have one thing in common.
  88.   It is an attempt to recover the original data without advance
  89.   knowledge of the particular cipher key.  There are a wide
  90.   variety of means available and some will be described later on.
  91.   The name for any of these methods is called 'cryptanalysis' and
  92.   the person who does the penetration is called the cryptanalyst.
  93.  
  94.   In diagram form (the boxes indicated physically secure areas)--
  95.  
  96.   -------------|                   --------------
  97.     Sender     |                   | Receiver
  98.    "x"         |                   |  cipher key
  99.     cipher key |------->  y  ----->|
  100.    y=Encrypt(  |          |        | x=Decrypt(y,key)
  101.       x,key)   |          |        |
  102.   -------------|          |        |-------------
  103.                           V
  104.                   Opponent
  105.                      z = Cryptanalysis(y,Encrypt Algorithm,
  106.                              general knowledge of x, guesses about
  107.                              secret key, statistical analysis of y)
  108.  
  109.            The opponent uses Cryptanalysis of message y until
  110.            the value z is either equal to x or z is "enough" like
  111.            x to accomplish the illicit purpose.  The sender and
  112.            receiver win whenever recovery of z takes too much time.
  113.  
  114. Q2:  I have invented this wonderful, fast-running encryption
  115.   algorithm.  How do I find out if it is as great as I think it
  116.   is?
  117.  
  118.   It is one thousand times easier to invent an encryption
  119.   algorithm than it is to discover if it is worthwhile.  Most
  120.   designers who have not learned cryptography are used to dealing
  121.   with mathematics that discusses the general case.  But,
  122.   successful cryptanalysis often relies on any number of
  123.   fortuitous special cases that the designer must anticipate lest
  124.   a given key and data stream create even one of them.  Many
  125.   practical illicit decryptions astonish the newcomer; they seem
  126.   like cheating, but they do work.
  127.  
  128.   It is easy to get superficial reassurance that a poor
  129.   encryption algorithm seems good.  Most people reading this file
  130.   have probably attempted the kinds of cryptograms one finds in
  131.   newspapers and puzzle books (usually called 'cryptograms').
  132.   That encryption algorithm is simple -- one replaces each letter
  133.   of the alphabet with exactly one other letter of the alphabet.
  134.   In less than an hour, sixth graders have been taught to
  135.   successfully solve this kind of cipher.  Yet, it has 26
  136.   factorial possible keys (about 2 to the 88th power), which is
  137.   much more than the 2 to the 56th keys of the well known
  138.   commercial algorithm, DES.  A large number of keys is
  139.   important, but is not by itself secure.  Obviously, the
  140.   successful sixth graders do not attempt all possible keys.
  141.   They use their general knowledge of English to shortcut the
  142.   process and eliminate all but a few possible keys.
  143.  
  144.   Since the gross mathematical properties of an encryption
  145.   system prove nothing, only cryptanalytic attacks matter
  146.   and these require some study.
  147.  
  148. Q3:  What is an "attack"?
  149.  
  150.   An attack is a particular form of cryptanalysis.  There are
  151.   generic types of attacks, and some very specific attacks.  In
  152.   the end, cryptography is a war of specifics.  The opponent
  153.   will either invent a very clever and unique attack or will
  154.   customize a general attack to suit the needs at hand.  Some
  155.   attacks might even exploit the properties of a particular
  156.   message or settle for a partial illicit decryption.
  157.  
  158.   However, in sci.crypt, there is a great deal of discussion
  159.   about attacks, both general and specific, and an assumption
  160.   that the reader can fill in missing details at times.  Since
  161.   those who post here usually have other things to do, to-the-bit
  162.   details are often omitted.
  163.  
  164. Q4:  Hmm.  In spite of questions 2 and 3, I still think I
  165.   have a pretty good system.  But, it seems pretty hard
  166.   to know if it can really defeat an expert.  Still, I know
  167.   it will work if I can keep my method secret, right?
  168.  
  169.   Good luck.  There are documented cases aplenty where an
  170.   encryption system was deduced based entirely on clever analysis
  171.   of the encrypted text alone.  There are also known cases
  172.   where encryption systems were deduced because the encrypted
  173.   text was later published verbatim somewhere (for instance, a
  174.   press release) and so the system was figured out, eliminating
  175.   the presumed secrecy advantage for the next cipher text.
  176.  
  177. Q5:  What are the principal cryptanalytic attacks?
  178.  
  179.   The first is "cipher text only".  This is recovering the text
  180.   or the key by analysis of the text (using statistical means,
  181.   for instance) and by knowing broad details such as whether it
  182.   is the text of someone's speech, a PC-DOS EXE file, whether text
  183.   is in English or French.  For non-puzzle examples, such broad
  184.   information is almost always reliably known.  People have some
  185.   idea of what they wish to steal.  The weakest systems fall to
  186.   this form of attack.
  187.  
  188.   The next attack is "known plaintext".  If one works with a
  189.   newspaper cryptogram, one may have little idea of what is in
  190.   the text.  However, if one was illicitly trying to decrypt the
  191.   source code of Megabarfoocorp's C++ compiler, one would be much
  192.   better off.  There would be lots of things one could
  193.   confidently expect, such as long strings of the space
  194.   character, strings like "if (" and "if(" and the like.
  195.  
  196.   There would even be whole phrases like "Copyright 1990,
  197.   Megabarfoocorp International" or some such.  With imagination,
  198.   surprisingly long strings can be predicted.  Computers can
  199.   tirelessly try a number of trivial variations of such known
  200.   text at a great many locations.  Knowledge of the encryption
  201.   system may reveal the correct placement outright or a small
  202.   number of places to try.  A wide variety of systems can be
  203.   broken if enough known plaintext can be successfully placed.
  204.  
  205.   The next attack is "chosen plaintext".  In some situations, it
  206.   is possible for the opponent to pose as the legitimate user
  207.   of the encryption system.  This is especially true in "public
  208.   key" systems (described later).  In this case, the opponent
  209.   can present fairly arbitrary unencrypted data of his/her
  210.   choosing, cause it to be encrypted, and study the results.
  211.   Very few systems ever invented pass this test, but it should be
  212.   seriously considered for any significant use.  Why?  No
  213.   designer can dream up all attacks.  Moreover, at some point, a
  214.   form of known plaintext attack may well enough approximate a
  215.   chosen plaintext attack to make it worthwile for the designer
  216.   tot allow for it to begin with, especially as it might not be
  217.   dreamed up by the designer!
  218.  
  219.   There are other attack strategies.  One worth mentioning for
  220.   telecommunications applications is the "replay" attack.
  221.   Suppose one has an Automatic Teller Machine (ATM) which uses a
  222.   substitution cipher.  Since one assumes the telephone line to
  223.   the ATM can be tapped (why encrypt if it cannot?), one can also
  224.   assume the opponent can _inject_ false ciphertext.  Thus,
  225.   without even being aware of the actual system, an opponent may
  226.   be able to simply replay old ciphertext and get the cash drawer
  227.   to give him/her $50 from your account.  There are encryption
  228.   systems which avoid this difficulty.
  229.  
  230.   Another general form of attack often not considered by
  231.   newcomers is comparing multiple messages using the same key.
  232.   It is impractical to use a different key for each cipher
  233.   text (with one important exception called the 'one time
  234.   pad').  Therefore, an opponent will have several different
  235.   texts encrypted in the same key and may be able to exploit
  236.   this fact.  All transpositions algorithms (those which merely
  237.   scramble the order of the bytes) are vulnerable to this
  238.   attack.  More sophisticated systems are also vulnerable to this
  239.   attack in some cases as well.
  240.  
  241.   This is a vast area and one of the things that is difficult,
  242.   even for experienced designers, is anticipation of all possible
  243.   attacks.  Moreover, there is no obligation on the attacker's
  244.   part to be less mathematically sophisticated than the designer.
  245.   A system that survives the attacks the designer invents may
  246.   fall easily to a mathematical approach the designer of the
  247.   system is unfamiliar with.
  248.  
  249.   And, one even has to worry about items like a rare bug in the
  250.   program that injects the cipher key rather than the cipher text
  251.   into the output stream.  It is amazing how often trifling
  252.   errors in the implementation make theory irrelevant.
  253.  
  254. Q6:  What does make a system 'good'?
  255.  
  256.   What makes a system 'good' relies on many details specific to
  257.   a given situation.  Only after a lot of ingenious attacks are
  258.   tried can a system be released for use.  There never can be any
  259.   absolute guarantees.  All that can be said is that it defeated
  260.   the best experts available.  The opponent may be smarter.
  261.  
  262.   However, there are some agreed-to minimums that a good system
  263.   must have to even be worth serious analysis --
  264.  
  265.   1)  It must be suitable for computer use.  Ordinary byte streams
  266.    (as arbitrary as possible) would be the input "plain"
  267.    text and byte streams would be the output "cipher" text.
  268.    There should be few cases where some kinds of input text produces poor
  269.    results and these, if they exist, should be easily known,
  270.    described, and avoided.
  271.  
  272.   2)  To be cost-competitive, it must produce about the same number of
  273.    output cipher bytes as input plain bytes.  Relaxing this restriction
  274.    is not as helpful as one might think; the best historical systems
  275.    meet this restriction, so a new system must meet it also.
  276.  
  277.   3)  Output bytes should have a complex relationship between the key,
  278.    the plain text being encrypted, and possibly some amount of
  279.    text previously encrypted.  "Simple", general methods, such
  280.    as creation/construction of minterm sums and matrix inversions should
  281.    not produce the cipher key or an equivalent, usable illicit
  282.    decryption method.
  283.  
  284.   4)  Trying all keys must not be practical.  Trying a cleverly ordered
  285.    subset of the keys must not work.  This is hard to achieve; it means
  286.    that the failure of a particular key X to illicitly decrypt must
  287.    not also allow an opponent to conclude that some large class of keys
  288.    "similar" to X need not be tried.
  289.  
  290.    All keys must be equally strong; any exceptions must be well
  291.    known, few in number, and easily avoided.
  292.  
  293.   5)  Assume all details about the encryption algorithm are known.
  294.    Relying on a secret method has failed repeatedly.  It is prudent to
  295.    assume only the variable part of the system, called the cipher key,
  296.    that is selected by the customer, is unknown.
  297.  
  298.   6)  Classical attacks must be tried in great variety and ingenuity.
  299.    Details of this are beyond the scope of this file.  For a summary
  300.    of the principal attacks, see Question 5, "What are the principal
  301.    cryptanalytic attacks?".  It is easy to do this particular step
  302.    incompletely.  Remember, there may be little effective limit to the
  303.    resources or the brainpower of one's opponent.  The data may be
  304.    very valuable and it make take only a couple of days rental of the
  305.    right kind of consultant and a supercomputer to get the job
  306.    done.  The legitimate user will, by contrast, have a smaller
  307.    budget that is begrudged as "overhead".
  308.  
  309.   7) Performance must be competitive with existing solutions.  A
  310.    practical problem is that every moment spent encrypting is regarded as
  311.    "overhead".  Therefore, the method must not be uncompetitive
  312.    with existing algorithms regarded as secure.
  313.  
  314.   Inventing one's own system is an interesting pastime and quite
  315.   educational.  However, any hope of really securing data requires, at
  316.   the very minimum, mastery of illicit decipherment.  It is very easy
  317.   to scramble data impressively and please oneself.  This is not
  318.   the same as keeping it actually secure.
  319.  
  320. Q7:  What are the legal restrictions on cryptography?
  321.  
  322.   You'd have to ask a lawyer.  Most governments consider cryptography a
  323.   sensitive topic for one reason or another.  There are a variety
  324.   of restrictions possible.
  325.  
  326.   Most governments don't give their reasons publically, so one
  327.   may not know why there are restrictions, just that there are
  328.   restrictions to follow.
  329.  
  330.   One can expect to find laws about sending encrypted data over national
  331.   borders and may often expect to find laws about the import and export of
  332.   encryption systems.
  333.  
  334.   Since sending data over Internet, Bitnet, Usenet, Fidonet, etc. may cross
  335.   national borders (even if the originator does not realize it), a basic
  336.   familiarity with these laws is recommended before sending out encryption
  337.   systems or encrypted data.
  338.  
  339. Q8:  What is a public key system?
  340.  
  341.   A public key system is an encryption method with a unique
  342.   property -- encryption and decryption use different keys and
  343.   one of those keys can be published freely.
  344.  
  345.   Being able to pass around the 'decrypt' key part of one's
  346.   encryption algorithm allows some very interesting things to
  347.   happen.  For one thing, messages can be exchanged by people who
  348.   had not planned on doing so in advance.  One merely encrypts in
  349.   one's private key, decrypts using the receiver's public key and
  350.   passes on the result to the receiver.  The receiver encrypts in
  351.   his/her own private key, then decrypts using the sender's public
  352.   key, recovering the message.
  353.  
  354. Q9:  What is key distribution?
  355.  
  356.   Key distribution is the practical problem of exchanging keys
  357.   between the parties that wish to set up an encryption system
  358.   between the two of them.  Especially in a network environment,
  359.   passing keys one can trust back and forth, can be difficult.
  360.   How can one be sure a cipher key was not sent by an imposter?
  361.   Unless the keys are exchanged in a secret, secure place,
  362.   face-to-face, getting keys securely exchanged and with
  363.   knowledge of the fact that the key was sent authentically can
  364.   be difficult.  Yet, any practical system must permit reasonably
  365.   convenient, but very secure exchange of cipher keys.
  366.  
  367.   Once a few special keys are securely exchanged, it may be
  368.   possible to send new cipher keys in encrypted form between the
  369.   sender and receiver that have a known lifetime.  That is, the
  370.   cipher key is sent in a special encrypted message using a
  371.   special key used only for exchanging keys.  In
  372.   telecommunications environments, this allows frequent change of
  373.   keys between the parties 'safely' over the same insecure medium
  374.   used to send the cipher text.  While this idea is at the heart
  375.   of much commercial use of cryptography, it is not easily
  376.   accomplished and less easily summarized.
  377.  
  378. Q10:  What is the 'one time pad'?
  379.  
  380.   The 'one time pad' is an encryption method that is known to be
  381.   absolutely, provably secure.  How it works is as follows --
  382.   1.  Generate a huge number of bits using a naturally random
  383.   process.  2.  Both sides exchange this data, which is as much
  384.   data as they are going to exchange later on.  3.  Exclusive OR the
  385.   original text, bit by bit, with the 'one time pad' data, never
  386.   reusing the 'one time pad' data.  4.  Have elaborate rules to
  387.   keep the two sides in synch so that the data can be recovered
  388.   reliably by the receiver.  (Both sides must know where they are
  389.   in terms of how much 'one time pad' has been consumed).
  390.  
  391.   Note that only genuine, naturally random processes will do.  There
  392.   must be no relationship between any prior bit of the 'one time pad'
  393.   and a future bit of the key.  "Random number generators", in
  394.   particular, may not substitute and still be a 'one time pad'.  The
  395.   reason it works is precisely because there is no relationship between
  396.   any bits of the key stream.  All cipher keys are equally probable.
  397.   All original data messages are equally probable.  There is no 'hat'
  398.   to hang analysis upon.  Even if one can inject as much text into
  399.   a one time pad as one wishes, recovering the key stream tells nothing
  400.   about the next message.
  401.  
  402.   Unfortunately, one time pads are very ungainly, so they are not
  403.   typically used.  The requirement to have a genuinely random process,
  404.   with the right kind of statistical probability, is not easy to
  405.   to set up.  The ability to exchange vast amounts of data,
  406.   securely, in advance, is not easy to achieve in environments
  407.   when encryption is needed in the first place.
  408.  
  409.   There are a variety of cipher systems which generate "pseudo
  410.   one time pad" streams of cipher key, but all have the same
  411.   theoretical vulnerability; any algorithmic process introduces
  412.   relationships between some old key bit(s) and the new key bit
  413.   and so permits cryptanalysis.  "Random number generators" are
  414.   frequently dreamed up by newcomers as a "pseudo one time pad",
  415.   but they are notoriously vulnerable to analysis, all
  416.   independent of whether the pseudo-random stream satisfies
  417.   randomness tests or not.
  418.  
  419. Q11:  What is the NSA (National Security Agency)?
  420.  
  421.   The NSA has several tasks.  The most relevant here is that it employs
  422.   the United States' government's cryptographers.  Most nations have some
  423.   department that handles cryptography for it, but the US' NSA tends to
  424.   draw the most attention.  It is considered equal to or superior to any
  425.   such department in the world.  It keeps an extremely low public profile,
  426.   and has a "large", but secret budget.  Because of these and other factors,
  427.   there will be many posts speculating about the activities and motives of
  428.   the NSA.
  429.  
  430. Q12:  What is the American Cryptogram Association?
  431.  
  432.   American Cryptogram Association Information, Sept 1992
  433.  
  434.   The American Cryptogram Association is an international group
  435.   of individuals who study cryptography together and publish
  436.   puzzle ciphers to challenge each other and get practical
  437.   experience in solving ciphers.  It is a nonprofit group.
  438.  
  439.   The American Cryptogram Association (ACA) publishes the
  440.   bi-monthly magazine, "The Cryptogram", which contains
  441.   a wide variety of simple substitution ciphers ("cryptograms")
  442.   in English and other languages as well as cryptograms
  443.   using cipher systems of historical interest (such as Playfair).
  444.  
  445.   The level of difficulty varies from easy to difficult.  Except
  446.   for "foreign language" cryptograms, all text is in English.
  447.  
  448.   The magazine also features "how to" articles at the hobbyist level
  449.   and other features of interest to members.  A "Computer Supplement"
  450.   is also available which features articles on computerizing various
  451.   phases of cryptogram solving; the level of the articles varies from
  452.   simple programming examples to automatic algorithmic solutions of
  453.   various cipher systems.  The supplement is available as a separate
  454.   subscription, and is published when material permits; usually two
  455.   or three times per year.
  456.  
  457.   Where to write for subscription or other information --
  458.  
  459.   ACA Treasurer
  460.   18789 West Hickory St
  461.   Mundelein IL 60060
  462.  
  463. Q13:  What are some good books on cryptography?
  464.  
  465.   Good books on this topic that weren't government classified used
  466.   to be rare.  There are now a host of good books.  One informal
  467.   test of a library's quality is how many of these are on the
  468.   shelves.  These are widely available, but few libraries have
  469.   them all.
  470.  
  471.     David Kahn, The Codebreakers, Macmillan, 1967 [history; excellent]
  472.  
  473.     H. F. Gaines, Cryptanalysis, Dover, 1956 [originally 1939, as
  474.         Elementary Cryptanalysis]
  475.  
  476.     Abraham Sinkov, Elementary Cryptanalysis, Math. Assoc. of Amer.,
  477.         1966
  478.  
  479.     D Denning, Cryptography and Data Security, Addison-Wesley, 1983
  480.  
  481.     Alan G. Konheim, Cryptography:  A Primer, Wiley-Interscience, 1981
  482.  
  483.     Meyer and Matyas, Cryptography:  A New Dimension in Computer Data
  484.         Security, John Wiley & Sons, 1982.
  485.  
  486.   Books can be ordered from Aegan Park Press.  They are not inexpensive,
  487.         but they are also the only known public source for most of these
  488.         and other books of historical and analytical interest.
  489.  
  490.         From the Aegean Park Press P.O. Box 2837, Laguna
  491.         Hills, CA 92654-0837
  492.  
  493.         [write for current catelog].
  494.  
  495.   The following is a quality, scholarly journal.  Libraries may carry it if
  496.      they are into high technology or computer science.
  497.  
  498.      Cryptologia:  a cryptology journal, quarterly since Jan 1977.
  499.         Cryptologia; Rose-Hulman Institute of Technology; Terre Haute
  500.         Indiana 47803 [general: systems, analysis, history, ...]
  501.  
  502.   Thanks to
  503.  
  504.      cme@ellisun.sw.stratus.com (Carl Ellison)
  505.      Gwyn@BRL.MIL (Doug Gwyn)
  506.      smb@ulysses.att.com (Steven Bellovin)
  507.  
  508.   for saving me the trouble of looking up the details on these books and
  509.      publications.
  510.  
  511.  
  512. -- 
  513.    Larry W. Loen        |  My Opinions are decidedly my own, so please
  514.                         |  do not attribute them to my employer
  515.