- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
Admin
If it makes you feel better, I would have given you 7 or 8/10.
Admin
Admin
You really have to cut down on coffee!
Admin
You guys do realize that geoffrey and his other sock puppets are just waiting for you to bite, right?
Wait, did I just ...
... damnit!
Admin
You've clearly missed the point. EVERYBODY makes them from sand. You should make your CPUs from wood, or from helium.
Admin
In Soviet Russia, password hashes YOU!
Admin
I can't recommend helium. Anchoring the machine to the desk has been a real nuisance, and it's really hard to get the speech synthesizers to output at the correct pitch.
Wood might work, but you have to manage project discipline...
...
... you wouldn't want to have to deal with a splinter group.
Admin
Admin
Admin
Glass is also good matrial to meke CPU. Samsung company has build several CPU from glass. They will release to market in 2015.
Admin
Seems like a good place to hide your stash.
Admin
Admin
Tell you what, you can even write it in COBOL if you want.
Admin
HAAAA-ha! You have fucked up the quote integrity! By the rules of TDWTF argumentation, that means YOU HAVE LOST! FOAD!
Admin
Admin
Gotcha. There is only one way that could have been designed with the parameters you have supplied (including the fact that it took 120 hours of dev time. I have taken that into account and have written a program that cracks your DB wide open.
I pwn you.
Admin
I believe Jay meant it so: Start with helium. Fuse it to obtain necessary elements (Si, O, P, ..). Then build a CPU.
Admin
Hey, didn't Melanie do a song about that?
"Look what they've done to my dogma, Look what they've done to my dogma, Turned it round, inside out, gave it quite a snog, ma Look what they've done to my dogma ..."
Admin
Well, thanks everyone for one of the funnier threads here. (Even if I'm not completely certain which of the comments were deliberately funny.)
Admin
It's also conceivable that strong_crypt1(strong_crypt2(x)) is actually weaker than either strong_crypt2 or strong_crypt2 for similar reasons: you may make from two functions that are (maybe not everywhere, but generally) one-password-to-one-crypt-value into one function that is (generally) many-passwords-to-one-crypt-value. I wouldn't know if that could happen with the given functions, but as I recall, it's a well known possible scenario with encryption of any sort.
Admin
Reinventing wheels is essential for the purposes of education. Part of any comprehensive education system in learning how to get computers to do stuff should include bits where you get the noobs to create standard building blocks.
When I trained, they got us first writing a variety of sort routines, then a calendar, then an emulator / disassembler of a simple CPU (they were simple enough in those days for this to be feasible), and then they let us loose on real stuff (with the caveat to always use the library routines because they were better than the shit we wrote).
Admin
I am sad this is a troll. I thought, just maybe, there is still an OS370 gray hair still bent on ISAM as the One True Way(tm). The bit about using SQL is somewhat reasonable (I really hate XPATH) but then bashing RDBMS in general. No big iron machine accountant would cross IBM that way...
Admin
(md5(sha1(sha2(mcrypt_cbc($password)))))
It's not uncommon to hash multiple times, but usually you would be appending a salt in between each hash:
$hashed_salted_pass = sha1(sha1($password).$salt);
You wouldn't just hash the digest of the previous hash directly. That's kind of pointless.
Also, why would anyone hash a more secure digest (sha1) with a smaller, and less secure digest (md5)? The addition of the md5 function actually makes it less secure, than if they would just have left it out.
It's also arguable whether it's worth encrypting the password itself before hashing it... Since this encryption involves a key that must be stored somewhere (example: in a config), so if someone compromised the host machine and had access to the database, then they would likely also have the key.
Admin
Whatever happened to Top Cod3r I miss him.
Admin
Iron several others are fluorine you with our puns. You wouldn't lead us go on boron you so it's back to chlorine your way back up the greasy pol-onium about to gold down with flu-orine your case I'd just say: 'tin right.
Admin
As of knowing order of hash functions read about Kerckhoffs's principle
Function h = H(m) (hash function) generates b-bit length "pseudorandom" noise if it is secure (yes - I know it strange but the function is both constant and "random"). Applying it twice lowers the security further due as if probability of 2 hashes (one chosen and one random) having the same hash is 1:2^b but the probability of hashes of hashes to be the same is (1/2^b + (1 - 1/2^b)*1/2^b) i.e. approximately 1/2^(b-1) assuming 0 ≪ b. In general, if I haven't made any stupid error, you get approximately 1/2^(b-n) chance of succeeding after n tries (assuming n ⋘ b and 0 ≪ b). That's not a big problem for small n but still it exists.
You reduces the search space for offline attacks. To simplify I will use 2 hashes H(H'(m)) where m ∈ S - space of all possible passwords (a, b, ... aa, ... Aa, ... &UH..&, ...). Unless the dictionary attack is successful you need to traverse all of the searchspace in case of H(m) which is unbounded. In case of H(H'(m)) where H' is b-bit hash you have only 2^b options which is much smaller then infinity ;). In practice the users make have S' ⊆ S (S' is space that users choose - say password etc.) where |S'| ≪ 2^b.
Combining few algorithms make it easier to break as you need to break the easier one. Here you have security on level of md5.
It does increase security as it have non-standard rainbow table and therefore you cannot just go and buy one, However there are much more sound methods of dealing with it (for example salt).
It does increase security as it adds some time to computation. However it is probably better to use sound method such as bcrypt.
PS. It is not encryption but hash. While multiple levels of encryption do increase security it is not necessary the case with hash.
Admin
Ha! I have outsmarted you all! I eliminated the database vulnerability entirely. I just do:
RESULT=
grep $USER_INPUT mydatafile
There's no way that could fall to SQL injection. No SQL: no problem!
Admin
Option 1: Developing your own obscure in-house system that is guaranteed to be flawed, poorly maintained, and probably worse-performing than a real RDBMS with a fraction of the functionality, knowing full well that it will have vulnerabilities of it's own and "security-through-obscurity" doesn't work forever.
Option 2: Learn how to sanitize your inputs properly.
Hmm... tough choice.
On a side note, how did this TDWTF become about SQL?
Admin
FTFY
Admin
Finaly, someone who thinking like me. +1111111
Admin
In the future, please enter your correct forename.
Let me fix that for you (and slightly increase the meme density):
Admin
Option 1 no-brainer. That way you secure lifetime job for yourself.
Admin
Admin
What is this story about matterhorn BTW? He stole someone's account because his password wasn't triple-hashed right?
Admin
Admin
Anyway, TRWTF is that the guy who wrote that code forgot the rot13() step.
Admin
Admin
Admin
WOOSH! I love that cool-mountain air feeling of a meme blowing by.
PS: My very non-technical mom has asked me on several occasions what the word "algorithm" means. I keep trying to give her definitions on her level but it isn't working very well... I'm tempted to pull out a cookbook and point to a recipe and tell her it is an algorithm for pot roast. :)
Admin
Admin
The bigger issue (based on comments) seems to be that of the SQL injection - that's based on the final comment, rather than the actual code excerpt posted. The article seemed to suggest the approach to Hashing was the issue....
Admin
First rule in Hyderabad is you don't talk about Matterhorning your relatives.
Naljnl, pbssrr?
Admin
Perhaps the resistance to a Brute Force attack mentioned by someone else might be a factor, but just lock the account after 5 bad entries and brute force becomes rather difficult (even if a hacker assumes a person will log on once a day, and that they can safely have 2 attempts at the password every day, there is still a massive risk that they'll lock the account (if someone takes holidays, for example, or sick leave) - not to mention, rather than adding a couple of milliseconds to each Authentication attempt, the hacker is forced to wait 24 hrs between attempts, and probably can't reliably make an attempt on weekends - adding centuries to any attempt.
Agree (I think) on the crypt thing, though (if it really does only use 8 char).
People are over obsessed with Security. You need to look at what you are trying to protect against. Passwords on accounts that can never lock (such as SysAdmin passwords - presumably you don't want to through out an entire system just because the SysAdmin forgot the password) need to be very secure. Other passwords (even the one you use for banking) can be less secure. Justification:
Just don't use stupidly easy passwords (username (or derivative of), pet's name, "Blink182", "qwe123", "password1", "4got10", "abc123", "summer99", etc....)
Admin
Some years ago, we were updating some identity resolution software, and the company who makes the software recommended that rather than use their libraries (which we would have to (quite cumbersomely) meld into our application, we should consider their 'out of the box' system which could integrate simply with the database we use, and simplify the calls to the library so that it would be as simple as offering it some personal details and their system would magically find results. The cost differential for licensing the libraries vs the 'out of the box' was significant (somewhere near 10 fold more for the 'out of the box'), so the powers that be, in their infinite wisdom dictated that we should instead use the raw libraries. I don't really know how much the total project cost (especially including some unexpected hiccups when we deployed), nor how much we are still paying for the poor decision now, but suffice it to say if people had had the guts to spend more upfront, we'd be ahead now...
I don't mean to look as though I'm arguing against your point - quite the opposite. The point is that the long term cost needs to be considered when making these sort of decisions. Unfortunately, the decision makers are often not technical (and rarely trust their teams technical talent either way) and consider upfront cost and support (but not support cost). Sometimes people probably are better off creating their own systems from scratch, rather than hacking an existing product into a state that is close to what they want...
Admin
Actually, you can never definitively find out what the original was, merely what would have created the same hash. In most systems, there are far more passwords available than the total number of hashes possible (that is, it's not a 1-1 relationship), so it might be possible to find a string that makes the same hash, but this is not necessarily the same password.
Admin
The sunroom example is like building your own IDE. Rather we are talking about a contractor who is willing to help you design the room, instead of insisting that it should be a pre-defined plan with some limited adjustments we can make to get it closer to what you want.
The same is true with DB's. By using an existing DB we are forced to create a solution close to what we want around the limitations of the DB. By building our own solution, we can guarantee it works EXACTLY as we want. Of course, in most cases the effort involved might outweigh the benefit, but we should accept the idea of creating our own system as a valid option.
Admin
Admin
This is reminding me of Linux vs MS...Linux is more secure because fewer hackers are attacking it. This is why I wrote it.
Admin
I think this is where geoffery is coming from. Good developers believe they can do anything. They might not need to, but they believe themselves capable of it. Bad developers want to use only the technologies they know (although they may be quite good at them). Using Oracle (for example) just because we all know how to use it isn't the right approach. Building a new DBMS for the hell of it, isn't necessarily the right appraoch either, but as someone has pointed out, the weakest link is usually the (local) developer. The simpler a system is to use, then the lower quality the developer that will appear adequate in it, and the higher the risk of hiring a turkey who doesn't really know what he's doing - and will end up stuffing things up irrespective of the technology you choose to use.
Creating systems for idiots merely encourages idiots. It won't be long before systems are so 'clever' that there will be no-one who actually understands what is going on to properly fix things when the shit hits the fan....