How to implement RC2 algorithm in VB.NET?
How to implement RC2 algorithm in VB.NET?please provide the sample code in VB.NET
5 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Posted May 19, 2011, 9:40 PM EDT
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.
Posted May 19, 2011, 9:41 PM EDT
http://www.java2s.com/Code/VB/File-Directory/UseDESRC2RijndaelTripleDEStodecryptandEncryptfiles.htm
Shalini JunejaRank #351 · 7.1K reputationPosted May 19, 2011, 9:44 PM EDT
Posted May 19, 2011, 9:47 PM EDT
Posted May 19, 2011, 9:51 PM EDT