Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: UNIX user authentication

by trantor (Chaplain)
on Oct 31, 2001 at 19:33 UTC ( #122353=note: print w/replies, xml ) Need Help??


in reply to UNIX user authentication

If I understood your question well, you simply read the encrypted password back and use the first two characters as the salt for encrypting the password you've just read.

Then you compare them, if they match, the password is correct. Bummer otherwise.

Warning: the salt is there because it gives 4096 different ways to encrypt the same password, so it makes it lengthy to try a dictionary attack with pre-encrypted passwords. If (as it in your case) the salt is easily predictable, somebody might find it easier to try a dictionary attack on your encrypted password, for exampl. This of course if they know how you generate salts and if tehy manage to access your encrypted data.

As a rule of thumb, it's much better to generate it from random numbers.

Have a look at this thread, or try a Super Search for more information.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://122353]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (4)
As of 2023-11-30 06:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?