Hi Chan, I would expect the following to be the most straight forward way to do this. But it does not work.
InvertibleRabinFunction params; params.GenerateRandomWithKeySize(rng, keylength); Rabin::PrivateKey prv( params ); Rabin::PublicKey pub( params ); prv.Save( HexEncoder( new FileSink( "private.bin", false ) ) ); pub.Save( HexEncoder( new FileSink( "public.bin", false ) ) ); I also looked at Rabi1024.dat. It is a hex encoded ASN.1 object (it starts with 3082015202818100D1... ). I would be surprised if it was not generated from Crypto++. I don't know what Wei's motivation was for stripping out the X509PublicKey and PKCS8PrivateKey form the Rabin gear. Perhaps Wei can help out here. Jeff On 3/20/09, Mo-Che Chan <[email protected]> wrote: > > Hi Jeff, > Thank your advice very much. > > The sample in validat2.cpp describes how to use the existing Rabin > key. > > After surveyed the validat2.cpp, crypto++ 5.6.0 and other sample > codes. By grep "RSASS" *.cpp, I tried searching for all crypto++ 5.6.0 > source code and some samples to find out how to run a complete > procedure about: > (1) Rabin key generation and to write the key pair into files, > (2) To dump the parameters of key pair, > (3) To load the stored keys to sign and to verify messages. > > I still don't know how to generate a Rabin key pair, write them into > files for future reusing. But I know RSA's. I just don't understand > why the usage of RSA and Rabin can't be the same. > > Could you give me some more detail hints about usage of Rabin? Thanks > a lot. > > By the way, I major in theory of the cryptography and its knowledge, > but I want to have implementing experiences about cryptography. I > already surveyed most of the following materials: > http://www.cryptopp.com/wiki/ > http://www.codeproject.com/ (all articles about crypto++) > > However, I think those samples are not enough to me if I want more > familiar with crypto++. Could you tell me where (or how) can I obtain > the crypto++ samples more. Thank you very much. > > On Mar 20, 4:30 pm, Jeffrey Walton <[email protected]> wrote: > > > > > However, Wei show us how to Rabin in validate2.cpp, ValidateRabin() on > > line 538. In his example, Crypto++ is using the Signer and Verifier, > > which do implement PKCS8PrivateKey and X509PublicKey. So you will be > > able to save and load using those objects. > --~--~---------~--~----~------------~-------~--~----~ 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. -~----------~----~----~----~------~----~------~--~---
