Laravel - DecryptException: 'The MAC is invalid'

后端 未结 6 1373
轮回少年
轮回少年 2020-12-02 00:21

In laravel for registration I\'m using encrypt algorithm for password instead of inbuilt bcrypt function in Laravel because to get password and send it to mail when password

6条回答
  •  不知归路
    2020-12-02 00:33

    The problem is you generated a new APP_KEY, then if you try to decrypt the old encrypted data it will show the DecryptException: The MAC is invalid.

    If you want to decrypt the old data you need to restore your old APP_KEY.

    After realizing that, now, adding a new problem there, if you stored new data with another APP_KEY or another encryption method you have a problem on the data because they are mixed on the table.

    In case you don't know when do you started with the new encrypt method or differentiate the new encrypted entries, the fastest solution would be reset all the passwords with the new encrypt method.

    You can learn more about how Laravel encryption works on the official Laravel docs.

提交回复
热议问题