Author Topic: Words can't describe....  (Read 6916 times)

0 Members and 7 Guests are viewing this topic.

Offline MyndFyre

  • Boticulator Extraordinaire
  • x86
  • Hero Member
  • *****
  • Posts: 4540
  • The wait is over.
    • View Profile
    • JinxBot :: the evolution in boticulation
Re: Words can't describe....
« Reply #15 on: December 08, 2006, 07:53:00 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.
I have a programming folder, and I have nothing of value there

Running with Code has a new home!

Our species really annoys me.

Offline iago

  • Leader
  • Administrator
  • Hero Member
  • *****
  • Posts: 17914
  • Fnord.
    • View Profile
    • SkullSecurity
Re: Words can't describe....
« Reply #16 on: December 09, 2006, 02:12:40 pm »
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.