New Home
Old Home
Site Map
 
Books
Tips & Tricks
Tutorials
Stories
Performance
Essays
Links
Q & A
New in VB6
Free Stuff
Pictures
 
Awards Received
Banners
 
Newsletter
Feedback
Tutorial: Getting Started with Cryptography
This tutorial explains some of the basics of cryptography including some necessary vocabulary.

Index


What's the Point?

The idea is that person A (who we'll call Andy) wants to send some information to person B (Betty) without anyone else (the attacker) understanding it. Sometimes Andy and Betty may be the same person. For example, if you want to encode a file so only you can read it later.

If you had a perfectly secure method for physically carrying the message from person Andy to person Betty, you could just do that and you wouldn't need any code. That's practically how a one-time pad works. One-time pads are described in another tutorial.

Unfortunately this technique is slow and oftan difficult. For example, if you want to transmit instructions for tonight's attack into enemy territory, this is impractical. Even if it was fast enough, the enemy might intercept the message and learn about your plans.

This is where cryptography comes in. Using a good code, you can send the message using radio, postal service, or some other method that may be intercepted. Knowing some secret key, Betty can decode the message. Without knowing the key, an attacker cannot.

The unencoded message text is called the plaintext. The encoded message is called the ciphertext.

Top of page


Key Space

The key space is the set of possible values the key might have. For example, keys might include English words, 5-digit numbers, or strings of binary digits.

The size of the key space is critical. The key must be easy for Betty to remember so she can decode the message but the key space must be big enough that the attacker cannot simply guess the key. With modern computers, it's even more important that the key space be large enough. Using a computer, it's simple for an attacker to guess a few billion random keys and try them all.

To be secure these days, people usually use random-seeming strings of carefully selected binary digits for keys. These strings are typically 128 bits or longer. Not something Betty can easily memorize but something she can keep on a floppy disk that never leaves her posession.

Top of page


Message Format

Usually the letters in a message are written without punctuation, capitalized, and arranged in groups of five letters separated by spaces. For example:
    USUAL LYTHE LETTE RSINA MESSA
    GEARE WRITT ENWIT HOUTP UNCTU
    ATION CAPIT ALIZE DANDA RRANG
    EDING ROUPS OFFIV ELETT ERSSE
    PARAT EDBYS PACES
The encoded message is formatted similarly.

This was useful when people encoded and decoded messages by hand. Placing each character in a square on a sheet of paper made it easier to keep track of the positions of the letters.

Computerized codes make this formatting unnecessary. More complex computerized codes store arbitrary bytes of data that may be letters, punctuation, data, parts of images, or whatever.

The examples in these tutorials generally use this notation for simpler codes that are intended to be implemented by hand.

Top of page


Back to main cryptography tutorial

 
Subscribe to the VB Helper newsletter
Copyright © 1997-2001 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
www.vb-helper.com/crypto1.htm Updated