/** * @requires extension libsodium * @expectedException scrothers\laravelsodium\Exceptions\DecryptionException * @expectedExceptionMessage The key provided cannot decrypt the message */ public function testSodiumEncryptionFail() { $encrypted = SodiumLibrary::encrypt('foo', str_repeat('a', 16)); SodiumLibrary::decrypt($encrypted, str_repeat('b', 16)); }
/** * Decrypt the given value. * * @param string $payload * * @return string */ public function decrypt($payload) { return SodiumLibrary::decrypt($payload, $this->key); }