Advertisement
Guest User

Untitled

a guest
Feb 25th, 2012
591
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. Public Shared Function DecryptTripleDES(ByVal sOut As String, ByVal sKey As String) As String
  2. Dim provider As New TripleDESCryptoServiceProvider
  3. Dim provider2 As New MD5CryptoServiceProvider
  4. sKey = Form1.ScrambleKey(sKey)
  5. provider.Key = provider2.ComputeHash(Encoding.ASCII.GetBytes(sKey))
  6. provider.Mode = CipherMode.ECB
  7. Dim transform As ICryptoTransform = provider.CreateDecryptor
  8. Dim inputBuffer As Byte() = Convert.FromBase64String(sOut)
  9. Return Encoding.ASCII.GetString(transform.TransformFinalBlock(inputBuffer, 0, inputBuffer.Length))
  10. End Function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement