#### Archived

This topic is now archived and is closed to further replies.

This topic is 5402 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hi guys, Is there a general tutorial on making passwords ? I guess it would fall under encryption ? I have a Windows program and want the user to be able to save a password for something he locks, but the thing I don''t understand is how to save the password itself. That must be encrypted and then the user types the password and I see if it matches ? But then is someone knows how the passwords are encoded he can crack them all. I don''t get it. I made a cool way to encrypt the ''sensitive'' data but I don''t understand how the password to un-encrypt it works. Any practical tutorial links would be appreciated.

##### Share on other sites
"But then is someone knows how the passwords are encoded he can crack them all. I don''t get it."

sorry i don''t have any links for u, but i think the encryption scheme for most password systems uses a one-way encryption technique. ie, you can encrypt but can''t decrypt.

##### Share on other sites
You don''t want to encrypt the password, because encryption is two way and can be undone as you guessed. The proper term for what you want is ''hashing'', which turns some input (a password) into an apparently random output (the hash), and is not reversable. A common hashing algorithm is MD5.

##### Share on other sites
You can also encrypt a piece of known text (such as the username), using the password as the key.

##### Share on other sites
Basically you can see the mechanism for how the entered password is used to treat the data, and how the encryption works. However without the value it doesn''t help. Imagine you have a number as a passcode, and the program decrypts the data using:
x=passcode
decrypt with sin(tan(x))^log(x)....
Then despite knowing the method, unless you can solve that equation you''re stuck. Often, large factorisations are used ie find a non-prime factor of 123478348723918798765745 - you even know what you need to get but finding it takes a LONG time!!

##### Share on other sites
You could look into md5 hashing. http://userpages.umbc.edu/~mabzug1/cs/md5/md5.html has a few different implementations in different languages.

##### Share on other sites
Standard practice for storing passwords is to store a one-way hash of the password string pre-pended with a salt string. Salts are used to prevent dictionary attacks against the password database. Usually hashing algorithms used are MD4, MD5 and SHA. Though MD4 seems to be falling out of favor in recent years. On most search engines the keywords "password salt hash" are sufficient to get you sample code examples for storing passwords in a database.

1. 1
2. 2
3. 3
Rutin
13
4. 4
5. 5

• 26
• 11
• 9
• 9
• 11
• ### Forum Statistics

• Total Topics
633697
• Total Posts
3013405
×

## Important Information

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!