Skip to content
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 MKRAND RBG #69

Merged
merged 2 commits into from
Jan 18, 2015
Merged

Add MKRAND RBG #69

merged 2 commits into from
Jan 18, 2015

Conversation

mknight-tag
Copy link

No description provided.

@kiniry kiniry added this to the Cryptol 2.1 milestone Aug 13, 2014
@kiniry kiniry self-assigned this Aug 13, 2014
@kiniry
Copy link
Member

kiniry commented Sep 12, 2014

Reflections @TomMD ?

@kiniry kiniry assigned TomMD and unassigned kiniry Sep 12, 2014
@TomMD
Copy link
Contributor

TomMD commented Sep 13, 2014

It's great to see a RBG being contributed but I'm curious about the motivation behind this generator, the intended use cases, and how we expect other Cryptol users to benefit. These questions concern me largely because 1) the text would greatly mislead the uninitiated and 2) this isn't a secure RBG.

I'm sure you know this isn't a secure generator, but for posterity sake I'll elaborate. Ideally there would be a proof of reduction to a hard problem, or it would be based on a public standard or cited publication. Lots of published papers exist detailing DRBGs with many trade-offs so it isn't an unexplored space that warrants arbitrary implementations.

This is actually a really fun and cool example for showing how Cryptol can aid analysis of the security of an algorithm. In this case we run the generator for a little and feed the output into a SAT solver to extract the "secret" seed. That is, given just the output random bytes from a generator we can discover the seed and thus know any prior or future random data:

> :set prover=boolector
> :sat (\seed -> take (randBytes seed) == 
                                                        [108, 78, 89, 137, 178, 143
                                                        , 203, 235, 160, 49, 161, 115
                                                        , 120, 96, 17, 54, 82, 242, 0
                                                        , 156, 205, 68, 55, 60, 156
                                                        , 116, 131, 121, 69, 8, 66, 19])
(\seed -> take (randBytes seed) == [108, 78, 89, 137, 178, 143
                                                        , 203, 235, 160, 49, 161, 115
                                                        , 120, 96, 17, 54, 82, 242, 0
                                                        , 156, 205, 68, 55, 60, 156
                                                        , 116, 131, 121, 69, 8, 66, 19])               
           0x00000000000000010000000000000000 = True
     // Notice the result 0x00...010..00 is the `seedUnit` variable
    // which I used to generated the array of random numbers.

For example, this could be used to take one cryptographic key generated via this generator and discover any prior or later generated key.

The misleading part of the text all are due to the security implications. For examples it A) mentions cryptographic uses B) calls out time as an entropy source C) claims the generator can provide an infinite stream of bits even though all DRBGs have a useful limit.

@acfoltzer
Copy link
Contributor

@TomMD, your comments make me feel that this could be merged, but only after some substantial editing to the documentation. @mknight-tag, would you be up for doing this, or would you prefer we handle the changes?

@acfoltzer acfoltzer modified the milestones: Cryptol 2.2, Cryptol 2.1 Oct 2, 2014
@acfoltzer
Copy link
Contributor

Bumped this to the next milestone as we are hitting our feature freeze for 2.1

@TomMD
Copy link
Contributor

TomMD commented Oct 16, 2014

I see the code has been updated since our earlier comments. I no longer have an objection to the text but am left with the broader question of what constitutes something that belongs in the Cryptol repository? Anything written in Cryptol (hello bloat!)? Need it be cryptographic (good bye n-queens!)? Need it be educational (good bye AES, maybe)?

@acfoltzer
Copy link
Contributor

@TomMD, for the moment we are happily accepting examples, both cryptographic and not, in the /examples/contrib subtree. At some point it might be worth splitting that out into a separate repository, and having a smaller core here, but for now I don't see any problems.

acfoltzer added a commit that referenced this pull request Jan 18, 2015
@acfoltzer acfoltzer merged commit 85e1725 into GaloisInc:master Jan 18, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Asking for new or improved functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants