Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to decrypt CAPICOM data i .NET 2.0

51 views
Skip to first unread message

Karel Kral

unread,
Nov 13, 2006, 7:07:36 AM11/13/06
to
Hello,
I have CAPICOM encrypted data. Data cames from VB6 application (see
sample bellow). Now I want to decrypt this data in VB.NET (or C#).

Are there native .NET 2.0 library to decrypt CAPICOM data or I must have
import CAPICOM interop and use this one?

Example of VB.NET encryption:
Dim message As New EncryptedData
message.Content = txtPrefix.Text & cbId.Text & txtHodnota
message.SetSecret txtPwd.Text
message.Algorithm.Name = CAPICOM_ENCRYPTION_ALGORITHM_DES
CryptMsg message.Encrypt


Example of VB.NET decryption:
Set message = New EncryptedData
message.SetSecret mvarKreditVerze
message.Decrypt "Key"
DecryptMsg = message.Content

Karel Kral

Joe Kaplan

unread,
Nov 13, 2006, 10:14:57 AM11/13/06
to
My understanding is that the CAPICOM encryption format is proprietary to
CAPICOM (unliked their signed and enveloped structures, which are standard),
so you must use CAPICOM to decrypt as well. You can do this from .NET via
COM Interop.

Joe K.

--
Joe Kaplan-MS MVP Directory Services Programming
Co-author of "The .NET Developer's Guide to Directory Services Programming"
http://www.directoryprogramming.net
--
"Karel Kral" <kral...@volny.cz> wrote in message
news:%23y7VPxx...@TK2MSFTNGP04.phx.gbl...

Karel Kral

unread,
Nov 14, 2006, 2:44:17 AM11/14/06
to
Thanks, it is I was worry about. So I must to say goodbye to XCopy
deployment (CAPICOM must me registered ActiveX).

Joe Kaplan

unread,
Nov 14, 2006, 10:17:06 AM11/14/06
to
Or say goodbye to CAPICOM, yes. Sorry. Personally, I'd try to avoid using
this feature of CAPICOM as it is proprietary and just asking for trouble.
I'd use the Enveloped data support with EnvelopedCms in .NET 2.0 (or the
crypto message stuff in crypto API for native support). You may be stuck
with an existing thing you can't change though.

Joe K.

--
Joe Kaplan-MS MVP Directory Services Programming
Co-author of "The .NET Developer's Guide to Directory Services Programming"
http://www.directoryprogramming.net
--
"Karel Kral" <kral...@volny.cz> wrote in message

news:%23CR1wC8...@TK2MSFTNGP03.phx.gbl...

Karel Kral

unread,
Nov 14, 2006, 3:26:25 PM11/14/06
to
> You may be stuck with an existing thing you can't change though.

Yes, this is exactly my case. The bigger part of our app is VB6 and must
to use CAPICOM. So newer .NET part must adapt to these crypted data data.

0 new messages