New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add OldRandomPool for pre-Crypto++ 5.5 compatibility #452

Closed
noloader opened this Issue Aug 1, 2017 · 1 comment

Comments

Projects
None yet
1 participant
@noloader
Collaborator

noloader commented Aug 1, 2017

We are still seeing users stuck at Crypto++ 4.2, Crypto++ 5.2, and other down level versions. The sticking point appears to be the old PGP style RandomPool generator. The PGP style RandomPool is effectively a deterministic generator and it was used as a deterministic key derivation function. See, for example:

While we discourage the old PGP style RandomPool generator for several technical reasons, we should not allow it to be a barrier to a modern Crypto++ upgrade. The lack of a clear migration path and non-interoperability is a security engineering failure on our part.

This issue will track the addition of OldRandomPool to give users a clear and interoperable upgrade path.

@noloader noloader added the Enhancement label Aug 1, 2017

@noloader noloader closed this Aug 1, 2017

noloader referenced this issue Aug 1, 2017

Add OldRandomPool class (Issue 452)
RandomPool used to be a PGP-style deterministic generator and folks used it as a key generation function. At Crypto++ 5.5 the design changed to harden it agianst rollback attacks. The design change resulted in an upgrade barrier. That is, some folks are stuck at Crypto++ 4.2 or Crypto++ 5.2 because they must interoperate with existing software.

Below is the test program we used for the test vector. It was run against Crypto++ 5.4.

    RandomPool prng;
    SecByteBlock seed(0x00, 384), result(64);
    prng.Put(seed, seed.size());

    prng.GenerateBlock(result, result.size());
    HexEncoder encoder(new FileSink(std::cout));

    std::cout << "RandomPool: ";
    encoder.Put(result, sizeof(result));
    std::cout << std::endl;

noloader referenced this issue Aug 1, 2017

Add self tests for OldRandomPool
We still need to get the test result cross-validated

noloader referenced this issue Aug 2, 2017

noloader referenced this issue Aug 2, 2017

noloader referenced this issue Aug 2, 2017

Cut-in RandomNumberGenerator interface to OldRandPool
The existing interface still exists. The new interface is routed into the old methods. Without the new interface, using OldRandPool could result in:
    $ ./cryptest.exe v
    terminate called after throwing an instance of CryptoPP::NotImplemented
      what():  RandomNumberGenerator: IncorporateEntropy not implemented
    Aborted (core dumped)

noloader referenced this issue Aug 3, 2017

Remove pre-Crypto++ 5.5 interface
Users of OldRandomPool must use the new interface. All that means is they must call IncorporateEntropy instead of Put, and GenerateBlock instead of Get
@noloader

This comment has been minimized.

Collaborator

noloader commented Aug 3, 2017

Cleared at Commit 02e3a794443ae6d9 (addition of OldRandomPool) and Commit 5fbbc5311ceafeba (self tests). Two commits were used in case the self tests need to be updated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment