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. C / C++ / MFC
  4. How to generate DSA 512 bit KeyPair in VC++ 2010

How to generate DSA 512 bit KeyPair in VC++ 2010

Scheduled Pinned Locked Moved C / C++ / MFC
c++cryptographyhelptutorial
1 Posts 1 Posters 0 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.
  • I Offline
    I Offline
    IICTECH
    wrote on last edited by
    #1

    Hi to all, I am able to generate DSA 512 bit KeyPair using crypto++ using the following code bool CreateDSAKeys() { CryptoPP::AutoSeededX917RNG<CryptoPP::AES> prng; try { CryptoPP::GDSA<CryptoPP::SHA1>::GroupParameters pqg; pqg.GenerateRandom (prng, CryptoPP::MakeParameters(CryptoPP::Name::ModulusSize (), 512)(CryptoPP::Name::SubgroupOrderSize (), 160)); OutputData(output, "P ", pqg.GetModulus (), pqg.GetModulus ().ByteCount ()); OutputData(output, "Q ", pqg.GetSubgroupOrder(), pqg.GetSubgroupOrder ().ByteCount ()); OutputData(output, "G ", pqg.GetSubgroupGenerator(), pqg.GetSubgroupGenerator ().ByteCount ()); CryptoPP::GDSA<CryptoPP::SHA1>::Signer priv; priv.AccessKey().GenerateRandom(prng, pqg);//CryptoPP::MakeParameters(CryptoPP::Name::ModulusSize (), 512) /*CryptoPP::MakeParameters(CryptoPP::Name::ModulusSize(), 512)*/); DSA::Verifier pub(priv); OutputData(output, "X ", priv.GetKey().GetPrivateExponent(), priv.GetKey().GetPrivateExponent().ByteCount ()); OutputData(output, "Y ", pub.GetKey().GetPublicElement(), pub.GetKey().GetPublicElement().ByteCount ()); } } But, The length of the PrivateKey x Parameter and the length of the Q parameter are not equal and the values of group parameters are also not constant. can any one suggest me a way to solve this problem. Thanks in advance.

    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