This zip file contains password.txt, password.obj and demopass.prg.
Do not distribute without all three files.  Released for any use
without restriction.

For a demonstration of the passw() function, compile demopass.prg with
Clipper and link with password.obj,  i.e.  if you use the
Tlink linker it would be Tlink demopass password,,,clipper

There are a lot of password functions that will save your password to either
a database or memory variable and then test operator input against the saved
password.  The trouble is, someone with even a modest knowledge of computers
will be able to look at the database or inspect the memory variable to see
the contents and find the password. After all, how hard is it to tell the
computer "Type xxxx.mem", or "Type xxx.dbf"?  Passw() takes the character
string entered by the operator and returns an encrypted string in a memory
variable called mc_pass which is saved to constant.mem.  Passw() also will test
a character string against the saved password by decrypting the string and
comparing to what was entered.  If the password doesn't match, .f. is returned
by the function.  The encryption/decryption takes place entirely within
the function.

Syntax:  passw(1 [2])
Passw(1) checks a password while passw(2) encrypts a new password.  Passw(1)
echos dots to the screen so no one can see the password being entered.  
Passw(2) echoes the actual characters to the screen so the operator can see
what is being entered.  Passw(2) encrypts the entry and saves it in a memory
variable.  Your program could test the operator for knowledge of a current
correct password before allowing a new password to be encrypted.  Look at
demopass.prg for an example of how to call the function.

How encryption is done:
The function take a character string and for each character takes the number
for that character (ASCII), adds 101 to that number, and then adds the character
place of the number.  The resulting number is converted back to a character
and saved.  The character will usually be a graphic character and there will
be no direct corellation between the original character and the encrypted
character since the place in the character string partially determines how
the character will be encrypted.  In other words, the character "A" may be
"" in one place but "" in another place.  This would make it very hard, if
not impossible, to figure out the "code" that would decrypt a password.
The word "PASS" is saved as "" and as you can see, the double S gives no
clue, once it is encrypted, that there is a double character.

Thanks to Richard Low for this encryption scheme.  I don't know if he 
originated the idea, but he uses it in his RLIB library.

If you would like the source code for passw(), let me know on the BOSS or
ExecPC and I will get it to you.
		-Steve Covell

