From: http://www.cryptopp.com/fom-serve/cache/96.html
"The Crypto++ API does now allow you to encrypt using a private key, because that is not a valid cryptographic concept. Perhaps what you really want to do is to use the private key to sign a message in such a way that you can recover the message from the signature during the signature verification process, thus avoiding having to send the message separately. " This is exactly what I am trying to do. I have a DH key pair and need sign and then verify a message. Is there an example somewhere doing this with the keys in memory (SecByteBlock)? hhale21 wrote: > > > Using the code from: > > http://www.cryptopp.com/wiki/Diffie-Hellman_Key_Exchange > > I am encrypting the message with the pubA and decrypting with privA, > but the > decrypted message does not match the original. > > CFB_Mode<AES>::Encryption cfbEncryption(pubA, aesKeyLength, iv); > cfbEncryption.ProcessData((byte*)encrypted, (byte*)message, > messageLen); > > ////////////////////////////////////////////////////////////////////////// > // Decrypt > > CFB_Mode<AES>::Decryption cfbDecryption(privA, aesKeyLength, iv); > cfbDecryption.ProcessData((byte*)decrypted, (byte*)encrypted, > messageLen); > > decrypted != message > > I am just starting out here with crypto++, but I am missing something? > Is > there something different with DH keypairs created with > dhA.GenerateKeyPair(rngA, privA, pubA) such that encrypting with the > public > key and decrypting with the private key does not result in the > original > message? > Thanks > > > > > > -- View this message in context: http://www.nabble.com/DH-public-private-key-pair-question-tf3424947.html#a9559149 Sent from the Crypto++ Users mailing list archive at Nabble.com. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the "Crypto++ Users" Google Group. To unsubscribe, send an email to [EMAIL PROTECTED] More information about Crypto++ and this group is available at http://www.cryptopp.com. -~----------~----~----~----~------~----~------~--~---
