News:

Help! We're trapped in the computer, and the computer is trapped in 2008! Someone call the time police!

Main Menu

Words can't describe....

Started by MyndFyre, December 06, 2006, 03:53:57 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

MyndFyre

Quote from: iago on December 08, 2006, 08:27:39 AM
Quote from: MyndFyrex86] link=topic=8090.msg101887#msg101887 date=1165539120]
Quote from: unTactical on December 06, 2006, 05:49:02 PM
Yea... I think it's less random than the API's Random.

It's definitely no more random than the API's.  Random without a seed will produce the same sequence given the same start time.  So will this.  The only difference is, Random is mathematically distributed, whereas hashing is not.

Hashing isn't?  I thought the point of a good hashing algorithm is that it IS randomly distributed?

Well, I said "mathematically distributed," not "randomly distributed."

In any case, Random when initialized without a seed will produce a sequence of numbers based on the system time when it is first initialized.

Producing a hash of static input will always produce the same result.  Hashing isn't about producing random output but about producing consistent output given arbitrary input; in some measures, a CRC32 (32-bit cyclic redundancy check) could be considered a hash because it always produces the same output given the same input.

The "randomness" of a given function is a characteristic of how much input difference is required to get different output.  In this case, since the input difference that really makes the difference is the system time, they are equally random.
Quote from: Joe on January 23, 2011, 11:47:54 PM
I have a programming folder, and I have nothing of value there

Running with Code has a new home!

Quote from: Rule on May 26, 2009, 02:02:12 PMOur species really annoys me.

iago

Quote from: MyndFyrex86] link=topic=8090.msg102004#msg102004 date=1165625580]
Well, I said "mathematically distributed," not "randomly distributed."

In any case, Random when initialized without a seed will produce a sequence of numbers based on the system time when it is first initialized.

Producing a hash of static input will always produce the same result.  Hashing isn't about producing random output but about producing consistent output given arbitrary input; in some measures, a CRC32 (32-bit cyclic redundancy check) could be considered a hash because it always produces the same output given the same input.

The "randomness" of a given function is a characteristic of how much input difference is required to get different output.  In this case, since the input difference that really makes the difference is the system time, they are equally random.
"Producing a hash of static input will always produce the same result" is correct, but like you said, using a random function with static input will, as well.  If you seed a good hash function and you seed a good random function, both with random values, you should get comparably secure outputs. 

Both hash functions and random functions are designed to distribute the result evenly/randomly/unpredictably. 

The main difference between the two is that hash functions are far, far slower than random functions, so it's not realistic to use them in many cases.  But given a proper seed, I don't think there's a huge difference.