Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

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]
Discipulus bad people + good tool < normal people + decent tool
[Discipulus]: php does not suck anymore?
[ambrus]: Discipulus: I'm not sure, but it certainly doesn't suck as much as it's used to. it's like C++, it sucks because people still recursively learn from twenty year old PHP examples,
[ambrus]: and they try to use the obsolete features that PHP has to support only for compatibility with old scripts. C++ and PHP both have the problem that people can't forget the past, because when they google "PHP" plus the problme they want to solve, they find b
[ambrus]: ad code examples.
[ambrus]: I'm not trying to recommend PHP, but I think it has way too bad a name because of its past.
[ambrus]: This is different from MS Word, which was already a good editor in the pre-unicode days (in word for windows versions 2 and 6, which ran on windows 3 but also on windows 95), only it wasn't trying to solve the task of writing maths papers back then.
[Discipulus]: ah ok, sounds reasonable; with no fear: Perl all life long
[ambrus]: Mind you, LaTeX is currently still useful for writing math paper or snippet content without styling in such a way that the
[ambrus]: formatting conventions of a journal or website can be quickly applied to it, and MS Office and LibreOffice has not quite solved this (although it's better for this than it used to be),

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (11)
As of 2017-09-26 11:10 GMT
Find Nodes?
    Voting Booth?
    During the recent solar eclipse, I:

    Results (293 votes). Check out past polls.