News for hackers. Stuff that matters.
Re:Hashify.me - store entire website content in the URL by mlinksva on Tuesday April 19, 2011 @05:42PM (#2464355)
Nice hack, though odd name given that no hashing occurs.
Re:Hashify.me - store entire website content in the URL by jerf on Tuesday April 19, 2011 @05:59PM (#2464401)
Technically, if you squint hard enough, and assuming that Bit.ly always shortens the same URL to the same code (which on my brief testing it did when I tried the same URL from two different browsers), a one-way hashing function is being created from bit.ly shortened URLs -> the full "hashed" document. Technically. It certainly lacks most of the usual properties we associate with hash functions but the bare skeleton is sort of there. And there's no way to feasibly reverse that hash function algorithmically short of keeping the original input table and querying that, which is how Bit.ly of course works.
Re:Hashify.me - store entire website content in the URL by albertsun on Tuesday April 19, 2011 @06:20PM (#2464462)
bit.ly does not always shorten the same URL to the same code
Re:Hashify.me - store entire website content in the URL by hashify on Tuesday April 19, 2011 @09:10PM (#2464851)
> Nice hack, though odd name given that no hashing occurs.

When I registered the domain I imagined that state would be stored in a Twitter-style hashbang. Thanks to `history.pushState` and `history.replaceState`, this hack is not required in modern browsers. :)

Re:Hashify.me - store entire website content in the URL by techscruggs on Tuesday April 19, 2011 @05:58PM (#2464399)
Base64 is a two-way hash function
Re:Hashify.me - store entire website content in the URL by jerf on Tuesday April 19, 2011 @06:01PM (#2464406)
"Two-way hash function" is an oxymoron. The fundamental characteristic of a function that makes it a hash function is the inability to (feasibly) reverse it.

Base64 is an encoding.

Re:Hashify.me - store entire website content in the URL by masterzora on Tuesday April 19, 2011 @06:25PM (#2464477)
I agree with your final conclusion, that Base64 is an encoding, but it is also a hash function and hash functions can very well be two-way. In fact, the trivial hash function just maps data to itself, which is trivially reversible. However, we do want our cryptographic hash functions to be trapdoors to be of use.
Re:Hashify.me - store entire website content in the URL by ay on Tuesday April 19, 2011 @07:51PM (#2464709)
Trapdoor function means the function is easy to calculate in one direction, but is difficult to calculate in the other direction without knowing a special bit of information that allows this calculation much easier.

What would a trapdoor value be for SHA1 ?

What I can agree is that I would like the cryptographic hash to be a one-way function, yes. But not trapdoor functions, please :-)

(and can you point to the definition of the hash functions that you described ? I'm curious).

Re:Hashify.me - store entire website content in the URL by masterzora on Wednesday April 20, 2011 @12:34AM (#2465261)
> What would a trapdoor value be for SHA1 ? Okay, you got me there. It's been long enough since I've actually used the term that I seemed to have remembered it being the same as one-way. Oops.

As for the parenthetical, I'm not sure I take your meaning properly. If you are asking where I learned that hash functions don't have to be one way it seems to be an odd question, but I just checked Wikipedia and it agrees with me, at least.

Re:Hashify.me - store entire website content in the URL by ay on Wednesday April 20, 2011 @07:16AM (#2466123)
"Okay, you got me there." - it was not really intended as a trick - sorry for the wording.

As for the trivial hash - now I scrolled down the page on Wikipedia, indeed. I never thought of it this way. (That an identity function on an integer would deserve to be called a hash function :-)

The part that got me was the initial sentence about hash function converting "large, possibly variable amount of data" into a "small datum". As "large" and "small" are implied to be of different sizes, I glazed over a possibility of identity function there.

Thanks!

Re:Hashify.me - store entire website content in the URL by masterzora on Wednesday April 20, 2011 @07:22AM (#2466135)
Oh, I didn't think you intended to trick me. Perhaps some context that'd help you understand my state of mind when I wrote that: while I may be a dev and hacker professionally and as a hobby, I went to university in mathematics specialising in number theory. I'm expected to know silly things like the difference between "one way function" and "trapdoor function", so it's a touch off-putting when I forget.
Re:Hashify.me - store entire website content in the URL by ay on Wednesday April 20, 2011 @08:08AM (#2466229)
I know what you mean. For me it was: "Hm. he wrote that with a good confidence. Which part of my knowledge is wrong or incomplete ?" :-) Kind of the same feeling when the significant other garbage-collects a pen you put on the table just a few minutes ago.
Re:Hashify.me - store entire website content in the URL by ubershmekel on Tuesday April 19, 2011 @06:12PM (#2464445)
"Two-way hash function" is a contradiction. An oxymoron is a figure of speech that combines contradictory xterms.