Search code examples
vb.netencryptioncapicom

How to Convert CAPICOM to .NET equivalent


This is the code from my VB6 app using CAPICOM

Set ed = New EncryptedData
ed.Algorithm = CAPICOM_ENCRYPTION_ALGORITHM_3DES
ed.SetSecret mySecret, CAPICOM_SECRET_PASSWORD
ed.Content = myText
myResult = ed.Encrypt(CAPICOM_ENCODE_BINARY)

but I need to convert the same functionality to VB.NET. Is there an equivalent to get the same values?


Solution

  • As a start, look at the System.Security.Cryptography namespace. You'll find relevant classes there, include the TripleDES class.