Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/perl
- use strict;
- use warnings;
- use lib '/var/www/imscp/engine/PerlLib';
- use iMSCP::Debug;
- use iMSCP::Bootstrapper;
- use iMSCP::Crypt qw/ decryptBlowfishCBC encryptBlowfishCBC /;
- iMSCP::Bootstrapper->getInstance()->boot(
- {
- nodatabase => 1,
- nolock => 1,
- config_readonly => 1
- }
- );
- # Decrypt the current password taken from the imscp.conf file and print it on STDOUT
- # Note that the password string is a base64 string of the encrypted password (password encrypted in CBC mode using the Blowfish algorithm)
- my $plainPassword = decryptBlowfishCBC($main::imscpDBKey, $main::imscpDBiv, $main::imscpConfig{'DATABASE_PASSWORD'});
- print "PLAIN PASSWORD IS: $plainPassword\n";
- # Reencrypt the password
- # Note that the password string will be a base64 string of the encrypted password (password encrypted in CBC mode using the Blowfish algorithm)
- my $encryptedPassword = encryptBlowfishCBC($main::imscpDBKey, $main::imscpDBiv, $plainPassword);
- print "ENCRYPTED PASSWORD IS: $encryptedPassword\n";
- 1;
- __END__
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement