Encoding Passwords

Miscellaneous Forums/General Discussion/Encoding Passwords

How to encode passwords? you need a password to decode the password!!?!? so how do you hide the damn things?

You've just got to scramble it up however you feel fit...

for example, a very very simplisic way would be something like
password$ = "aardvark"
scramble$ = ""

For n=1 To Len(password)
scramble = scramble + Chr(Asc(Mid(password,n,1))+1)
Next

Print scramble
WaitKey
Of couse you just need to do more than that but basically that's the concept.

One thing you could do is use the username as the key for the password, that way it's encoded differently for each user.

This might help: http://www.cs.usask.ca/resources/tutorials/csconcepts/1999_3/lessons/L3/SimpleEncryption.html

thanks, the passwords are very obscure 256 character strings, one of these methods will be fine.

A common and secure approach to stored passwords is to use "one-way string encryption (hashing)" e.g. C's crypt(). Store the crypt()ed passwords, then compare the cyrpt()ed input. Since the algorithm is one-way, it's impossible (well, mostly difficult) to determine passwords even the file containing the crypt()ed passwords is stolen. The drawback is that you cannot retrieve a "lost" password, you can only reset it.

Yeah. Use irreversable encryption, like SHA - there's an implementation in the code archivece - to generate a hash value (possibly salted, depends on what degree of security you want). Then instead of comparing passwords, compare hash values.

Hashing algorithms are designed in such a way that hash collision are unlikely to occur, and that a small change in the input, gives a large change in the output.

Since the algorithm is one-way, it's impossible (well, mostly difficult) to determine passwords even the file containing the crypt()ed passwords is stolen.
In fact the only effective attack against hashed passwords is a bruteforce attack.

Thanks guys, hashes it looks like it's going to be then.