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

From: Przemek Wasylko (wasylek_at_remove-me.megapolis.pl)
Date: 12/26/04

  • Next message: Valery Pryamikov: "Re: CryptoAPI and private key /not public/ encryption with CryptEncrypt - can not use CryptHash* functions"
    Date: Sun, 26 Dec 2004 15:08:00 +0100
    
    

    Hello All :)

    I have 3rd party library that supplies me with calculated by itself hash of
    some data (so I can not use CryptHashData, etc). I don't know hash method,
    I'm only supposed to encrypt that hash using private key in order to create
    digital signature. I have SmartCard CSP with public/private keypair stored
    on it. I would like to encrypt that SHA1 hash, but using private key not the
    public one (in order to have another party validate signature by using
    public key provided by me - i can extract public key from smartcard ). But
    unfortunatelly I have found no obvious way to do that by using CryptoAPI,
    maybe I am missing something. MSDN and other sources force me to use
    CryptCreateHash/CryptHashData/CryptSignHash, but, as I mentioned before, I
    can't do that (my code does not calculate hash). I would like to use
    CryptEncrypt with private key and CryptDecrypt with public key. Is there
    solution to my problem ?

    Best regards
    Przemek Wasylko


  • Next message: Valery Pryamikov: "Re: CryptoAPI and private key /not public/ encryption with CryptEncrypt - can not use CryptHash* functions"

    Relevant Pages

    • Re: Reverse usage of public/private RSA encryption keys for licensing?
      ... It works both ways otherwise you would not be able to decrypt the signature ... to get the clear hash to validate the new calculated hash against. ... Keeping your private key private is the major idea. ... the client's public key still ...
      (microsoft.public.dotnet.framework)
    • Re: Reverse usage of public/private RSA encryption keys for licensing?
      ... It works both ways otherwise you would not be able to decrypt the signature ... to get the clear hash to validate the new calculated hash against. ... Keeping your private key private is the major idea. ... the client's public key still ...
      (microsoft.public.dotnet.security)
    • RE: integrity and mail encryption
      ... I gave my private key to somebody else. ... > so a public key infra-structure by itself does not provide ... > the corresponding private key can make a digital signature. ... you encrypt this hash with your private key. ...
      (Security-Basics)
    • Re: private key encryption - doubts
      ... > Alice creates a one-way hash and encrypt it with her private key ... So Bob now knows the private key of Alice. ... > I need to know what exactly is a digital signature. ... same symmetric key for both encryption and decryption). ...
      (comp.security.ssh)
    • Re: question about certificate verifiy using TLS
      ... and one MD5) is signed (encoded with the private key). ... Right now I'm using OpenSSL to hash (md5 and sha1). ... > With RSA, it is a bit more complex. ...
      (sci.crypt)