Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
根据微软关于 System.Security.Cryptography.Aes 的文档KeySize,可以通过设置属性来简单地更改密钥大小。
KeySize
更改密钥大小是否会自动生成新密钥大小的新随机密钥?文档不清楚。
是或否,视情况而定。
设置KeySize使对象忘记密钥。如果通过设置提供了Key新密钥,则技术上不会生成新密钥。但是当对象没有键但需要一个时,KeySize会创建并记住一个新键(大小为 )。
Key
通常,您应该设置KeySize(随机设置)或Key(调整KeySizeValue),而不是同时设置。
KeySizeValue