I've taken a look at both of those thoroughly, (http://
www.cryptopp.com/wiki/Diffie-Hellman and the source code in the
examples), and they were very instrumental in getting me a working
version.  I got DH working before I posted the first time using those
two resources.  Now, what I want to do is make my own dat file, but
I'm having trouble locating what generates a dat file and the
requisites for generating this dat file.  From what I can tell, the
dat files are part of the download and not generated by the code.

On May 27, 7:14 pm, Jeffrey Walton <[email protected]> wrote:
> > It appears the first byte is not the asnTag.  I know this is simple,
> > but what am I doing wrong?
>
> You're writing random data, and then trying to read it as an ASN.1
> encoded object. Take a look at the wiki's DH example, or Crypto++'s
> examples in validate1.cpp, validate2.cpp, etc.
>
> Jeff
>
> On 5/27/09, SpaceCowboy850 <[email protected]> wrote:
>
>
>
> > I'm using the Deffie-Hellman algorithm in Crypto 5.60 under Visual
> > Studio 2005.  I'm trying to create my own seed file instead of using
> > the ones provided in the example.
>
> > This is the way I create my file:
>
> >  const size_t seedBufSize = 1024;
> >  unsigned char seedBuf[seedBufSize];
> >  g_autoRNG.GenerateBlock( reinterpret_cast<byte*>(seedBuf),
> > seedBufSize );
> >  CryptoPP::FileSink fileSink( "seed.dat" );
> >  fileSink.GetStream()->write( (const char*)seedBuf, seedBufSize );
> >  fileSink.IsolatedFlush( true, true );
>
> > I then try to load it like this:
>
> >  CryptoPP::FileSource fileSource( "seed.dat", true );
> >  g_pKeyAgreementAlg = new CryptoPP::DH(fileSource);
>
> > I keep getting a BERDecodeError.  I've tried using a HexDecoder like
> > this:
>
> >  CryptoPP::FileSource fileSource( "seed.dat", true, new
> > CryptoPP::HexDecoder() );
>
> > It appears the first byte is not the asnTag.  I know this is simple,
> > but what am I doing wrong?
--~--~---------~--~----~------------~-------~--~----~
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