Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

crypt() and salt question.

Status
Not open for further replies.

mbaranski

Programmer
Nov 3, 2000
421
US
I'm trying to write a verification program for a web page, and it'll use crypt for a password. Do I have to save the salt that people use, or is there a way to get it from the password that they enter? Or, is it acceptable to use their password as the salt? I could use a little advice here...

Disclaimer:
Beware: Studies have shown that research causes cancer in lab rats.
 
The salt is actually saved as part of the encrypted password (the first two characters if you use a two character salt). To check a password against the encrypted password, just use the encrypted password as the salt for encrypting the plain-text password.
Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top