Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Windows API
  4. How can i encrypt MD5 hash with a private key ?

How can i encrypt MD5 hash with a private key ?

Scheduled Pinned Locked Moved Windows API
cryptographyquestionalgorithmstutorial
4 Posts 2 Posters 11 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    EmoBemo
    wrote on last edited by
    #1

    I have have a buffer with a check sum which I want to encrypt with the private key in a PKCS#12 certificate using the RSA public-key algorithm with a 1024-bit key lengthis used. I have tried using CryptoAPI in the following sequence: 1. CryptAcquireCertificatePrivateKey - returns HCRIPTPROV 2. CryptGetUserKey - using the returned HCRIPTPROV returns HCRYPTKEY 3. CryptEncrypt - saying 'Bad key' when used the returned from 2 HCRYPTKEY. Also I cannot understant where should be the password for the private key passed. :confused: I'll be gratefull if somenone has an idea how to do that

    T 1 Reply Last reply
    0
    • E EmoBemo

      I have have a buffer with a check sum which I want to encrypt with the private key in a PKCS#12 certificate using the RSA public-key algorithm with a 1024-bit key lengthis used. I have tried using CryptoAPI in the following sequence: 1. CryptAcquireCertificatePrivateKey - returns HCRIPTPROV 2. CryptGetUserKey - using the returned HCRIPTPROV returns HCRYPTKEY 3. CryptEncrypt - saying 'Bad key' when used the returned from 2 HCRYPTKEY. Also I cannot understant where should be the password for the private key passed. :confused: I'll be gratefull if somenone has an idea how to do that

      T Offline
      T Offline
      ThatsAlok
      wrote on last edited by
      #2

      see MD5 is a HASH not public/private encryption/decryption algorithm. it is designed in the way to create hash from input answer. i don't have any private key. shoot me down if i am wrong.. anyway read more about it here http://en.wikipedia.org/wiki/MD5[^]

      "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
      Never mind - my own stupidity is the source of every "problem" - Mixture

      cheers, Alok Gupta VC Forum Q&A :- I/IV Support CRY- Child Relief and You

      E 1 Reply Last reply
      0
      • T ThatsAlok

        see MD5 is a HASH not public/private encryption/decryption algorithm. it is designed in the way to create hash from input answer. i don't have any private key. shoot me down if i am wrong.. anyway read more about it here http://en.wikipedia.org/wiki/MD5[^]

        "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
        Never mind - my own stupidity is the source of every "problem" - Mixture

        cheers, Alok Gupta VC Forum Q&A :- I/IV Support CRY- Child Relief and You

        E Offline
        E Offline
        EmoBemo
        wrote on last edited by
        #3

        What makes you think that I assume MD5 is an enyption/decryption algorythm? What I wand is to encrypt the checksum of some content hashed using MD5 algorythm. I don't want to encrypt raw data using MD5 algorythm.

        T 1 Reply Last reply
        0
        • E EmoBemo

          What makes you think that I assume MD5 is an enyption/decryption algorythm? What I wand is to encrypt the checksum of some content hashed using MD5 algorythm. I don't want to encrypt raw data using MD5 algorythm.

          T Offline
          T Offline
          ThatsAlok
          wrote on last edited by
          #4

          it seems i am getting old day by day :-) .. anyways go this link RSA encryption/decryption[^]

          "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
          Never mind - my own stupidity is the source of every "problem" - Mixture

          cheers, Alok Gupta VC Forum Q&A :- I/IV Support CRY- Child Relief and You

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups