Thanks, Yuri - I'll give that a try next :-)

-----Original Message-----
From: Yuri Misnik [mailto:[EMAIL PROTECTED]] 
Sent: Friday, February 21, 2003 10:01 AM
To: [EMAIL PROTECTED]
Subject: Re: [ADVANCED-DOTNET] CAPI -> .NET Crypto Interoperability

Adam,

We are using both managed .NET Cryptography and CAPICOM classes.
Normally we are not encrypting data with the managed code and decrypting
it with the unmanaged CAPI calls. But I've tried it in the design stage
and it worked. But it was 3DES encryption, not RC2. So you can try 3DES
in your code - if it works - than there's a bug in the Framework.

We are also using CAPICOM for x509 certificate-related operations. It
works really well, except for not as fast as we'd like :) And MS
strictly recommends CAPICOM 2.0 instead of 1.0. You can download it for
free from the Microsoft site.


Cheers,
Yuri Misnik
MCP, MCSD, MCAD.NET
IT Security Team

-----Original Message-----
From: FRIEDMAN,Adam [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, 20 February 2003 17:12
To: [EMAIL PROTECTED]
Subject: [ADVANCED-DOTNET] CAPI -> .NET Crypto Interoperability

Hi all,

Before I spend too much more time on this I would like to know if
anybody else has successfully used the System.Security.Cryptography.RC2
algorithm (from managed code) in to encrypt data, and then used CAPI
(from unmanaged code) to decrypt it.

I am aware that the .NET RC2 crypto class just wraps CAPI which is why I
am expecting it to work (but have not been as successful as I would
like). I'm pretty sure my logic is good, as the .NET crypto class can
decrypt data which it has encrypted (and vice-versa for the CAPI code).
Whenever trying between them, though, I just get ERROR_INVALID_DATA (or
something equivalent).

I assume it's to do with the padding, but I can't be sure (.NET crypto
classes support PKCS7 or Zero-byte padding, while CAPI only supports
PCKS5 padding). Again, I find this rather odd, since the .NET crypto
classes are just wrappers for CAPI!

Any ideas?

TIA,
        Adam.

Notice:
The information contained in this e-mail message and any attached files
may
be confidential information, and may also be the subject of legal
professional privilege.  If you are not the intended recipient any use,
disclosure or copying of this e-mail is unauthorised.  If you have
received
this e-mail in error, please notify the sender immediately by reply
e-mail
and delete all copies of this transmission together with any
attachments.

Notice:
The information contained in this e-mail message and any attached files may
be confidential information, and may also be the subject of legal
professional privilege.  If you are not the intended recipient any use,
disclosure or copying of this e-mail is unauthorised.  If you have received
this e-mail in error, please notify the sender immediately by reply e-mail
and delete all copies of this transmission together with any attachments.

Reply via email to