class Drupal_Crypt_Blowfish in Web Service Clients 7
Same name and namespace in other branches
- 6.2 connections/clients_drupal/crypt_blowfish/crypt_blowfish.inc \Drupal_Crypt_Blowfish
- 6 backends/clients_drupal/crypt_blowfish/crypt_blowfish.inc \Drupal_Crypt_Blowfish
- 7.3 connections/clients_drupal/crypt_blowfish/crypt_blowfish.inc \Drupal_Crypt_Blowfish
- 7.2 connections/clients_drupal/crypt_blowfish/crypt_blowfish.inc \Drupal_Crypt_Blowfish
Hierarchy
- class \Drupal_Crypt_Blowfish
Expanded class hierarchy of Drupal_Crypt_Blowfish
File
- backends/
clients_drupal/ crypt_blowfish/ crypt_blowfish.inc, line 12 - Wrapper for PEAR Crypt Blowfish
View source
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;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
Drupal_Crypt_Blowfish:: |
protected static | function | ||
Drupal_Crypt_Blowfish:: |
public static | function | ||
Drupal_Crypt_Blowfish:: |
public static | function | ||
Drupal_Crypt_Blowfish:: |
public static | function |