How to implement RC2 algorithm in VB.NET?
How to implement RC2 algorithm in VB.NET?please provide the sample code in VB.NET
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Posted May 20, 2011, 1:51 AM
Posted May 20, 2011, 1:47 AM
Shalini JunejaPosted May 20, 2011, 1:44 AM
Posted May 20, 2011, 1:41 AM
http://www.java2s.com/Code/VB/File-Directory/UseDESRC2RijndaelTripleDEStodecryptandEncryptfiles.htm
Posted May 20, 2011, 1:40 AM
Dim plainText As String = "This is a secret for RC2"
Response.Write("plainText: " + plainText + "
")
Dim buffer() As Byte = ASCIIEncoding.ASCII.GetBytes(plainText)
Dim rc2 As New RC2CryptoServiceProvider
rc2.GenerateKey()
rc2.GenerateIV()
Dim encryptedString As String = _
Convert.ToBase64String( _
rc2.CreateEncryptor().TransformFinalBlock( _
buffer, 0, buffer.Length))
Response.Write("encryptedString: " + encryptedString + "
")
buffer = Convert.FromBase64String(encryptedString)
Dim decryptedString As String = _
ASCIIEncoding.ASCII.GetString( _
rc2.CreateDecryptor().TransformFinalBlock( _
buffer, 0, buffer.Length))
Response.Write("Decrypted string: " + decryptedString + "
")
End Function
Hope this helps you.