Hi friends;
Here is "DumpRSAKeys" code:

// patest3.cpp
#include "stdafx.h"

#include "rsa.h"
#include "osrng.h"  // PRNG
#include "hex.h"    // Hex Encoder/Decoder
#include "files.h"  // File Source and Sink
//std
#include <iostream>
#include <conio.h>
using namespace CryptoPP;
using namespace std;
int main()
{

        string PrivateKeyFile = "key.pv";
        string PublicKeyFile  = "key.pb";

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

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

        RSAES_OAEP_SHA_Decryptor Decryptor( privFile );
        RSAES_OAEP_SHA_Encryptor Encryptor ( pubFile );

        cout << "RSA Parameters" << endl <<endl;

        cout << "modulus: " << Encryptor.GetTrapdoorFunction
().GetModulus();
        cout << endl << endl;

        cout << "e: " << Encryptor.GetTrapdoorFunction
().GetPublicExponent();
        cout << endl << endl;

        cout << "d: " << Decryptor.GetTrapdoorFunction
().GetPrivateExponent();
        cout << endl << endl;
        _getch();

        return 0;
}

It's output is as below:

RSA Parameters

modulus: 4407694104633920013768197199744584958342429989489812064383.
e: 17.
d: 1037104495207981179710164046967410854883206641050658193489.

I want to show RSA parameters(modulus,e,d) in Hex format(e.g
0x4d ...),but this output is in decimal format!

What should I do for this purpose?

Thanks in Advance.
Gary
--~--~---------~--~----~------------~-------~--~----~
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