Digital Signature

From Crypto++ Wiki
Jump to navigation Jump to search

Digital signatures are the electronic equivalent of hand written signatures. Signature schemes are used to:

  • Confirm Validity
  • Approve a Document
  • Declare Ownership or Authorship

Crypto++ supports two broad categories of digital signatures: Signature Schemes with Appendix (SSA) and Signature Schemes with Recovery (PSSR). A signature scheme with appendix requires the verifier to have three items: the public key, the message, and the signature. A signature scheme with recovery requires only the public key and signature - the message is recovered from the signature.

Crypto++ supported signature schemes with appendix include RSA, DSA, GDSA, ESIGN, and Rabin-Williams. The three Crypto++ supported signature schemes with recovery are RSA, Nyberg-Rueppel, and Rabin-Williams.

Finally, if interested in short digital signature schemes, take time to evaluate McEliece Digital Signature Scheme (based on error correcting codes), Quartz (based on HFEs), and Pairing Based Cryptography. The McEliece cryptosystem predate RSA and produce some of the smallest signatures possible. Quartz is patent encumbered and appears to be poorly supported. For pairings, the PBC Library is offered under GNU licensing and is actively supported by Ben Lynn.

There are at least two distinct methods (with many variations) used to perform signing and verification in Crypto++. The most often used is pipelining, where an output from one filter is directed to the input of another filter. For an example of pipelining signatures through SignerFilters and SignatureVerificationFilters, see the examples presented in RSA and DSA. The second method uses Signer::SignMessage and Verifier::VerifyMessage to insert messages. The second method is demonstrated in both RSA and ESIGN.

Downloads - Demonstrates ESIGN Signature and Verification - 5KB Demonstrates DSA Signature and Verification - 5KB Demonstrates Elliptic Curve DSA Signature and Verification - 7KB - Demonstrates RSA-SSA (Appendix) - 5KB - Demonstrates RSA-SSA (Appendix) using Filters - 5KB - Demonstrates RSA-PSSR (Recovery) - 7KB Demonstrates RSA-PSSR (Recovery) using Filters - 5KB - Demonstrates RSA-SSA (PKCS v1.5) - 5KB