encryption - How do I generate an encrypted password string, as it is in /etc/shadow? -



encryption - How do I generate an encrypted password string, as it is in /etc/shadow? -

i'm trying mimic creation of password strings appear in /etc/shadow.

this i've got far, encrypted passwords don't match, when utilize same password , same salt.

5000 rounds standard crypt, used well, don't see exacly made mistake:

i'm doing in perl, relevant porion:

($pass, $salt) = @argv; unless(defined($salt)) { $salt = mime::base64::encode(random_bytes(12), ''); } $i (1 .. 4999) { $pass = digest::sha::sha512($salt, $pass); } ""; print '$6$', $salt, '$', digest::sha::sha512_base64($salt, $pass), "\$\n";

the crypt algorithm involves a lot more re-hashing 5,000 times:

unix crypt using sha-256 , sha-512

encryption passwd sha512

Comments

Popular posts from this blog

java - How to set log4j.defaultInitOverride property to false in jboss server 6 -

c - GStreamer 1.0 1.4.5 RTSP Example Server sends 503 Service unavailable -

Using ajax with sonata admin list view pagination -