#APP_KEY decryption problem

2 messages · Page 1 of 1 (latest)

vital condor
#

I have been encrypting and decrypting a file but I accidentally wrote over my APP_KEY and I can't get it back. I regenerated it and then tried encrypting and decrypting again but the decryption does not work. It has also affected another project (I haven't tried the rest). The error I get is:

 Illuminate\Contracts\Encryption\DecryptException 

  The payload is invalid.

  at vendor/laravel/framework/src/Illuminate/Encryption/Encrypter.php:214
    210▕         // If the payload is not valid JSON or does not have the proper keys set we will
    211▕         // assume it is invalid and bail out of the routine since we will not be able
    212▕         // to decrypt the given value. We'll also check the MAC for this encryption.
    213▕         if (! $this->validPayload($payload)) {
  ➜ 214▕             throw new DecryptException('The payload is invalid.');
    215▕         }
    216▕ 
    217▕         if (! self::$supportedCiphers[strtolower($this->cipher)]['aead'] && ! $this->validMac($payload)) {
    218▕             throw new DecryptException('The MAC is invalid.');

Can anyone help me fix this? Thanks.

tight vapor
#

You can't decrypt previously encrypted content with a different app key. Though, the error you're seeing indicates the string you're trying to decrypt is not a valid encrypted string