Re: How to encrypt data with given key and IV



Here is a short note on comparing CryptoAPI, .NET and Java implementations
of symmetric encryption:
http://www.jensign.com/JavaScience/dotnet/NetDESEncrypt
- Mitch

"lelteto" <lelteto@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:BD68A849-6A9C-4D62-98A3-BEEB273A3FC9@xxxxxxxxxxxxxxxx
You need to import the keys. You can use CryptImportKey with
PLAINTEXTKEYBLOB
- or if that's not supported, use the "exponent one" method (somewhere it
is
in MS KB) which creates an RSA public / private keypair with exponent = 1
and
use that to import the key blob (pretending it is encrypted with this
exponent one key).

As for the IV you can use CryptSetKeyParam(KP_IV)

Laszlo Elteto
SafeNet, Inc.

"Qinsheng Lai" wrote:

My project is on a VC++ with the original CAPI (no .NET/CNG ). I need to
do
triple DES or RC2 encryption/decryption with given key and IV stored in
byte[]. I had some experience with Java JCE, and these were straight
operations. However, to my suprise, after days of searching and reading,
still not get the hints to do it in MS CAPI. Seems MS CAPI only allow
symmetric key cipher base on password (password - hash - key ).
Any idea or suggestion from anybody? Thanks in advance.


.



Relevant Pages

  • Signing with CAPICOM, verifing with .NET
    ... Biztalk 2004 had the ability of apply ... how to easily implement the multiple signing and encryption ... , so we decided to use CAPI. ... compatible with the methods that CAPI uses to provide multiple signing or... ...
    (microsoft.public.dotnet.security)
  • Re: How to specify 40 bit RC2?
    ... If the OpenSSL implementation works, ... in BOTH OepnSSL and in your CAPI program. ... the algo description than you should not have copyright / license issues. ... used (and Microsoft did release its famous "128-bit encryption pack"). ...
    (microsoft.public.platformsdk.security)
  • Re: How to specify 40 bit RC2?
    ... "lelteto" wrote: ... in BOTH OepnSSL and in your CAPI program. ... the algo description than you should not have copyright / license issues. ... used (and Microsoft did release its famous "128-bit encryption pack"). ...
    (microsoft.public.platformsdk.security)
  • Re: RSA Public Key problem c++ client to java server
    ... from capi to compare approaches :-): ... This should use PKCS#1 padding. ... The symmetric encryption need NOT be reversed! ... RSA private key for the corresponding decryption. ...
    (microsoft.public.platformsdk.security)