Ejemplo n.º 1
0
 public static function encodePassword($password, $key)
 {
     $cipher = new Security_Cipher(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_CFB);
     $key = self::encodeKey($key);
     $pwd = $cipher->encrypt($password, $key);
     $iv = $cipher->getIV();
     return array($pwd, $iv);
 }
Ejemplo n.º 2
0
 public static function encodeString($str)
 {
     $cipher = new Security_Cipher(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_CFB);
     $key = self::encodeKey();
     $str = $cipher->encrypt($str, $key);
     $iv = $cipher->getIV();
     return array($str, $iv);
 }