- 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
Oh, wait... My apologies.
Admin
Admin
This is bound to lead to Ovaltine.
Admin
http://images.smh.com.au/2012/04/12/3211657/hacker-353-200x0.jpg
Turns out she was Australian after all and likes nerds!
Admin
The real WTF is the Thomas Covenant reference.
Admin
Captcha: commoveo - as we get bald we start to use hairstyles called commeoveos
Admin
Unclean! Unclean!
Admin
Admin
Admin
It asks for Yahtzee?
Admin
Admin
If you've never used .Net, it's actually not bad with how .Net's "using" statements work. The only time you really have to type out the full namespace hierarchy is when there is a naming conflict with another namespace you've pulled in with a "using" statement. It's a really nice feature if you make heavy use of the IDE, a lot of the VS IDE is sensitive to what namespaces you bring in with "using" statements.
Admin
Switch to EBCDIC.
Admin
and he still didn't think of md5....
Admin
Microsoft
Admin
I think you can do that in 5 minutes with a perl lib .. they have libs for everything mad and language-y
Admin
// ... // several lines of code to be decently paid // ... return "hunter2";
Admin
For those who didn't get it, here's how you would code this in a secure way:
protected String getRanString() { String uncleanRandomString = System.Web.Security.Membership.GeneratePassword(10, 0); uncleanRandomString = uncleanRandomString.Replace("!", "a"); uncleanRandomString = uncleanRandomString.Replace("@", "2"); uncleanRandomString = uncleanRandomString.Replace("#", "c"); uncleanRandomString = uncleanRandomString.Replace("$", "4"); uncleanRandomString = uncleanRandomString.Replace("%", "3"); uncleanRandomString = uncleanRandomString.Replace("^", "i"); uncleanRandomString = uncleanRandomString.Replace("&", "a"); uncleanRandomString = uncleanRandomString.Replace("*", "9"); uncleanRandomString = uncleanRandomString.Replace("(", "g"); uncleanRandomString = uncleanRandomString.Replace(")", "s"); uncleanRandomString = uncleanRandomString.Replace("_", "h"); uncleanRandomString = uncleanRandomString.Replace("-", "a"); uncleanRandomString = uncleanRandomString.Replace("+", "2"); uncleanRandomString = uncleanRandomString.Replace("=", "q"); uncleanRandomString = uncleanRandomString.Replace("[", "w"); uncleanRandomString = uncleanRandomString.Replace("{", "t"); uncleanRandomString = uncleanRandomString.Replace("]", "r"); uncleanRandomString = uncleanRandomString.Replace("}", "f"); uncleanRandomString = uncleanRandomString.Replace(";", "8"); uncleanRandomString = uncleanRandomString.Replace(":", "z"); uncleanRandomString = uncleanRandomString.Replace("<", "x"); uncleanRandomString = uncleanRandomString.Replace(">", "0"); uncleanRandomString = uncleanRandomString.Replace("|", "v"); uncleanRandomString = uncleanRandomString.Replace(".", "b"); uncleanRandomString = uncleanRandomString.Replace("/", "y"); uncleanRandomString = uncleanRandomString.Replace("?", "t"); return uncleanRandomString; }
Admin
Admin
It doesn't seem 'Too bad' to me.
So System.Web.Security.Membership.GeneratePassword(10, 0); creates a random alpha-numeric string which includes the extra characters. But the programmer doesn't want any of those characters in password strings so they're performing a manual replace on each of the special characters.
Admin
Hooray!
Admin
Admin
All are the letters are numerals for base 36.
Admin
Admin
You berated the programmer for not using md5, but he did!
uncleanRandomString = uncleanRandomString.Replace(")", "m"); uncleanRandomString = uncleanRandomString.Replace("_", "d"); uncleanRandomString = uncleanRandomString.Replace("-", "5");
Admin
I'm going to assume he thought like other people that the second term would squash the non-alpha numeric characters. When it obvious didn't, he slapped in a fix and got on with his life. Since thee are no important effects outside the function itself, it's not very wtf.
Big WTF is something that causes difficult to explain side effects, or subtle failures far from the offense itself.
Admin
Hint: Ipsum Lorem, Pagina III.
Admin
"Apparently, this developer was too proud for base 64 encoding"
I don't get it. How would base64 encoding help with random strings?
With MD5 I could do MD5(RAND()) and get a reasonably random string of mostly numbers and couple letter (0-F). But how can one use Base 64 when generating a random string?
Admin
umm, because it won't work on mac?
Admin
Is there a formular for determing the decreased entropy?
like
cat /dev/absolutelyrandom | randomdetection 100% (after some time)
cat /dev/absolutelyrandom | replacing_certain_strings_with_absolutelynon_random | randomfilter 30%
?
Dunno how the Laplace Distribution plays in there, but some symbols have 1:1 conversion and are a crib enabler. Maybe one could build a functioning string (bash shebang?) out of the 1:1 fixed translation conversion symbols.
And yes, the use of cat might be a deadvisable one, but i like pipes.
Admin
He's a complex fellow.