given the following straight-forward example of verifying the
signature of a signed message, is it also possible to decrypt that
signed message to retreive the data i need from it?


    AutoSeededRandomPool rng;

    string message = "X3BA-9NSF-8N9Q-UWQC-U7FX-AZZF-JAJW";

    // Signing
    string PrivateKeyFile = "key.pv";
    string SignedMessage = "";

    FileSource privFile( PrivateKeyFile.c_str(), true, new
HexDecoder);
    RSASSA_PKCS1v15_SHA_Signer priv(privFile);

    StringSource s1(message, true,
        new SignerFilter(rng, priv,
        new HexEncoder(
        new StringSink( SignedMessage )
        )));

    cout << SignedMessage << endl << endl; //the message in question.
i want to decrypt this later (see below)

    // Validation
    string PublicKeyFile = "key.pb";

    FileSource pubFile( PublicKeyFile.c_str(), true, new HexDecoder );
    RSASSA_PKCS1v15_SHA_Verifier pub(pubFile);

    StringSource signatureFile( SignedMessage, true, new HexDecoder);
    if (signatureFile.MaxRetrievable() != pub.SignatureLength()) throw
string( "Signature File Size Problem" );

    SecByteBlock signature(pub.SignatureLength());
    signatureFile.Get(signature, signature.size());

    VerifierFilter *verifierFilter = new VerifierFilter(pub);
    verifierFilter->Put(signature, pub.SignatureLength());
    StringSource s2(message, true, verifierFilter);

    if( false == verifierFilter->GetLastResult() ) throw string
( "Signature Verification Failed" );

    cout << "Signature Verified" << cout; //that's cool and all, but
about that data. can i decrypt it??
-- 
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.

Reply via email to