Пример #1
0
 public function testDecryptData()
 {
     $crypt = new Crypt($this->secret);
     $encryptedData = $crypt->encrypt($this->plaintext);
     $decryptedData = $crypt->decrypt($encryptedData);
     $this->assertEquals($this->plaintext, $decryptedData);
 }
Пример #2
0
 /**
  * Decrypt the session value.
  *
  * @param mixed $value
  * @return mixed
  */
 protected function decrypt($value)
 {
     if ($this->crypt instanceof Crypt) {
         return $this->crypt->decrypt($value);
     }
     return $value;
 }