I am trying to encrypt text to a textfile(.txt) and then decrypt it in a diff. program.
The encrypting part works fine.
I have tried these functions with a textbox's text and they work perfectly, Now I get errors when trying to decrypt from the .txt file...
n was unhandled
Message="Conversion from string "mscorlib" to type 'Integer' is not valid." &
Message="Input string was not in a correct format."
Thanks for the help...
Private DES As New TripleDESCryptoServiceProvider
Private MD5 As New MD5CryptoServiceProvider
Private Function Decrypt(ByVal encryptedString As String) As String
DES.Mode = CipherMode.ECB
Dim Buffer As Byte() = Convert.FromBase64String(encryptedString)
Return ASCIIEncoding.ASCII.GetString(DES.CreateDecryptor().TransformFinalBlock(Buffer, 0, Buffer.Length))
Dim adCommands As String() = System.IO.File.ReadAllLines(<path>)
If adCommands.Count > 0 Then
For Each command As String In adCommands
MsgBox(command) 'this show the encryption
command = Decrypt(command) 'this throws the error