Guest User

Untitled

a guest
Jan 21st, 2018
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. Imports System.Security.Cryptography
  2.  
  3. Shared Function Encode(ByVal value As String, _
  4. ByVal key As String) As String
  5. Dim mac3des As New System.Security.Cryptography.MACTripleDES()
  6. Dim md5 As New System.Security.Cryptography.MD5CryptoServiceProvider()
  7. mac3des.Key = md5.ComputeHash(System.Text.Encoding.UTF8.GetBytes(key))
  8. Return Convert.ToBase64String( _
  9. System.Text.Encoding.UTF8.GetBytes(value)) & "-"c & _
  10. Convert.ToBase64String(mac3des.ComputeHash( _
  11. System.Text.Encoding.UTF8.GetBytes(value)))
  12. End Function
Add Comment
Please, Sign In to add comment