hello dears
iam Kero ,
iam begginer at vb.net coding and i need your help to reset this code
i get this code from program made by vb.net and i get the code using
code reflector 9.0 and iam using vb express 2008
any one can help me how to use this code
and how to get use of it
thanks and best regards
Kero
;
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 MemoryStream
Dim provider As TripleDESCryptoServiceProvider
Dim stream2 As CryptoStream
Dim str As String
buffer = Encoding.UTF8.GetBytes([text])
buffer2 = Encoding.UTF8.GetBytes("SmartSolutions_AhmedSaid")
buffer3 = Encoding.UTF8.GetBytes("Abu_Said")
stream = New MemoryStream
provider = New TripleDESCryptoServiceProvider
stream2 = New 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
What I have tried:
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 MemoryStream
Dim provider As TripleDESCryptoServiceProvider
Dim stream2 As CryptoStream
Dim str As String
buffer = Encoding.UTF8.GetBytes([text])
buffer2 = Encoding.UTF8.GetBytes("SmartSolutions_AhmedSaid")
buffer3 = Encoding.UTF8.GetBytes("Abu_Said")
stream = New MemoryStream
provider = New TripleDESCryptoServiceProvider
stream2 = New 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