flat assembler
Message board for the users of flat assembler.

Index > Windows > How to generate random numbers?

Goto page Previous  1, 2, 3
Author
Thread Post new topic Reply to topic
Furs



Joined: 04 Mar 2016
Posts: 2565
Furs 01 Jun 2022, 13:01
revolution wrote:
Random generators of bits don't appear in the source code. They are random, that's the point. Each time you run to code it works with different values from the generator.

If the RNG is some hardware component, or some external component (like network timing, keystroke timing, mouse movements, clock drift, etc.), then it is fine for the software source code to be open, the data don't come from the source code. The software only works with the data it is given. Unpredictable data in => secure outputs.

It's all a solved problem. Cryptographers actually only consider something secure if they can see all the inner workings and still can't predict the outputs. Or they treat it with suspicion if it is a secret and can't examine it.

Intel, what are you hiding? Show your implementation and prove it is genuine.
Why does it matter? I seriously don't understand your skepticism.

Someone said to use rdtsc as a seed source. rdtsc is clearly defined how it works and you can even predict it (based on when the app was ran). Even if the NSA could predict rdrand the same way it can't be worse than rdtsc, since they can clearly do it for rdtsc as well.

So rdrand is at least as good as any other "known" source. Security by obfuscation is not worse than "open" sources that you already know anyway, in fact it takes extra step to find out how it works, even if you're the NSA. Sure such steps might be trivial, but it can't be worse.

Next you're gonna say "well if you use rdrand just for source it should be fine", but then you also said that "mixing bits" is pointless if the source is bad, so...? Isn't that what you're doing with a prng and rdtsc seed...?
Post 01 Jun 2022, 13:01
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20451
Location: In your JS exploiting you and your system
revolution 01 Jun 2022, 13:11
rdtsc is not random, it can be predicted.

rdrand might be fully random, or only be somewhat random, or maybe not random at all, Intel won't show us.

Keystrokes timing, clock drift/skew/jitter, other known good sources of real random data can't be predicted. So use those if you need actual random data.

Cryptographers demand all code and hardware to be open sourced, so it can be examined and analysed. It is part of the process to be considered good for use. It isn't security by obfuscation, it is the opposite, it is security by clearly demonstrated "nothing to hide", just good pure randomness emanating from the system.

rdrand is security by declaration. Intel says "trust us". Lol, nope, sorry it doesn't work that way.


Last edited by revolution on 01 Jun 2022, 14:23; edited 1 time in total
Post 01 Jun 2022, 13:11
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20451
Location: In your JS exploiting you and your system
revolution 01 Jun 2022, 13:16
Furs wrote:
Next you're gonna say "well if you use rdrand just for source it should be fine", but then you also said that "mixing bits" is pointless if the source is bad, so...? Isn't that what you're doing with a prng and rdtsc seed...?
What I actually said was for " non-cryptographic purposes it will be fine"

Something trivial like choosing a "random" tip of the day, or similar, it's fine, do whatever.

Totally different if you want to create secure keys for your Bitlocker disks. Don't use insecure sources, or unverified sources, for those.
Post 01 Jun 2022, 13:16
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page Previous  1, 2, 3

< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.