/** * Get the encrypted session value. * * @param mixed $value * @return mixed */ protected function encrypt($value) { if ($this->crypt instanceof Crypt) { return $this->crypt->encrypt($value); } return $value; }
public function testDecryptData() { $crypt = new Crypt($this->secret); $encryptedData = $crypt->encrypt($this->plaintext); $decryptedData = $crypt->decrypt($encryptedData); $this->assertEquals($this->plaintext, $decryptedData); }