Discussion:
Decrypting CAPICOM objects with System.Security.Crypto methods.
(too old to reply)
Dave
2007-06-21 17:27:52 UTC
Permalink
Hello:

I'm trying to teach myself how to use the System.Security.Crypto class
with what I thought would be a simple method.... but I'm getting
nowhere.

Background: In the past, my company encrypted data using VB6 and
CAPICOM2, using 5 lines of code:

Dim objCryptoAPI As Object
Dim sEncryptionKey,sPlainText, sCipherText As String

objCrypto = CreateObject("CAPICOM.EncryptedData")

objCrypto.SetSecret(sEncryptionKey)
objCrypto.Content = sPlainText

sCipherText = objCryptoAPI.Encrypt()

Decryption is much the same:

objCryptoAPI.SetSecret(sEncryptionKey)
objCrypto.Decrypt(sCipherText)
sPlainText = objCryptoAPI.Content


So far, so good (if a bit simplistic). However, now I need to
construct a means to decipher encypted messages natively in .NET
(2.0).

At first, I realized I did not even know the algorithm being used, or
the key size in the old method. After some work, I discovered the
Carlo Patargo
2011-06-30 17:09:39 UTC
Permalink
Dave, I'm having exactly the same problem. I know you posted this years ago, but I'm asking anyway: do you have a solution?
Post by Dave
I'm trying to teach myself how to use the System.Security.Crypto class
with what I thought would be a simple method.... but I'm getting
nowhere.
Background: In the past, my company encrypted data using VB6 and
Dim objCryptoAPI As Object
Dim sEncryptionKey,sPlainText, sCipherText As String
objCrypto = CreateObject("CAPICOM.EncryptedData")
objCrypto.SetSecret(sEncryptionKey)
objCrypto.Content = sPlainText
sCipherText = objCryptoAPI.Encrypt()
objCryptoAPI.SetSecret(sEncryptionKey)
objCrypto.Decrypt(sCipherText)
sPlainText = objCryptoAPI.Content
So far, so good (if a bit simplistic). However, now I need to
construct a means to decipher encypted messages natively in .NET
(2.0).
At first, I realized I did not even know the algorithm being used, or
the key size in the old method. After some work, I discovered the
Loading...