Re: TripleDESCryptoServiceProvider vs. CryptoAPI

From: Ivan Medvedev [MS] (ivanmed_at_online.microsoft.com)
Date: 07/29/03


Date: Tue, 29 Jul 2003 08:27:10 -0700


Oleg -
Key material is a Key and an IV. Also, if you are using CryptDeriveKey in
the C++ code you should use
System.Security.Cryptography.PasswordDeriveBytes.CryptDeriveKey() method in
managed code to get the same functionality (in this case no reveral is
neccessary), otherwise you will not get the same key.
--Ivan
This posting is provided "AS IS" with no warranties, and confers no rights.

"Oleg Leikin" <loleg@optisign.net> wrote in message
news:072f01c35598$c79e34d0$a401280a@phx.gbl...
>
> >Also, because of the little-endian/big-endian difference,
> the byte order in
> >the key material must be reversed when passing from
> managed to Crypto API
> >and vice versa.
>
> Ivan,
> what should be reversed ? In .NET application I create
> some MD5 hash of some data to be a key. In the C++
> application I use CryptCreateHash(...,CALG_MD5,...) and
> CryptHashData() in order to create the key base object,
> and then CryptDeriveKey(...) in order to create the key
> itself.
>
> What "key material" must be reversed ?
>
> Thanks in advance.
>
> P.S. Now I've added CryptSetKeyParam(...) before
> CryptDeriveKey(...). Should I reverse the IV also ?
>



Relevant Pages

  • Re: MACTripleDES using CryptoAPI
    ... starting in v1.1) in managed code and CryptDeriveKey in unmanaged code. ... import a symmetric key used in the managed implementation (remember though ... > only the CryptoAPI, I have a problem: ...
    (microsoft.public.dotnet.security)
  • Re: D2006 hits the UK
    ... You can call managed code from unmanaged and vice versa. ... If tomorrow your boss says that you need a web service you'd have to be insane to write it in Win32 Delphi. ...
    (borland.public.delphi.non-technical)
  • Re: Is there a way to convert VB forms to VC?
    ... I've never dealt with that feature. ... You can use Managed C++ classes from VB.NET, and vice versa; ...
    (microsoft.public.vstudio.general)
  • Re: Is there a way to convert VB forms to VC?
    ... I've never dealt with that feature. ... You can use Managed C++ classes from VB.NET, and vice versa; ...
    (microsoft.public.dotnet.languages.vb)