We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a4aa274 commit c8993c9Copy full SHA for c8993c9
tests/Unit/EncrypterTest.php
@@ -27,6 +27,19 @@ public function test_value_encrypted_with_old_key_can_be_decrypted()
27
$this->assertEquals('test', $decrypted);
28
}
29
30
+ public function test_value_encrypted_with_old_base64_key_can_be_decrypted()
31
+ {
32
+ $key = Str::random(32);
33
+ $this->app['config']->set('identities.old_key', 'base64:'.base64_encode($key));
34
+ $encrypter = new Encrypter($key, 'AES-256-CBC');
35
+
36
+ $encryptedWithOldKey = $encrypter->encrypt('test');
37
38
+ $decrypted = IdentityCrypt::decrypt($encryptedWithOldKey);
39
40
+ $this->assertEquals('test', $decrypted);
41
+ }
42
43
public function test_value_can_be_encrypted()
44
{
45
$encrypted = IdentityCrypt::encrypt('test');
0 commit comments