Re: C++ and C# cryptography compatibility

From: Michel Gallant (neutron_at_NOSPAMistar.ca)
Date: 03/29/04


Date: Mon, 29 Mar 2004 14:59:19 -0500

However CryptoAPI CryptEncrypt() generates ciphertext in exactly the same order
as .NET generates ciphertext. (Note that CryptEncrypt with RSA asymmetric encryption
DOES reverse the order of the ciphertext output.)
The only issue is the encryption block which CryptoAPI reverses (compared
to standard PKCS #1 encryption block order) as described here:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/security/security/simple_key_blobs.asp
- Mitch

"Pieter Philippaerts" <Pieter@nospam.mentalis.org> wrote in message
news:ualJ89ZFEHA.1064@TK2MSFTNGP12.phx.gbl...
> "Michel Gallant" <neutron@NOSPAMistar.ca> wrote in message
> > - there shouldn't be any issue with Endian-ness for symmetric encryption
>
> CryptoAPI's symmetric keys are imported in little endian byte order, while
> .NET uses big endian byte order.
> So you'll need to reverse the symmetric key you're using in .NET when
> importing it with the CryptoAPI [or vice versa].
>
> Regards,
> Pieter Philippaerts
> http://mentalis.org/go.php?sl
>
>



Relevant Pages

  • Cryptography FAQ (08/10: Technical Miscellany)
    ... How do I use compression with encryption? ... What does ``random'' mean in cryptography? ... WordPerfect encryption has been shown to be very easy to break. ... where the ciphertext is something like the ...
    (sci.crypt)
  • Cryptography FAQ (08/10: Technical Miscellany)
    ... How do I use compression with encryption? ... What does ``random'' mean in cryptography? ... WordPerfect encryption has been shown to be very easy to break. ... where the ciphertext is something like the ...
    (sci.crypt)
  • Cryptography FAQ (08/10: Technical Miscellany)
    ... How do I use compression with encryption? ... What does ``random'' mean in cryptography? ... WordPerfect encryption has been shown to be very easy to break. ... where the ciphertext is something like the ...
    (sci.crypt)
  • Vulnerability in Crypt::CBC Perl module, versions <= 2.16
    ... block of plaintext prior to encryption. ... In order for ciphertext encrypted by Crypt::CBC to be decrypted, ... The older, deprecated, header type is known as the "RandomIV" ... Other>8-byte cipher algorithms will be similarly affected. ...
    (Bugtraq)
  • Indistinguishability and integrity in symmetric encryption
    ... "The 'right' security property for general-purpose symmetric encryption". ... >symmetric encryption scheme (for which the empty plaintext is not ... A has interfaces to an encryption oracle ... It is assumed that the ciphertext returned by A is different to all those ...
    (sci.crypt)