Posted on: 10/5/2012 12:41:09 AM | Views : 272

The following code is meant to decrypt a file and save it as another file. Rather than saving it to a new file, how can I simply assign its contents to a string variable strUnencryptedContents?
'''<summary> ''' Steve Lydford - 12/05/2008. ''' ''' Decrypts a file using Rijndael algorithm. '''</summary> '''<param name="inputFile"></param> '''<param name="outputFile"></param> Public Sub DecryptFile(ByVal inputFile As String, ByVal outputFile As String) Dim password As String = "myKey123" Dim UE As UnicodeEncoding = New UnicodeEncoding Dim key() As Byte = UE.GetBytes(password) Dim fsCrypt As FileStream = New FileStream(inputFile, FileMode.Open) Dim RMCrypto As RijndaelManaged = New RijndaelManaged Dim cs As CryptoStream = New CryptoStream(fsCrypt, RMCrypto.CreateDecryptor(key, key), CryptoStreamMode.Read) D ...

Go to the complete details ...