Re: CryptoAPI and private key /not public/ encryption with CryptEncrypt - can not use CryptHash* functions

From: Przemek Wasylko (wasylek_at_removeme.megapolis.pl)
Date: 12/27/04

  • Next message: Vishal Agarwal[MSFT]: "Re: CERT_E_WRONG_USAGE"
    Date: Mon, 27 Dec 2004 13:28:48 +0100
    
    

    "Valery Pryamikov" <Valery@nospam.harper.no> wrote in message
    news:%23mZ5G636EHA.2700@TK2MSFTNGP14.phx.gbl...
    > Hi,
    > if you have hash value that fits some standard hash (ex. use MD5 if it is
    > 128 bits or SHA1 if hash is 160 bits or CALG_SSL3_SHAMD5 if it is 288
    > bits) then you can use CryptSetHashParam with HP_HASHVAL, and use
    > CryptSignHash to sign it.
    > Since cryptographic hash value is essentially a random number - no
    > restrictions could be added to CryptSetHashParam with HP_HASHVAL except
    > for bitlength. So, if you have value of RIPEMD-160 or HAVAL you can just
    > stick it's value into SHA1/MD5 hash and sign it.

    Hello,

    Thakn you for your answer. I have thought of solution of that kind (using
    CryptSetHashParam with HP_HASHVAL) but I was curious if it is possible to
    perfom such calculations normally, ie encrypting hash with private key and
    decrypting with public key. I guess by that it is not possible with
    cryptoapi ?

    Przemek Wasylko


  • Next message: Vishal Agarwal[MSFT]: "Re: CERT_E_WRONG_USAGE"

    Relevant Pages

    • Re: [Help] Create HMAC
      ... I see you missing a CryptCreateHash(hProv, CALG_HMAC, hKey, 0, &hHash2); ... step before CryptSetHashParam ... >> I generated a session key, and tried to use this key to create a hash: ... > This is how I derive my session key, ...
      (microsoft.public.platformsdk.security)
    • Re: CryptoAPI and private key /not public/ encryption with CryptEncrypt - can not use CryptHash* fun
      ... if you have hash value that fits some standard hash (ex. ... then you can use CryptSetHashParam with HP_HASHVAL, ... I'm only supposed to encrypt that hash using private key in order ... > signature by using public key provided by me - i can extract public key ...
      (microsoft.public.platformsdk.security)
    • Re: CryptSetHashParam
      ... >Now when I call the DeriveKey i get a Bad Hash error anyone any idea ... CryptSetHashParam to set the hash value. ... CryptDeriveKey Win32 documentation, ... Washington WA 98072-8661 | WFTPD, WFTPD Pro are Windows FTP servers. ...
      (microsoft.public.security)
    • CryptSetHashParam
      ... I was trying to sign the data of a hash that i got outside the cryptoAPI. ... As suggested i tried to use the CryptSetHashParam but it doesnt seem to work. ... 4.CryptSetHashParampbBuffer conatins the hashed value ...
      (microsoft.public.platformsdk.security)