-1
我想了解为什么直接下面的代码不需要你生成一个IV密钥?代码为:Rijndael加密密钥
http://msdn.microsoft.com/en-us/library/sb7w85t6(v=vs.85).aspx
Dim key As RijndaelManaged = Nothing
Try
' Create a new Rijndael key.
key = New RijndaelManaged()
我看到这个样本代码,但需要你manaually产生两个键?
代码为:
http://msdn.microsoft.com/en-us/library/System.Security.Cryptography.RijndaelManaged(v=vs.110).aspx
Class RijndaelExample
Public Shared Sub Main()
Try
Dim original As String = "Here is some data to encrypt!"
' Create a new instance of the RijndaelManaged
' class. This generates a new key and initialization
' vector (IV).
Using myRijndael As New RijndaelManaged()
myRijndael.GenerateKey()
myRijndael.GenerateIV()
我也打算硬编码的钥匙插入源(我知道这是不是最安全的)......实际上,我怎么存储这些..它看起来每次应用程序打开时都会生成一个新的密钥。