sri0529 has asked for the wisdom of the Perl Monks concerning the following question:
use strict; use warnings; my $pw = '6yJi'; my $salt = 'uppu'; my $encpw = crypt $pw, $salt; print $encpw. "\n"; print "Your password: " ; chomp (my $readpw = <STDIN>); if($encpw eq crypt ($readpw, $encpw)) { ================> even if $enc +pw is replaced with $salt it works, both work. print "Password OK\n"; }else { print "Password NOT OK\n"; }
Question: Original crypt used salt value: "uppu" During password comparision: using originally encripted password, instead of same salt "uppu". This program works either way, negating the use of salt to make it unique. How is this working. Pls clarify.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: understand crypt
by holli (Abbot) on May 29, 2019 at 22:51 UTC | |
|
Re: understand crypt
by LanX (Saint) on May 29, 2019 at 22:26 UTC | |
|
Re: understand crypt
by afoken (Chancellor) on May 31, 2019 at 14:50 UTC | |
by holli (Abbot) on May 31, 2019 at 15:13 UTC | |
by Your Mother (Archbishop) on May 31, 2019 at 20:42 UTC |