4 ms·
All Underhanded Crypto Entries
- pronoiac 12y agoIt's a shame there's no commentary, and they're not easily readable - they're offering tar.gz files. Maybe post them to Github?
- gizmo686 12y agoSome of the files contains descriptive READMEs.
- xai3luGi 12y agoTry using this command on the files: tar xf foo.tar.gz
- pronoiac 12y agoIt may have made more sense if I mentioned I'm on mobile. Maybe I'll make the repo when I finish doing laundry.
- simcop2387 12y agoI went and made a repo for them all https://github.com/simcop2387/underhanded-crypto https://github.com/simcop2387/underhanded-crypto
- pronoiac 12y agoI cleaned it up and added links, and sent a pull request.
- simcop2387 12y agoMerged!
- ryan-c 12y agoNo judge commentary (I'm a little disappointed, I was hoping someone would comment on the constant I used), but most of the entries are documented. I put my own entry on github last week for easier reading: https://github.com/ryancdotorg/undercrypto2014 https://github.com/ryancdotorg/undercrypto2014 The README was added later (wasn't in the actual entry) - it explains what the other files are. As mentioned elsewhere in the comments, all the entries are in this repo: https://github.com/simcop2387/underhanded-crypto https://github.com/simcop2387/underhanded-crypto
- tlb 12y agoJohnMeacham's entry is some diabolical shit. I've been burned by that same bug, along the lines of: bool foo = rx&0x0800; // set foo if 11th bit of rx is true which works in C++ or if you have stdbool, but not if you have 'typedef char bool' which occurs in header files of projects that should know better.
- microarchitect 12y agoHonestly, 8/16b ints in C and C++ are just a minefield of problems. Here's a snippet from an open source 8051 simulator that I was debugging today: if( ((RAM[ACC] & 0xF0) >> 4) > 9 || GetBit(RAM[PSW], CY) == 0x01 ) { tempAdd = RAM[ACC] + 0x60; RAM[ACC] = tempAdd; if( ((unsigned char*)&tempAdd)[1] != 0 ) { SetBit(RAM[PSW], CY); } } The code is supposed to set the carry flag when RAM[ACC] + 0x60 overflows into two bytes. Can you spot the bug? It involves my favorite C++ feature: implicit conversions, and my second favorite feature: signed chars. The bug is that when RAM[ACC] is something like 0xFF, it gets cast to (int) -1 so the the upper byte and hence the carry flag never get set. I predict there's lots more more evil that can milked from this fount.
- copsarebastards 12y agoThis is one of those examples where I can see how it's confusing, but I just don't think you should have been doing it that way in the first place. bool foo = (rx & 0x0800) == 0x0800; Not only does this not have the bug, it communicates your intent better, and modern compilers are quite capable of optimizing this.
- sarciszewski 12y agoMy entry is pretty lame in comparison to the rest of them. I think the judges did a phenomenal job picking the finalists.
- sarciszewski 12y agoEr, okay, anyone care to explain why they downvoted this? I participated in this contest and was blown away by a lot of the ingenuity the other contestants demonstrated. The judges clearly did not have an easy time picking the winners, but I think they did a very good job at being fair about it.
- hurin 12y agoThe second winner (Leurent) looks like a very weak entry to me.
- ryan-c 12y agoI'm curious why you say that. I found it very impressive from a technical standpoint.