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

Get good random numbers externally, or by c++ function/lib but not via OS #32

Closed
jonasstein opened this issue Apr 20, 2022 · 3 comments
Closed
Milestone

Comments

@jonasstein
Copy link
Collaborator

jonasstein commented Apr 20, 2022

To not pull random numbers via OS.

Two possible solutions:

a) Unix philosophy: One tool per task.
we drop the key generation by stenc and just provide a manual with shell commands to generate a secure key and explain how to test the random source.
(see also #3)

b) use a proper C++ library
Also include a parameter, which will send a huge amount of the used random to stdout for test purpose:

# user can test, if his library and random source are working.
$> stenc --test-rnd | entropy_checker
Shannon entropy is 8.8
@jonasstein jonasstein changed the title Get good random numbers by c++ function/lib, not via OS Get good random numbers externally, or by c++ function/lib but not via OS Apr 20, 2022
@jonasstein jonasstein added this to the 2.0.0 milestone Apr 24, 2022
@jonasstein
Copy link
Collaborator Author

(b) seems to cause the most work for us without any benefit. I like option (a) most. Users can use their beloved tool to generate the random key. Either a hardware TRNG, a set of tools on the commandline, or whatever. Our key generator will never be better than what the user already has.
But this change should go to a major milestone release, if we go this way. @ninthclowd what Do you think about it?

@ninthclowd
Copy link
Collaborator

Personally I like your idea of dropping key generation and leave it to tools that are built for that purpose. Maybe just update the man pages with an example of how to do so with openssl?

@jmwilson
Copy link
Contributor

I also think removing key generation and documenting how to use utilities makes the most sense. Off the top of my head openssl rand -hex 32 or xxd -p -l 32 -c 64 /dev/urandom do the job.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants