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.
In reply to understand crypt by sri0529
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |