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

Can I use a random number generator to get hashes, seeding it

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 8
Thread images: 1

File: 200px-Reiser_mug.jpg (11KB, 200x267px) Image search: [Google]
200px-Reiser_mug.jpg
11KB, 200x267px
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 posts: 8
Thread images: 1


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

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
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.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.