gpt4 book ai didi

codeigniter - CodeIgniter中的加密 key

转载 作者:行者123 更新时间:2023-12-04 04:43:17 25 4
gpt4 key购买 nike

如果要使用Session类,则CodeIgniter 2.0.2需要在配置文件中设置加密 key ,即$config['encryption_key']。可以是任何字符串吗?安全的crypto_key的任何示例吗?

谢谢。

最佳答案

The key should be as random as possible and it must not be a regular text string, nor the output of a hashing function, etc.



要将 key 保存到 application/config/config.php ,请打开文件并进行以下设置:
$config['encryption_key'] = 'yourKeyHere'

Random Key Generator

It's important for you to know that the encoded messages the encryption function generates will be approximately 2.6 times longer than the original message. For example, if you encrypt the string "my super secret data", which is 21 characters in length, you'll end up with an encoded string that is roughly 55 characters (we say "roughly" because the encoded string length increments in 64 bit clusters, so it's not exactly linear). Keep this information in mind when selecting your data storage mechanism. Cookies, for example, can only hold 4K of information.

关于codeigniter - CodeIgniter中的加密 key ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6173769/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com