Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 532 Vote(s) - 3.43 Average
  • 1
  • 2
  • 3
  • 4
  • 5
C++ True Random Generator

#1
Found on my old files tought it might be helpful to members

Hidden Content
You must

[To see links please register here]

or

[To see links please register here]

to view this content.

Reply

#2
Nononononononononononononononono.

Please.


No.

Seeding with the time at program start is really really bad.

Like, really bad.

Reaaallly bad.
Reply

#3
Quote:(12-15-2013, 11:07 PM)w00t Wrote:

[To see links please register here]

Nononononononononononononononono.

Please.


No.

Seeding with the time at program start is really really bad.

Like, really bad.

Reaaallly bad.

What do you suggest ?
Reply

#4

Hidden Content
You must

[To see links please register here]

or

[To see links please register here]

to view this content.


Much more random, as the amount of time it would take every loop is random.
Reply

#5
Quote:(12-16-2013, 12:12 AM)The_Joker Wrote:

[To see links please register here]

This is far from a truly random number generator. At very best you could call this pseudo-random.

Computers don't understand the concept of random. You need to give them something to start with, then manipulate. In this case, the seed is the system time, which is a poor system, are there are a very finite number of system times available. If you wanted to increase the randomness, you would need to include other seeds such as keystroke patterns and mouse position. Many cryptographic algorithms have been broken due to a weak random number generator.

Of course its not that complex you cant use it in gambling machines or anything like that it but its usefull for game devs or other simple tasks.
Reply

#6
Quote:(12-15-2013, 10:42 PM)Night Owl Wrote:

[To see links please register here]

Found on my old files tought it might be helpful to members

Hidden Content
You must

[To see links please register here]

or

[To see links please register here]

to view this content.

This is far from a truly random number generator. At very best you could call this pseudo-random.

Computers don't understand the concept of random. You need to give them something to start with, then manipulate. In this case, the seed is the system time, which is a poor system, are there are a very finite number of system times available. If you wanted to increase the randomness, you would need to include other seeds such as keystroke patterns and mouse position. Many cryptographic algorithms have been broken due to a weak random number generator.
Reply

#7
Quote:(12-16-2013, 12:23 AM)w00t Wrote:

[To see links please register here]


Hidden Content
You must

[To see links please register here]

or

[To see links please register here]

to view this content.


Much more random, as the amount of time it would take every loop is random.

**is more random; These calculations are still all pseudo-random. Most of the time you don't really need something as random as you can get an algorithm to randomize things however. Even a good random generator still has possibility to generate suspicious non-random values. You can't get true random anyways. By all means, one *could* waste all the computing time they want to have something that works, but you've probably lost more than you've gained in doing so, depending on how much work you put into getting a more pseudorandom value.
Reply

#8
Well, yes, deterministic machines can't create real randomness. A good PRNG passes 3 tests I can't recall in detail right now, but basically thousands of numbers are generated and the PRNG fails if any number, sequence of numbers, or multiples of a number are more common than any other number( usually with a percent or so leeway ).
Reply

#9
This reminds me of an article I read not all too long ago.

[To see links please register here]



Basically it's what cxS said, but explained in depth.
Reply

#10
Theoretically, the more *random* you get, the more pseudorandom you get. Because to be truly random, the possibility of there being repetition in "randomness" is a likely possibility, just as much as there being diversity. And to play devils advocate, if you're going for a new number every time to hit those characteristics, the more predictable it becomes that you won't get the same number the second time around, thus, less random. This is one of the reasons why I don't really care for something that others may consider super random, because it's not really realistic; random. The irony. :smile:

The only time it matters is if your specific case is special and you need those numbers to hit differently the majority of the time.
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through