05-10-17, 12:20 AM
TripleDESCryptoServiceProvider
PHP كود :
Friend Shared Function TripleDESEncryptTo46StringBase(ByVal [text] As String) As String
Dim buffer As Byte()
Dim buffer2 As Byte()
Dim buffer3 As Byte()
Dim stream As IO.MemoryStream
Dim provider As Security.Cryptography.TripleDESCryptoServiceProvider
Dim stream2 As Security.Cryptography.CryptoStream
Dim str As String
buffer = System.Text.Encoding.UTF8.GetBytes([text])
buffer2 = System.Text.Encoding.UTF8.GetBytes("SmartSolutions_AhmedSaid")
buffer3 = System.Text.Encoding.UTF8.GetBytes("Abu_Said")
stream = New IO.MemoryStream
provider = New Security.Cryptography.TripleDESCryptoServiceProvider
stream2 = New Security.Cryptography.CryptoStream(stream, provider.CreateEncryptor(buffer2, buffer3), 1)
stream2.Write(buffer, 0, CInt(buffer.Length))
stream2.FlushFinalBlock()
str = Convert.ToBase64String(stream.ToArray)
Label_0070:
Return str
End Function
