Advertisement
Guest User

1

a guest
Jan 27th, 2011
323
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  Public Function Cryptage(ByVal donnees As String) As String
  2.  
  3.         Dim sha1 As New SHA1Managed
  4.         Convert.ToBase64String(sha1.ComputeHash(Encoding.ASCII.GetBytes(donnees)))
  5.         Dim donneeCryptees() As Byte = ASCIIEncoding.ASCII.GetBytes(donnees)
  6.         Dim cryptageEnString As String = Convert.ToBase64String(donneeCryptees)
  7.         Return cryptageEnString
  8.  
  9.     End Function
  10.     Public Function Decryptage(ByVal Data As String) As String
  11.  
  12.         Dim donneeDecryptees() As Byte = Convert.FromBase64String(Data)
  13.         Dim decryptageEnString As String = ASCIIEncoding.ASCII.GetString(donneeDecryptees)
  14.         Return decryptageEnString
  15.  
  16.     End Function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement