ESIGN

From Crypto++ Wiki
Jump to navigation Jump to search
ESIGN
Documentation
#include <cryptopp/esign.h>

ESIGN, or Efficient Digital Signature, is a Signature Scheme created by NTT Japan and specified in IEEE P1363. The chief advantage of using ESIGN over other Signature Schemes is speed. According to the Crypto++ benchmarks, ESIGN achieves high throughput with respect to both Signing and Verification. ESIGN is a Digital Signature Scheme with Appendix, meaning the original message must be presented to the Verify function to perform the verification.

Sample Programs

The following example demonstrates signing and verification using the ESIGN signature scheme and Signer::SignMessage and Verifier::VerifyMessage.

///////////////////////////////////////
// Quote of the Day by Francis Jeffrey
string message( "Opinions founded on prejudice are always " \
    "sustained with the greatest of violence" );

///////////////////////////////////////
// Pseudo Random Number Generator
AutoSeededRandomPool rng;

///////////////////////////////////////
// Key Generation
InvertibleESIGNFunction parameters;

// Modulus size should be a multiple of 3
// k = 32 by default
parameters.GenerateRandomWithKeySize( rng, 64 * 3 );

ESIGN<Whirlpool>::PrivateKey privateKey( parameters );
ESIGN<Whirlpool>::PublicKey publicKey( parameters );


///////////////////////////////////////
// Signature
ESIGN< Whirlpool >::Signer signer( privateKey );

// Set up for SignMessage()
size_t length = signer.MaxSignatureLength();
byte* signature = new byte[ length ];
if( NULL == signature ) { return -1; }

// Sign...
signer.SignMessage( rng, (const byte*) message.c_str(),
    message.length(), signature );


///////////////////////////////////////
// Verification
ESIGN< Whirlpool >::Verifier verifier( publicKey );

bool result = verifier.VerifyMessage( (const byte*)message.c_str(),
    message.length(), signature, signer.SignatureLength() );


///////////////////////////////////////
// Result
if( true == result ) {
    cout << "Signature on message verified" << endl;
} else {
    cout << "Message verification failed" << endl;
}

Downloads

ESIGN-Test.zip - Demonstrates ESIGN Signature and Verification - 5KB