-
-
Notifications
You must be signed in to change notification settings - Fork 163
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
PRNG seeding is done totally wrong #238
Comments
Pass itself uses pwgen as password generator. Why don't we simply drop the other password generation option? @tezeb could you short explain, why are there only 28M possible Passwords? I don't fully understand the problem from your post. |
Main reason is Windows users don't have |
As far as I can tell step 2 seeds the pool . . The timestamps saved in step 4 and 5 have no relation to the time the pool was seeded in step 2. |
It's not 28M passwords, but 28M PRNG seeds(although it's really close in that case). PRNG use seed value as a starting point to generate sequence of numbers. As PRNG's are reproducible, every time they are seeded with the same value, they produce the same sequence of numbers. So if you know the seed, you know exactly all numbers that were generated, thus you know the sequence of characters that were generated for password. As we seed with a timedate value with a seconds resolution we got: This will be more complicated to fix than it seems, as support for random_devices across systems/compilers is random at best ie. MinGW for Windows, does not provide it and fallbacks to 0-preseeded Marsene Twister. |
Actually they do. They give you upper bound for searching the seed used. Decrement from there. No one is running their Windows longer than 12h? 24h? a week maybe?... |
I have to agree with @tezeb you can assume the time between storing your password and starting QtPass is somewhere in the hours range, limiting the number of possible passwords for any given entry (with default settings) to thousands . . |
The least that can be done is to use miliseconds resolution for qsrand. |
Yes, the milliseconds I noticed too @tezeb .. best options still seems to be to switch to the pwgen method or the I'll have some people with crypto background weigh in on this too before committing to a solution for the upcoming release. |
Related #276 |
I think this requires a standalone issue(not only pull request) as I belive that it has huge impact on users security.
Fix from commit 961530c is, well, almost pointless. It can be used as a textbook example of why non-cryptographers should not implement crypto-related algorithms.
What happens now(setup with no pwgen and git enabled):
On the bright side, (afaik) it won't tell passwords straight away with offline attack on password-store(thx to GPG). There is also no way to discover method used for password generation. But it is possible to create all passwords that were created(right now around 28M seeds) by all users of QtPass that were not using pwgen.
Please see pwgen source for reference on PRNG seeding:
https://github.com/jbernard/pwgen/blob/master/randnum.c
as for the c++ using might be a solution.
http://www.cplusplus.com/reference/random/
The text was updated successfully, but these errors were encountered: