iarmin

ISPCP omega, database password decrypt

Aug 25th, 2011
731
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.96 KB | None | 0 0
  1. <?php
  2.  
  3. function decrypt_db_password ($db_pass, $ispcp_db_pass_key, $ispcp_db_pass_iv) {
  4.         if ($db_pass == '')
  5.                 return '';
  6.  
  7.         $i = 1;
  8.         if (extension_loaded('mcrypt') || @dl('mcrypt.' . PHP_SHLIB_SUFFIX)) {
  9.                 $text = @base64_decode($db_pass . "\n");
  10.                 // Open the cipher
  11.                 $td = @mcrypt_module_open ('blowfish', '', 'cbc', '');
  12.                 // Create key
  13.                 $key = $ispcp_db_pass_key;
  14.                 // Create the IV and determine the keysize length
  15.                 $iv = $ispcp_db_pass_iv;
  16.  
  17.                 // Intialize encryption
  18.                 @mcrypt_generic_init ($td, $key, $iv);
  19.                 // Decrypt encrypted string
  20.                 $decrypted = @mdecrypt_generic ($td, $text);
  21.                 @mcrypt_module_close ($td);
  22.  
  23.                 // Show string
  24.                 return trim($decrypted);
  25.         } else {
  26.                 die();
  27.         }  
  28. }
Advertisement
Add Comment
Please, Sign In to add comment