| Forums | Register | Reply | Search | Statistics | Manual |
Main Forum Booru / Main Forum /

What hash function is used for naming images?

Author Gamen
Guest
#1 | Posted: 14 Jan 2012 16:28 
Odd question, I know. But after I had saved a few images from a booru I noticed that the filenames were longer and I was curious. I think nearly everyone else uses MD5. Since booru.org images have 40 hex characters, I thought it might be sha-1, or when that didn't pan out ripemd-160 or tiger, but it doesn't seem to be any of those or any other common hash with a larger output that's been truncated to 160 bits.

So what is it? And why use something other than MD5? If it's because MD5 is sort of broken (not that I can see why that would matter when you are using it to detect identical files and not authenticating them), why not choose a different standard that's not broken?

Thanks for humoring my question.
Author Proger_XP
Registered
#2 | Posted: 14 Jan 2012 16:46 
That's question to the Gelbooru authors, not us (we're only using their work). However, I can answer your question.

The Gelbooru author who made the hashing function applies SHA-1 to MD5 hashes. I don't think that this is a good idea and many other people don't seem to do so too (read the internets) because this doesn't make much sense, especially since MD5 is used as a hex string (32 chars) instead of raw hash (4x4 DWords, 128-bit). This seems more like downgrading hash to me.

I've seen some other sites using the same approach - for example, some Shimmie boards.
Author Gamen
Guest
#3 | Posted: 14 Jan 2012 21:09 
I didn't even realize Gelbooru used that scheme; it looks like they switched back to MD5, probably because it is senseless. However, reading their forums it looks like Gelbooru was using the sha-1 hash of the original filename, not the sha-1 of the hex representation of the md5 hash of the file.

Sorry for implying it was booru.org's hare-brained idea.
Author Proger_XP
Registered
#4 | Posted: 15 Jan 2012 04:50 
Gamen:
looks like Gelbooru was using the sha-1 hash of the original filename

Actually this is not - I've studied the engine's code. Upload is handled by classes/image.class which contains stuff like $filename = hash('sha1',hash('md5',$url)); all around.

And it's the same with password hashes, btw - they're generated from SHA-1 of MD5 of the password string. I guess it's the approach "the more hashing the better stuff", lol.
Main Forum Booru / Main Forum / What hash function is used for naming images? Top
Your Reply Click this icon to move up to the quoted message
 

 ?
You are welcome to post anonymously, by entering a nickname with no password (if the similar Username has not been taken yet), or by leaving both fields empty. If you have a forums account, you can also sign in from this page without posting a message, or sign in and post at once.
[ANTISPAM] Enter letter "U" here:
 
  Booru Powered by Forum Script miniBB ®