Use the crypt() operator to store passwords in an unbreakable format : crypt « String « Perl






Use the crypt() operator to store passwords in an unbreakable format

      
#!/usr/bin/perl
use warnings;
use strict;
my $passwd = "password";
my $salt = join '',('.', '/', 0..9, 'A'..'Z', 'a'..'z')[rand 64, rand 64];
$passwd = crypt($passwd, $salt);

   
    
    
    
    
    
  








Related examples in the same category

1.crypt a string
2.The crypt function encrypts a string using the NBS Data Encryption Standard (DES) algorithm.