[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
Can I use a random number generator to get hashes, seeding it
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /sci/ - Science & Math

Thread replies: 8
Thread images: 1
File: 200px-Reiser_mug.jpg (11 KB, 200x267) Image search: [Google]
200px-Reiser_mug.jpg
11 KB, 200x267
Can I use a random number generator to get hashes, seeding it with whatever I want to hash?
>>
>>7972370
Depends on the generator. Some also take time as a parameter.
>>
>>7972370
you can but it's extremely inefficient
and extremely likely to produce collisions
>>
>>7972370
A hash algorithm should produce the same output every time you provide a given input. That's why they're useful for security.
>>
>>7973008

This is false.

A deterministic pseudo-random number generator will always generate the same sequence given the same seed.

The fact that a hash produces the same output given the same input is not the most important quality of a hash function; by definition, a function will map any one input to exactly one output, so any hash -function- will produce the same output given the same input trivially. In the most common use cases, the most important quality of a hash function is the fact that it is, in some formal sense, hard to come up with two inputs X and Y such that H(X) = H(Y), otherwise known as finding collisions.

As an example related to show why what you say is false, let's say that you're building a system that uses passwords. Because it's against the law to store passwords in plain text, you opt to store your passwords in hashed format, using some hash function H. To verify that the user is using the right password, for password P, you simply check to see if H(P) = stored hash.

Now let's say I take a hash function that is secure by your terms, a hash function that simply has the quality that, for the same input, it maps to the same output: H(P) = 1 for all P satisfies this property. You register yourself on the system using "password123" as your password; the system stores H("password123") = 1. I come in, enter your username, and enter anything, and I can log in, because H(P) = H("password123") = 1 for any input P.

It's also important to note that hash functions aren't just important for security, and it's not necessarily true that a hash function good for security is good for another purpose (or vice versa). For example, you can devise locality-preserving hash functions that are useful for improving search times over arbitrary vectors. Similarly, you can devise hash functions for the specific goal of optimizing traversal over a data structure given some assumption about the distribution of expected inputs.

(cont)
>>
>>7973049
Don't be obtuse, anon. You know that's not what I'm talking about.
>>
>>7973049

The problem with OP's suggestion, from a high-level point of scrutiny, is that the hash specified isn't accompanied by a description of its intended use.

My question to OP is this: in what context would you be using this hash function?
>>
>>7973054

I honestly have no clue what you're talking about. I can't even come to think of any non-trivial formal notion of security where the primary requirement on a hash function is that it just produce the same output given the same input between evaluations.
Thread replies: 8
Thread images: 1

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.