These are three functions which make password routiens and file encryption
much easier.

CHRTRAN

This is a Qbasic/QuickBasic Function which transposes characters.
It is excellent for doing simple encryption for passwords or anything.
Here's how it works:

STRING1 is the string you want to encode/decode

STRING2 is a search string.  It is defined by you and should contain all
        the keyboard characters that a user might type (AlphaNumeric, !, @, #,
        etc.)

STRING3 is the encryption string.  It should contain the characters a user
        will never type (the extended ascii set - ,,, etc.)

CHRTRAN Takes each character of String1, finds its position in String2, and
        exchanges it for the character in the same position in String3

Syntax:

CHRTRAN$(STRING1$, STRING2$, STRING3$)

KEYFILE

This function is much better for file encryption or high security password
routiens.  It generates a random key file which it then uses with the
CHRTRAN function.  The key file is different every time (and with 128
characters in the string there are 128! (128 factorial) possible), making
the encrypted document close to impossible to crack.  The key file is saved
to a random access text file (eliminating those annoying quotes) so it can 
be used with the CHRTRAN function to decode the document.
Here's how it words:

FILE$ = The name of the file to save the encryption key to

STRING1$ = The text to be encoded

STRING2$ = The search string.  This should include all possible letters
           that the user might enter in the test string (String2$)

KEYFILE$ Takes each character in STRING1$, finds it in STRING2$, and replaces
         it with the corresponding character in the randomly generated Key.

Syntax:

KEYFILE$(FILE$, STRING1$, STRING2$)

KEYWORD

Keyword uses a keyword (like a password) to encode/decode a string.  
It's hard to explain so I'll show you an example using the keyword KEY:

ORIGINAL MESSAGE:          ENCRYPTION

MESSAGE:                   E   N   C   R   Y   P   T   I   O   N
ASCII CODES:               69  78  67  82  89  80  84  73  79  78
ENCRYPTION STRING:         K   E   Y   K   E   Y   K   E   Y   K
ASCII CODES:               75  69  89  75  69  89  75  69  89  75
ADD ASCII CODES:           144 147 156 157 158 169 159 142 168 153
TRANSLATE TO CHARACTERS:                              

ENCRYPTED MESSAGE:         

Note:  If the combine ASCII codes add up to more than 254 (which they
       never should) the function will automatically wrap the number
       around to the beginning of the ASCII character set beginning with
       # 32.

WORD$ = The key word (should be user defined)

STRING1$ = The message to be encrypted/decrypted

FUNC = a "1" if you want to encrypt, a "2" if you want to decrypt

Syntax:

KEYWORD$(WORD$, STRING1$, FUNC)
