EncryptText函数加密的字符串可以用函数DecryptText解密,解密和加密的密钥必须相同。这一句话怎么理解。
如果要实现:
加密后的文件。直接用ReadAllText调入并赋值到变量中,并使用事前“文件加密的密钥”进行解密还原,这一块怎么操作?
Dim Val1 As String = FileSys.ReadAllTExt("c:\data\abc.txt")
Dim Val2 As String = DecryptText(Val1,"密匙1","密匙2")
这一段代码该如何修改
EncryptFile("c:\11.txt", "c:\22.txt", "fox123")
Dim Val1 As String = FileSys.ReadAllTExt("c:\22.txt")
Dim Val2 As String = DecryptText(Val1,"fox123") ' 无密钥2
Output.Show("解密后:" & val2)
[此贴子已经被作者于2011-2-17 13:50:40编辑过]
加密:
Dim Val1 As String = FileSys.ReadAllTExt("c:\123.txt")
Dim Val2 As String = EncryptText(Val1,"密匙1","密匙2")
Filsys.WriteAllText("c:\123.txt",val2)
解密:
Dim Val1 As String = FileSys.ReadAllTExt("c:\123.txt")
Dim Val2 As String = DecryptText(Val1,"密匙1","密匙2")
Filsys.WriteAllText("c:\123.txt",val2)
[此贴子已经被作者于2011-2-17 14:34:58编辑过]