Slashdot Mirror


Intro to Encryption

An anonymous reader submitted a Techworld story which is a sort of encryption primer. The difference between codes & cyphers, and what all those acronyms like RSA and DES actually mean. This is good primer material for newbs, and a good refresher for fogeys.

25 of 244 comments (clear)

  1. intro to encryption by JavaLord · · Score: 4, Funny

    svefg cbfg!

    1. Re:intro to encryption by Anonymous Coward · · Score: 5, Informative

      a b c d e f g h i j k l m n o p q r s t u v w x y z
      n o p q r s t u v w x y z a b c d e f g h i j k l m

      first post!

  2. Inaccuracy in article? by DarkHelmet · · Score: 5, Informative
    About RSA: Current hardware means key lengths should be 1024 bits for complete security. The present generation of web browsers use 128-bit keys so cannot be considered secure against a determined and sufficiently well-resourced attack.

    Certificates are 1024 or 2048 bit with SSL. On the other hand, once the key is sent and shared, a 128 bit symmetric form of encryption is used. The only thing RSA is used for is sending / receiving the symmetric encryption key, yes?

    Correct me if I'm wrong.

    --
    /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i
    1. Re:Inaccuracy in article? by cpeikert · · Score: 4, Interesting

      You're right.

      There are other glaring inaccuracies, e.g.: An increasingly important use for asymmetric encryption is digital signing. A digital signature is the reverse of public key encryption.

      This is sort-of true if you're talking about plain-vanilla RSA signatures (though even here, it's only about half-right). But in general, digital signatures have nothing to do with encryption. An encryption scheme does not always yield a useful signature scheme, nor vice-versa.

    2. Re:Inaccuracy in article? by wfberg · · Score: 4, Informative

      About RSA: Current hardware means key lengths should be 1024 bits for complete security. The present generation of web browsers use 128-bit keys so cannot be considered secure against a determined and sufficiently well-resourced attack.

      Certificates are 1024 or 2048 bit with SSL. On the other hand, once the key is sent and shared, a 128 bit symmetric form of encryption is used. The only thing RSA is used for is sending / receiving the symmetric encryption key, yes?


      Kinda yes. The public key is used to encrypt the session key, which is used in turn to encrypt the payload using a symmetric algorithm for speed.

      Certificates are a bit bigger than 1024 or 2048 bits. They contain the public key (consisting in the case of RSA, among other things, of the 1024/2048 bit modulus) the owner's identification (e.g. e-mail address, common name, url, ..), validity dates, and a digital signature from a certificate authority (in some cases they're only self-signed, in other cases, dosens of people may contribute to authenticating a public key's ownership information, as in PGP).

      A certificate is just that; it's to certify that a certain public key belongs to a certain entity.

      If you pay enough to microsoft/opera/etc., you can certify anybody you want and all internet explorer users will take it for granted, because no one checks certificates.
      --
      SCO employee? Check out the bounty
  3. Much better than that article by yahyamf · · Score: 5, Informative

    I would strongly recommend the Code Book by Simon Singh over that short article. It takes the reader from the Ceaser cipher all the way to quantum codes and is a very enjoyable read. The Codebreakers by David Kahn is also an excellent though somewhat lengthier volume

  4. Difference betwen Codes and Cyphers? by NardofDoom · · Score: 5, Funny

    That's easy. Code is what I stare at all day, while Cypher is the jerk who betrayed Neo in The Matrix. Duh.

    --
    You have two hands and one brain, so always code twice as much as you think!
  5. Handbook by Ann+Coulter · · Score: 5, Informative

    The Handbook of Applied Cryptography: http://www.cacr.math.uwaterloo.ca/hac/ is a very detailed guide to some cryptographic algorithms and theories. This is not for newbies at all. For those wanting to implement a particular cipher, this book is the place to refer to. On top of everything, it is free.

    1. Re:Handbook by wfberg · · Score: 4, Informative

      I'd recommend applied crptography by Bruce Schneier instead.

      Not only does it cover the same ground, it also goes into detail a bit more about real tricky business; protocols (where most mistakes are made these days, since nearly everybody uses off-the-shelf algorithms like AES, DSA, RSA and ElGamal). This guy knows how to write, and succeeds in warning you of potential pitfalls in a humorous manner. Also, he knows his stuff; he submitted one of the AES candidates, Blowfish.

      Bruce also publishes the most excellent Crypto-Gram newsletter.

      Beware of not heeding Bruce's stern words of warning. You may end up in the doghouse! The humiliation! The shame upon your house!

      --
      SCO employee? Check out the bounty
    2. Re:Handbook by plover · · Score: 4, Informative
      Actually, Practical Cryptography is probably more useful to most people. In that book, Bruce provides real-world examples of security needs and then details how the protocols should be implemented so as to preserve that security. He leaves the math alone, and discusses the protocols and data instead.

      He wrote it after realizing how poorly people had misunderstood his warnings in Applied Cryptography (as documented in Secrets and Lies.) I thought his warnings were plain enough, but apparently too many people just plopped in some encryption because they "needed" some, and Blowfish was printed right there in the appendix.

      --
      John
  6. Eric Rescorla has written a fine book... by tcopeland · · Score: 4, Interesting

    ...SSL and TLS, which includes an introductory that has a nice overview of encryption concepts and techniques.

    The explanation of stream vs block ciphers is especially good, with nice examples showing how each technique works.

  7. Comprehensive list of unsolved codes and ciphers by tokengeekgrrl · · Score: 4, Interesting

    If after reading the intro to encryption you are so inspired to try to crack one, I highly recommend this list:

    http://www.elonka.com/UnsolvedCodes.html

    Enjoy.

    - tokengeekgrrl

  8. This is good primer material for newbs by JohnGrahamCumming · · Score: 4, Insightful

    That's some clever way of saying "crap", right? This article is horrible, and if I was an encryption newbie all I'd be able to do after reading this article is spout acronyms.

    Here's part of what the article says about RSA:

    "Unfortunately, nothing in life is free, and so it is with asymmetric cryptosystems. Since d can be computed from e given p and q, and p and q are the factors of N, they must be chosen so large that N cannot be factorised in any reasonable time"

    THE ARTICLE NEVER STATES WHAT d, p, q, e OR N ARE. Sorry for the shouting but this piece o'crap is worthy of a /. front page?

    John.

  9. Safe encryption by darkstream · · Score: 5, Funny

    When I want to email with a new friend using PGP encryption, I send him my key one character at a time via snail mail using newspaper clippings. The only time this becomes a problem is when the post office laps itself and delivers more than one letter a day, or gets an earlier letter there later than a later letter, but it's the only way to be sure the key never falls into enemy hands. Of course, I don't get to email many people these days...

    --
    Fun with Inkwell | www.coo
  10. Applied Cryptography by Meostro · · Score: 5, Informative

    Bruce Schneier's Applied Cryptography is another excellent resource for all you crypto-geeks out there. It goes from the basics (including the substitution cipher presented in the article) through basic crypto (ENIGMA, DES) all the way up through state-of-the-art (don't think AES was in my 1st ed., but I believe it's in there now). He talks about everything from the theoretical to the practical, hash collisions to rubber-hose cryptography.

    It comes with source too! You know you love source....

  11. Re:I realized something while reading the article. by grahamsz · · Score: 5, Insightful

    Say tommorrow someone discovered an efficient technique for computing the prime factors of a composite. That would blow RSA and probably DSA out of the water - rendering most parts of PGP/GPG worthless.

    Unless we have other asymetric ciphers to fall back on, then e-commerce would be wiped out.

    Additionally algorithms with very low computational requirements are of particular importance since we need encryption that can run on smart cards, but cant be broken by super computers.

  12. Not really the best intro for crypto by Gentoo+Fan · · Score: 4, Informative

    I'd point people here first, then to a few other links that other people have pointed out. The article linked is a bit terse for a newbie.

  13. Clarification on web-browser security... by xquark · · Score: 4, Informative

    >>The present generation of web browsers use 128-bit keys
    >> so cannot be considered secure against a determined
    >> and sufficiently well-resourced attack.

    The 128-bit there is the symmetric cipher key length, RSA is
    used for signature authentication and not encryption, key
    exchanges occur via hand-shake algorithms ie: diffie-hellman
    and derivatives there of...

    a 128-bit symmetric cipher is actually very strong, for temporary
    transit data ie: purchase data, cc numbers etc.

    Arash Partow
    __________________________________________ ________
    Be one who knows what they don't know,
    Instead of being one who knows not what they don't know,
    Thinking they know everything about all things.
    http://www.partow.net

    --
    Arash Partow's Philosophy: Be a person who knows what they don't know, and not a person who doesn't know.
  14. Sosumi, McCartney! by Chris+Tucker · · Score: 4, Funny

    "When I find myself in times of trouble, PKZ he comes to me.
    Speaking words of wisdom, 'PGP, PGP.'"

    --
    Guaranteed! This comment 100% Anthrax free!
  15. random & pseudorandom pads by cant_get_a_good_nick · · Score: 4, Informative

    Random pads with truly random data is unbreakable. The few times it has been broken has been due to human error (reusing the same random data stream). The US tracked some russian spies with this, they reused pads, and we found out there was a mole in the atomic bomb program.

    That said, paddign with pseudo-random data is very unsafe. Breaking this type of encryption is typically one of the first homework assignments in cryptography courses. The article is either very fuzzy on this distinction, or plain out wrong, depending on how you read it.

  16. Re:Comprehensive list of unsolved codes and cipher by cpeikert · · Score: 4, Informative

    If after reading the intro to encryption you are so inspired to try to crack one, I highly recommend this list...

    The problem with challenges like "crack this uncracked cipher" is that the challenge is not realistic.

    Most of these codes/ciphers give you no idea the process behind how they were generated. That's unrealistic: usually an analyst will have the algorithm that does the encryption (if not the key itself), either via open-source, reverse engineering of a public binary, legitimate purchase, or espionage.

    Most of these challenges only give you a tiny piece of ciphertext. That's not realistic: if you're trying to break, say, SSL, you'll be able to get your hands on megabytes of transcripts, and you'll even be able to generate ciphertexts that correspond to plaintexts of your choice.

    Most of these "ciphers" don't generalize to arbitrary messages. That's unrealistic. Sure, someone can design some ad-hoc cipher to encrypt the location of his buried treasure using landmarks, clever puns, and weird symbols. That's a far cry from being able to efficiently encrypt an arbitrary TCP/IP stream.

  17. SETI noise by 3770 · · Score: 4, Interesting


    If you want to be absolutely definitely sure that no one can intercept your communication with someone then here's what you do.

    1) Get 600MB of random noise data from listening for extra terrestrials from for instance SETI.
    2) Burn two CD's, give one to your friend. Keep the other.
    3) Encrypt your message by superimposing it on that noise at a given location.
    4) send the message as well as the location with the random location that you started copying the noise from (from the CD).

    This message can _not_ be deciphered if you make sure that you never reuse the same random noise. Even if you reuse it it is hard.

    In addition, if you at some point expect that someone is on to you, just burn the two CD's.

    At that point those messages can _never_ be deciphered. Even if you try for a billion years.

    Simple.

    Unbreakable.

    --
    The Internet is full. Go Away!!!
    1. Re:SETI noise by Knight2K · · Score: 4, Insightful

      This scheme is more commonly known as a one-time pad. Basically, you need to generate a set of random data that can be combined with your plain-text. A common implementation used to be pads of onion-skin paper with blocks of random letters on them. Onion-skin was used since it was possible to generate pairs of pads using carbons and also because the paper was easy to destroy. The pads usually had something like the date the pad was to be used on them.

      Often these systems were broken because the pads were misused: the same pad used multiple times, or the same pad used with some variation.

      IIRC, the scheme you are purposing is similar to the way that the red telephone communication between the Soviet Union and the US, as well as embassy communications, was secured. In that case, special vinyl records were distributed that had to be started at the same point. The length of the record determined how long you can talk.

      This essay on Bruce Schneier's site highlights one of the chief weaknesses of the one-time pad: the key distribution problem. You have to figure out how to get your friend's CD to him without being intercepted. You also have to be sure that the computer that generated the CD's wasn't compromised; someone spying on your machine could just log what audio file you used, copy it, and generate their own key CD.

      Considering that a CD can only hold around 700MB (for a standard audio CD), I would say the key space is small enough that even if an attacker doesn't know your position choosing scheme (your description of the system states that the position is part of the message, so I'm being generous here), it should be possible to brute force the message if he somehow gets access to the key.

      Another problem is: you may suspect that you are being watched or the system is compromised, but your buddy may not. How do you communicate that information to your friend, especially if you aren't supposed to be in contact with them in the first place?

      If the attacker has your key CD, he could send an encrypted message stating that you (the legitimate user) are the attacker? Then who would your buddy believe?

      The benefit of public-key cryptography is that it limits the amount of data that needs to be shared in order to communicate. The keys used for encryption never leave the possession of the person doing the encryption. It is also relatively simple to generate new keys.

      Of course, man-in-the-middle attacks can still happen. But if you can establish the first public keys that you and your friend will use in a secure manner (e.g. face-to-face meeting), subsequent public keys can be encrypted using the last trusted key, or by using other key sharing schemes.

      --
      ======
      In X-Windows the client serves YOU!
  18. Re:640 bits should be enough for anybody by lukewarmfusion · · Score: 4, Funny

    "...and my porn passwords are Romeo and Juliet!"

    Well my porn passwords are Juliet and Juliet. It's a lesser known work, to be sure, but it's certainly steamier.

  19. RND number generation and encription cards by saigon_from_europe · · Score: 4, Interesting

    During my army service, I was told about random number generating cards. Basic idea is very simple, use thermal noise in conductors/semiconductors as a starting point for number generation.

    So if you need random numbers for encryption, try some googling, and you will find many variations on this theme - serial port based equpment; noise from sound card (low cost solution - all you need is software). There are also schemes for do-it-yourself equipment.

    Unfortunately, you should be a bit reluctant to accept the idea that all these things work as advertised. Just for beginning, although thermal noise is white noise by default, it get filtered in system during the processing. Its spectrum will not be the same as it was on the origin. (I am not an expert, but I think that spectral characteristics of the signal is not a requrement for randomness, but this is still good example of possible flaw in implementation.)

    If I would start using this, I would test this generators with some mathematical tools.

    Also, there are encription cards. I was able to see one made by Soekris. It has hardware implementation of DES. DES is designed to be done in hardware - shifting and xoring is easy to implement in hardware. Soekris makes 486 and P5 low-consumption small sized boxes. With this card, you may make good and fast IPSec firewall that runs on 133MHz 486 (!). Unfortunately, I am not in touch with this equipment any more, but problem was that Linux driver was in alpha state (situation from 10 months ago). BSD drivers were in release state.

    (One idea came to my dirty mind - how interesting this card might be for crackers?)

    --
    No sig today.