There is a problem about Rabin cryptosystem. I'm going to generate the
Rabin key pair, so I wrote the following code by refering RSA sample
codes. However, an runtime error occurs when executing this compiled
program. This is my code.

try{
        CryptoPP::AutoSeededRandomPool rng;
        CryptoPP::RabinDecryptor Decryptor(rng, keylength);

        CryptoPP::HexEncoder privFile(new
            CryptoPP::FileSink( PrivateKeyFile.c_str() )
        ); // Hex Encoder

        Decryptor.DEREncode(privFile);
        privFile.MessageEnd();

        CryptoPP::RabinEncryptor Encryptor(Decryptor);
        CryptoPP::HexEncoder pubFile(new
            CryptoPP::FileSink( PublicKeyFile.c_str() )
        ); // Hex Encoder
        Encryptor.DEREncode(pubFile);
        pubFile.MessageEnd();
    }catch( CryptoPP::Exception& e ) {
        std::cerr
        << "Error: "
        << e.what()
        << std::endl;
    }catch(...){
        std::cerr
        << "Unknown Error"
        << std::endl;
    }


Unfortunately, this following error occurs after running previous
code.
------------------------------
Error: CryptoMaterial: this object does not support saving
------------------------------

In order to reuse in the future, I want to save the Rabin key pair
into files. How can I do? Thank you a lot.
--~--~---------~--~----~------------~-------~--~----~
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