You are here

private function Bakery::decrypt in Bakery Single Sign-On System 7.3

Decrypt text.

Parameters

string $data Serialized plain text to encrypt.:

Return value

string Decrypted text.

1 call to Bakery::decrypt()
Bakery::validateData in ./bakery.inc
Validate and decrypt baked data.

File

./bakery.inc, line 292

Class

Bakery

Code

private function decrypt($data) {
  $key = $this->key;
  $td = mcrypt_module_open('rijndael-128', '', 'ecb', '');
  $iv = mcrypt_create_iv(mcrypt_enc_get_iv_size($td), MCRYPT_RAND);
  $key = substr($key, 0, mcrypt_enc_get_key_size($td));
  mcrypt_generic_init($td, $key, $iv);
  $text = mdecrypt_generic($td, $data);
  mcrypt_generic_deinit($td);
  mcrypt_module_close($td);
  return $text;
}