dexios
dexios copied to clipboard
Question: Why not ThreadRng?
The documentation shows that ThreadRng is safer than StdRng::from_entropy
Unlike StdRng, ThreadRng uses the ReseedingRng wrapper to reseed the PRNG from fresh entropy every 64 kiB of random data as well as after a fork on Unix (though not quite immediately; see documentation of ReseedingRng). Note that the reseeding is done as an extra precaution against side-channel attacks and mis-use (e.g. if somehow weak entropy were supplied initially). The PRNG algorithms used are assumed to be secure.
Correct me if I'm wrong.
Both are seeded from the same source, just ThreadRng has an extra wrapper. Both are sufficient security-wise, as mentioned here in the docs.
We could make the switch if necessary, but I'm impartial to it.
EDIT: The additional protection against side-channel attacks seems worth it in my eyes.
@pleshevskiy I tried to contact you by email but Yandex filtered it as spam. I wanted to let you know that I probably won't be too active over the next few days as my country is due a major heat wave, with the highest temperatures that we've seen before.
I apologise for this, and hope to get back to fully working on Dexios very, very soon :)
Thank you very much for the important information! Take care of yourself!!! I will look forward to hearing from you :)
Thank you very much for the important information! Take care of yourself!!! I will look forward to hearing from you :)
Things are cooling down, so I'll work on it as much as I can. Tomorrow is going to be a lot worse though rip
I'll get ThreadRng
implemented first :)
@pleshevskiy What's up with everything grabbing things such as gen_salt
from the utils.rs
file? Are they just re-directed to the core crate? I'm going to add master key generation to the core, so they're all in one place and got curious :))
@brxken128 For tests, I need to be able to specify SEED so that the result of the tests is always the same. Ideally, We should make a struct/trait that works with multiple RandCore implementations (ThreadRng, StdRng)
@brxken128 For tests, I need to be able to specify SEED so that the result of the tests is always the same. Ideally, We should make a struct/trait that works with multiple RandCore implementations (ThreadRng, StdRng)
Would an enum-based approach be adequate for this? I can probably get to work on that if so - I'd just need a list of everything that should be included.
@brxken128 I don't think so) If you want you can be inspired by the storage.
For example: trait Generator
, struct AutoSeedGenerator
, struct StaticSeedGenerator
I'd just need a list of everything that should be included.
A search showed that only 3 functions use random. If you know any others, they should be added here too.
Closing this as ThreadRng
has been in use since #136.