Dim myDESProvider As DESCryptoServiceProvider = New DESCryptoServiceProvider()
myDESProvider.Key = ASCIIEncoding.ASCII.GetBytes(Me.KeyPass)
myDESProvider.IV = ASCIIEncoding.ASCII.GetBytes(Me.KeyPass)
Dim DecryptedFile As FileStream = New FileStream("c:\scib\data.txt", FileMode.Open, FileAccess.Read)
Dim myICryptoTransform As ICryptoTransform = myDESProvider.CreateDecryptor(myDESProvider.Key, myDESProvider.IV)
Dim myCryptoStream As CryptoStream = New CryptoStream(DecryptedFile, myICryptoTransform, CryptoStreamMode.Read)
Dim myDecStreamReader As New StreamReader(myCryptoStream, System.Text.Encoding.Default)
Dim myDecStreamWriter As New StreamWriter("c:\scib\ok.txt", False, System.Text.Encoding.Default)
myDecStreamWriter.Write(myDecStreamReader.ReadToEnd())
myCryptoStream.Close()
myDecStreamReader.Close()
myDecStreamWriter.Close()