Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options

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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1003597]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (7)
As of 2018-06-22 02:50 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (121 votes). Check out past polls.