Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: [SOLVED]- FOUND OTHER DOCUMENTATION Encrypting a password to MD5

by zentara (Archbishop)
on Nov 13, 2012 at 12:16 UTC ( #1003597=note: print w/ replies, xml ) Need Help??


in reply to [SOLVED]- FOUND OTHER DOCUMENTATION Encrypting a password to MD5

Is your problem solved? You never did show the code that solved your problem. If not, see encryption confusion, you need to get the salt values, on linux it is in /etc/shadow.

This super simple example shows the basics:

#!/usr/bin/perl use warnings; use strict; print "Standard crypt output\n"; print crypt("password","sa"), "\n"; #glibc's implementation that takes care of this. Since perl on # Linux uses glibc, you get this automagically. When the salt looks li +ke # $1$...., it will encrypt the password using MD5. e.g. print "MD5 crypt output\n"; print crypt("password","\$1the_salt\$"), "\n"; print "SHA crypt output\n"; print crypt("password","\$2the_salt\$"), "\n";

I'm not really a human, but I play one on earth.
Old Perl Programmer Haiku ................... flash japh


Comment on Re: [SOLVED]- FOUND OTHER DOCUMENTATION Encrypting a password to MD5
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (7)
As of 2014-09-15 02:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite cookbook is:










    Results (145 votes), past polls