RE: CryptDecrypt wrong key

From: lelteto (lelteto_at_discussions.microsoft.com)
Date: 02/25/05


Date: Fri, 25 Feb 2005 08:47:11 -0800

Yes, it is recognized as wrong decryption. The reason is that the encrypted
data is FORMATTED (see PKCS #1) and this format is checked after decryption
(ie. after applying the RSA exponentiation with the private key). It is
highly unlikely that with the wrogn decryption key the format would be
correct. So yes, CryptDecrypt would return error (FALSE).

Laszlo Elteto
SafeNet, Inc.

"Peodor" wrote:

> Hi,
>
> Assume something is RSA public key encrypted with CryptEncrypt.
>
> What happens if WRONG RSA private key is supplied when it is decrypted with
> CryptDecrypt?
> Is it detected that wrong key is supplied?
> Is true or false returned? Last error?



Relevant Pages

  • RE: CryptDecryptMessage vs CryptDecrypt
    ... decrypt (or encrypt) raw RSA. ... DATA encryption / decryption. ... encrypted "raw" data through function CryptDecrypt. ...
    (microsoft.public.platformsdk.security)
  • Re: electronic signatures
    ... Suppose plaintext messages are required to be ... n) have this format. ... "plaintext" (the signature) has the required form. ... can always come up with *some* decryption process involving that key ...
    (sci.crypt)
  • Re: CryptDecrypt wrong key
    ... but which error code to return? ... it is recognized as wrong decryption. ... > (ie. after applying the RSA exponentiation with the private key). ... CryptDecrypt would return error. ...
    (microsoft.public.platformsdk.security)
  • Re: Name this key exchange
    ... RSA is faster than DH at encryption and slower at decryption. ... Bob generates a secret by choosing a random number r and setting ...
    (sci.crypt)
  • Re: Encrypting using RSA private Key
    ... the answer is YES but only if you rewrite the rsa algo:-D ... encryption: ... decryption: M=C^D mod N ... Is it possible to encrypt using the RSA private key and decrypt using the ...
    (microsoft.public.dotnet.security)