Advertisement
Guest User

Untitled

a guest
Oct 27th, 2016
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 1.09 KB | None | 0 0
  1. #!/usr/bin/perl
  2.  
  3. use strict;
  4. use warnings;
  5. use lib '/var/www/imscp/engine/PerlLib';
  6. use iMSCP::Debug;
  7. use iMSCP::Bootstrapper;
  8. use iMSCP::Crypt qw/ decryptBlowfishCBC encryptBlowfishCBC /;
  9.  
  10. iMSCP::Bootstrapper->getInstance()->boot(
  11.         {
  12.                 nodatabase      => 1,
  13.                 nolock          => 1,
  14.                 config_readonly => 1
  15.         }
  16. );
  17.  
  18. # Decrypt the current password taken from the imscp.conf file and print it on STDOUT
  19. # Note that the password string is a base64 string of the encrypted password (password encrypted in CBC mode using the Blowfish algorithm)
  20. my $plainPassword = decryptBlowfishCBC($main::imscpDBKey, $main::imscpDBiv, $main::imscpConfig{'DATABASE_PASSWORD'});
  21. print "PLAIN PASSWORD IS: $plainPassword\n";
  22.  
  23. # Reencrypt the password
  24. # Note that the password string will be a base64 string of the encrypted password (password encrypted in CBC mode using the Blowfish algorithm)
  25. my $encryptedPassword = encryptBlowfishCBC($main::imscpDBKey, $main::imscpDBiv, $plainPassword);
  26. print "ENCRYPTED PASSWORD IS: $encryptedPassword\n";
  27.  
  28. 1;
  29. __END__
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement