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

[Fucking stupid] Bad programming ideas [WTF]

Name: Anonymous 2008-04-28 16:29

Here's a thread where you can post retarded software/programming related ideas you read or saw on the internets. Retarded code from ENTERPRISE is fine too, but please don't turn this into “Retards writing Java” thread. You can think of it as /prog/'s own DailyWTF, only with less Java programmers and people laughing at stuff that they really don't understand. I'll start with a post from /a/:

I have been thinking about a P2P client which requests bytes from people who may not necessarily have the file they're downloading, but they have those specific bytes (which may be from another file), and the P2P client is designed to request the closed peer with those bytes, despite not having the file. So, it wouldn't matter if a torrent was dead, you'd just have to search other peers for those specific bytes.

It would have to be some sort of index of hashes of those bytes which would determine who sent them...


Name: Anonymous 2008-04-29 20:14

>>40
Not in our lifetime using our current technologies. This is a job for quantum computing.

Name: Anonymous 2008-04-29 20:17

>>41
*fapfapfapfapfapfapfapfapfapfapfap*

Name: Anonymous 2008-04-29 22:22

>>1-43
wat

Name: Anonymous 2008-04-30 0:23

>>40
Processing power is growing exponentially; soon we will be able to rebuild files based on its MD5 hashes and their size.
No, we wont. You can't use a 128-bit hash to completely characterize an input of arbitrary length. For a input of length n bits, you'd have 2n - 2128 hash collisions. Assuming an equally distributed hash, that means
2n - 2128
-----------
    n
of the collision-causing inputs would be of length n. For any n > 128, this works out to a really fucking big number.

In other words, even if you had the computing power to enumerate all the files that hash to a particular value, you'd still have the problem of choosing the real original file among many plausible candidates, despite the fact that its length is known.

HIBT?

Name: Anonymous 2008-04-30 1:29

>>21,36
Same person

Name: Anonymous 2008-04-30 2:01

ahahahhaa this fuckin thread

Name: Anonymous 2008-04-30 5:40

In other words, even if you had the computing power to enumerate all the files that hash to a particular value, you'd still have the problem of choosing the real original file among many plausible candidates, despite the fact that its length is known.

Are there any old, broken hashes or checksums for which you can iterate all possible inputs of a fixed length that fulfill them without going brute force?  I'm thinking about small lengths, like 16 bytes with obviously a smaller hash.

Name: Anonymous 2008-04-30 5:46

>>47
there's md4, which is (obviously) like md5, except presumably shitter in some way i don't really know

Name: Anonymous 2008-04-30 5:49

>>44
Yes but you can trim those possibilities down for files that have a distinguishable file format, such as AVI and BMP.

Name: Anonymous 2008-04-30 21:12

>>47,48,49
I wouldn't use a hash algorithm designed for encryption. They are good for checksuming, though.

What we need is nearer to compression. A quick idea[1] i'm thinking: divide the file in 1KB blocks, and hash each one in 8 bits. Every few bytes, a short checksum is added. The decompressor would have many possibilities per block, but most should be discarded by the partial checksums. At the end, it checks every possible block combination againist a global, reliable hash, like SHA-1. The whole thing may be compressed recursively if it's >1kb, and block sizes may vary, but that would require a container format.

[1]: still insane.

Name: Anonymous 2008-04-30 23:04

>>50

[1]: still insane.

/prog/: insane ideas taken seriously.

Name: Anonymous 2008-05-01 8:58

>>47
Sure, try sum of one's complements, like the checksum in IP packets.

Name: Anonymous 2008-05-01 9:36

>>50
8 bit hashes? for 1KB? that gives 255 possible hashes for about 10^300 inputs. Thats 10^298 for each hash. GB2 highschool

Name: Anonymous 2008-05-01 9:44

>>53
How about 1 bit hashes?

Name: Anonymous 2008-05-01 9:56

>>54
parity?

Name: Anonymous 2008-05-01 10:06

>>55
Is it cool?

Name: Anonymous 2008-05-01 10:42

>>1-56
Same person and we have been anushaxed constantly.

Name: hax my anus 2008-05-01 10:51

Did I hear anus haxing is in process?

Name: HAX MY ANUS MEME FAN 2008-05-01 11:08

>>58
I do think so good sir.

Name: Anonymous 2008-05-02 23:18

Oh god, people are still trying to think of ways this would work.

It won't work.

Go back to /pr/.

Name: Anonymous 2008-05-03 1:23

>>22
Thats fucking hilarious

Name: Anonymous 2008-05-04 0:32

>>53
MD5/SHA1 is worse. And I'm still in high school, lol.

Name: Anonymous 2008-05-04 0:54

/r/ underage b& for >>62

Name: Anonymous 2008-05-04 3:32

Name: Anonymous 2008-05-04 6:13

>>64
Hi, been a long time lurker on this board.. but I feel I have to speak out at this moment.

Never on The 4Chan Programming board have I seen someone be so funny and with no provocation, I lol'd.

that was amusing and just plain hilarious.

Name: Anonymous 2008-05-04 8:02

>>64
All it takes to crash his program is to call it like this:
./program
Awesome!

u_int8_t
bitcount(u_int8_t byte) {
         u_int8_t bits = 0;
         int bit;
         for(bit = 0; bit < 8; bit++)
                 if (byte & (0x01 << bit))
                         bits++;
         return bits;
}

Can be changed as

uint8_t bitcount(uint8_t byte) {
  uint32_t tmp = byte;
  tmp = tmp - ((tmp >> 1) & 033333333333) - ((tmp >> 2) & 011111111111);
  return ((tmp + (tmp >> 3)) & 030707070707) & ((1<<6)-1);
}


And a shitload of mistakes and shit... fuck it. fuck that shit. rm -rf ./hzip-0.2; fortune

The bay-trees in our country are all wither'd
And meteors fright the fixed stars of heaven;
The pale-faced moon looks bloody on the earth
And lean-look'd prophets whisper fearful change.
These signs forerun the death or fall of kings.
                -- Wm. Shakespeare, "Richard II"

Name: Anonymous 2008-05-04 14:32

>>63
I'd prefer to ban those who spam /prog/ with ``hacks'' and ``grabs'' first. Your request is completely arbitrary and nonsensical, since this is a worksafe textboard with no ``adult'' content or /b/ faggotry around. Also, there are no mods in /prog/. HYBTT?

Name: Anonymous 2008-05-06 3:27

Name: Anonymous 2008-05-06 4:27

[/WTF][/Fucking stupid]

Name: Anonymous 2008-05-06 5:52

>>67
Has been anus haxed

Name: Anonymous 2008-05-06 6:39

>>55
PARITY HARD

Name: Anonymous 2008-05-06 6:54

>>53
8 bit hashes? for 1KB? that gives 255 possible hashes for about 10^300 inputs. Thats 10^298 for each hash. GB2 highschool
Actually 256 possible hashes.

Name: Anonymous 2008-05-06 7:17

>>72
That makes all the difference then.

Name: yay 2008-09-07 20:18

w00t

Name: Anonymous 2008-09-08 8:25

OP you know what's retarded? This thread is retarded.

Name: Bro 2008-09-08 20:25

Bro, that was uncalled for. Why the h8, bro?

Name: Anonymous 2008-09-08 21:04

>>75
I think that's the point.

Name: Anonymous 2008-09-09 0:49

>>40
You are obviously a retard, friend.

Name: Anonymous 2009-01-09 0:49

>>78
considering that MD5 is entirely, completely broken, that's not far off.

Name: Anonymous 2009-07-21 2:48

>>21
I real numbers. and numbers about mention real Myspace. need  for  can command them has EMAACS mode. vim EMAACS mode. which is SD number in ) TYPE enter ud number UNICODE I ALL ARE I UNICODE SAID AND

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