Mega Code Archive

 
Categories / Perl / String
 

Check password

$encrypted = "AB/uOsC7P93EI"; $salt = substr($encrypted, 0, 2); print "Guess the word: "; while(<>) {     chomp;     if ($encrypted eq (crypt $_, $salt)) {         print "You got it!";         exit;     } else {         print "Nope.\n";         print "Guess the word: ";     } }