Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

/prog/ challenge

Name: Anonymous 2018-11-01 3:23

Write a source/compiled hash quine.

A quine is a program whose only output is its source in its entirety. Don't use cheats like wget/curl or something like that. You also can't just open a file and then have it output it that way. That's cheating too.

But to make things more interesting, it's not just a regular quine, because people have already done that. It's a quine whose source code file has a checksum that is the same as its compiled code. So not only does the compiled code have to output only the source code, but the checksums (using whatever hashing algorithm you want, probably a weaker one to make it easier) have to be identical, which sort of plays into the quine theme of outputting the same thing.

This will involve checksum collisions and brute-forcing/looping (I can't think of any methods other than guess and check). Possibly also padding or compiler flags.

Name: Anonymous 2018-11-01 3:27

Also, by ``padding'' I mean possibly adding semi-useless functions or data structures to affect the checksum. It won't change functionality, but it will affect the output. Now, depending on your compiler, it might omit things that aren't used, like if a variable is declared and initialized, but never used by anything. So you might have to get clever with your compiler too.

Fun fact: the concept of using arbitrary padding to change checksums is commonly used in malware because a lot of antivirus software methods are very simply and just do strings analysis or comparing checksums to known malware. But if all you do is change the checksum, without changing functionality, it will thwart these kinds of primitive malware checks. But now I'm going off on a tangent.

Name: Anonymous 2018-11-01 3:34

ONE LAST THING: I don't expect someone to actually get a quine whose compiled code's checksum matches the fuck I am high and forgot what I was writing.

You have to write a brute-forcing/quine-generating program that changes it, even if you never get the actual desired quine. But the idea is to make something that can produce its own output, but once you've figured out basic quine stuff, you write a quine generator that makes the attempts, so it will write the quine and then check if it matches and if not it will discard it and try again with different arbitrary padding, and it kind of increments with the padding until it gets a checksum collision.

When the input size is greater than the hash output of a checksum thing I am forgetting words right now, then you will get checksum pigeonholing. If you have 20 pigeons and 19 pigeonholes (number of inputs > number of outputs), you will inevitably get 2 pigeons in the same pigeonhole. So md5 and sha and all that shit also have the same problem, but it's time to sleep good night

Name: Anonymous 2018-11-01 7:36

Sounds NP complete.

Name: Anonymous 2018-11-01 12:30

>>4
https://www.google.com/search?&q=hashquine
other people have done it, why can't you?

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List