gpt4 book ai didi

encryption - 为什么 golang 加密示例不使用随机 IV?

转载 作者:数据小太阳 更新时间:2023-10-29 03:16:33 26 4
gpt4 key购买 nike

<分区>

根据 CWE-329,非随机 IV 允许字典攻击的可能性。然而,in the AES crypto example ,golang 文档使用非随机 IV:

ciphertext := make([]byte, aes.BlockSize+len(plaintext))
iv := ciphertext[:aes.BlockSize]

此实现是否安全,或者我应该使用随机函数来获取我的 IV?

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