问题描述
据我所知,Laravel中的应用程序密钥可为会话和敏感数据提供保护,但是我想了解的是它到底是如何工作的?目的是什么?我找不到有关它的任何信息.预先感谢!
From what I know, the app key in Laravel provides protection for session and sensitive data, but what I want to understand is how exactly it works? What is the purpouse of it?I couldn't find any information about it.Thanks in advance!
推荐答案
APP_KEY用于加密,而不用于散列.您在应用程序中加密的每个数据都在后台使用APP_KEY.请记住,加密数据可以解密,但散列数据不能解密.
APP_KEY is used for encryption and not hashing. Every Data you encrypt in your application is using APP_KEY behind the scene. Do remember that encrypted data can be decrypted but hashed data cannot be decrypted.
一个常见的对APP_KEY的误解是它与密码哈希相关,事实并非如此.这是证明.
A common misconception of APP_KEY is that it is related to Password hashing, the truth is it's not. and here is the proof.
您可以在上面的推文中看到APP_KEY与 HASHED 数据无关
You can see in the above tweet that APP_KEY has nothing to do with HASHED data
这篇关于Laravel的应用程序密钥-它是什么以及它如何工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!