- 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
Good lord, this article again?
Admin
:notes: Where have we seen this code… before? :musical_note:
Admin
It's like déjà vue or something....
Admin
Surely you mean déjà vu? It feels like we've had this conversation before...
Admin
I have no idea why my phone autocorrected to that...
Admin
All over again?
Admin
I actually worked on an app that stored passwords in almost exactly the same way (minus the reverse). Fortunately it was a desktop app, not a server app, so it wasn't as big an issue. Still, I insisted that we switch to using DPAPI instead to encrypt the passwords...
Admin
QRVMuZ1MSNXYtFVP , or did I make a decode mistake? That's a notably good password from an end user.
Admin
Or a somewhat weak password from a password generator. Unless the database won't accept any characters besides '0' to '9', 'A' to 'Z', 'a' to 'z'. Or their policy forbids other characters because they might confuse the SQL parser.
Admin
Yes, you made a mistake. Well, partially.
The snippet from the article shows that the password gets base64-encoded and reversed 5 times in a row before it's stored. So you need to reverse and base64-decode 5 times too.
The actual password you'll get after doing that is "foo".
Admin
If so I think I might know we might of met once.
Admin
So the passwords can be assumed to be generic samples.
Minus 0n3 WTF.
But wouldn't it save a considerable amount of storage space if we'd rot13 encode the passwords 31 times instead?
Admin
Nope ;)
Admin
The original specification was a shouted exchange with a very frustrated and infuriated boss. "Yaargh! You might as well reverse the damn thing 101 times for all the damn use it does!" and the coder thought he was talking in binary.
Admin
Might have.
Admin
Admin
Would have been a lot more fun if there were an even number of strrevs :-P Clearly, however this is all being done to increase the time required to encode the password so that brute force online attacks are less practical -- yeah ....yeah....That's the ticket.
https://www.youtube.com/watch?v=iyp9fh-u4w8
Admin
Made me think of this: https://xkcd.com/153/
Admin
Those can be prevented with a good pair of security breeches.
Admin
I actually have one of those old Atari Portfolios in a box somewhere. Great little almost-DOS-compatible system. Really ahead of its time.
Admin
Admin
I approve of the photo not only because of the slightly obscure classic computer reference, but because I recentlY acquired an HP 95LX.
Admin
No, it means the data is reversed (cf. "breech baby"), as the algorithm clearly shows it to be
Admin
I've never done any PHP programming, but I've done lots of C and C++. This comment has me puzzled, because in C/C++ that strrev would happen 4 times, not 5. Is PHP different?
Admin
PHP is indeed "different," but not that way.
0, 1, 2, 3, 4 — that's 5 iterations — in any language that uses that
for
loop syntax.Admin
Even an idiot like me can undo this:
Admin
https://www.youtube.com/watch?v=vGCUIaW2MSU
Admin
I don't remember a duplicate to this article, but I do recall that this is a fairly common "mistake" Stackoverflow PhpFreaks roshanbh.com.np mysnip.de (this time in VB)
There must be some old PHP guide out there with this as an example that's been passed on from coder to coder.
In short, while it's well not it's not safe to roll your own encryption. It might not even safe NOT to roll your own :^).
Admin
:facepalm: :wtf: :facepalm: :wtf: :facepalm: :wtf: :facepalm: :wtf: :facepalm: :wtf: :facepalm: :wtf: :facepalm: :wtf: :facepalm: :wtf: :facepalm: :wtf: :facepalm: :wtf: :facepalm: :wtf: :facepalm: :wtf: :facepalm:
Admin
Whoa, I must have missed the news that Slashdot is now StackOverflow.
Admin
Whoops... my finders slipped. - corrected.
Admin
Yikes. It's Monday, that's all I can say...
Admin
Hey, at least it's not...
Admin
SlashdotOverflow…
Admin
My Eyes! The goggles do nothing!!!!!!!!!
Admin
$ rev | base64 -d | rev | base64 -d | rev | base64 -d | rev | base64 -d | rev | base64 -d UVJWTXVaMU1TTlhZdEZWUA==
Easy to find out what the password is. Me? I'd use something silly like SHA1 or something stronger.
Admin
You should definitely be using PBKDF1/2, bcrypt, or scrypt with an appropriate number of rounds. Salted hashes alone should be considered deprecated, even SHA-512. ASICs and GPUs are getting really fast.
Admin
Only a system administrator could claim that "somewhat weak" is constituted by a complexity that would take 1 million 4ghz 8 core computers, whose every single clock cycle was dedicated solely to brute forcing these passwords (miracle clock cycles that can execute an entire crack attempt in one tick I might add) over 23 thousand years to reach a 50% confidence interval. But yeah, make your users add ampersands and exclamation points. THAT will be the thing that makes the difference. SMH.
Admin
d41d8cd98f00b204e9800998ecf8427f
I defy you to find the original password that matches this MD5.<http play.golang.org/p/2G8IoMF901>
Admin
"something stronger" is a bit mild. I suspect that the prudent (non-WTF) method would be to use something provided by someone who has greater knowledge in such things as encryption and hashes and the like.
As everyone knows, rolling your own on such things as dates and encryption is a sure way to being quoted in some way here. Fine a proper library and use it!
Admin
You would use a library which provides an implementation of one of the algorithms I listed, all of which are well-known in academia and are considered secure (to various degrees; PBKDF1 > SHA1 any day even though it is old), not rolling your own should have been obvious from what I posted.
Admin
Admin
Did you do something like 100 random bytes |
md5sum
?Admin
Only 100 bytes? It was probably a Go program compiled into BIT, so I'd wager around 4 GB.
Admin
Why would you want to fine the library you plan to use? Seems like a bad way to start off your relationship.
If this is some way of getting back at a library for all those overdue fines you had to pay back in the day, remember that those fees were all your fault. Besides, those are a completely different type of library anyway.
Admin
Revenue doesn't just generate itself!
Admin
The thread where we discuss the merits (or lack thereof) of wealthy people whose revenue generates itself is :arrows:
Admin
Who is this DJ Vue?
Admin
That one's easy.
It's "OCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>404 Not Found</title> </head><body> <h1>Not Found</h1> <p>The requested URL /md5/get.php was not found on this server.</p> <hr> <address>Apache/2.2.22 (Debian) Server at i337.net Port 80<.
Filed under: "Yes I know.", "About three weeks ago", and "The Coin-Flip Hash""
Admin
No idea, I think my keyboard knows though....