crypt_blowfish.inc in Web Service Clients 6
Same filename and directory in other branches
Wrapper for PEAR Crypt Blowfish
@author Django Beatty - adub
File
backends/clients_drupal/crypt_blowfish/crypt_blowfish.incView source
<?php
/**
* @file
* Wrapper for PEAR Crypt Blowfish
*
* @author Django Beatty - adub
*/
/**
*
*/
class Drupal_Crypt_Blowfish {
/**
*
*/
public static function decrypt($encrypted) {
$bf = self::blowfish();
return trim($bf
->decrypt($encrypted));
// that was fun to debug
}
/**
*
*/
public static function encrypt($plaintext) {
$bf = self::blowfish();
return $bf
->encrypt($plaintext);
}
/**
*
*/
protected static function blowfish() {
ini_set('include_path', ini_get('include_path') . ':' . variable_get('crypt_blowfish_cryptdir', ''));
include_once 'Crypt/Blowfish.php';
return new Crypt_Blowfish(self::getkey());
}
/**
*
*/
public static function getkey() {
$filename = drupal_get_path('module', 'crypt_blowfish') . '/crypt_blowfish_key.inc';
$handle = fopen($filename, "r");
$key = fread($handle, filesize($filename));
fclose($handle);
return $key;
}
}
Classes
Name | Description |
---|---|
Drupal_Crypt_Blowfish |