- 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
Holy sweet flaming cow crap, I think I think I just broke something while attempting to laugh and choke on my own vomit simultaneously.
Admin
I have no idea where to begin...I mean, that may have worked great for Caesar, but its time to join the 21st century.
Admin
Woah pretty good. How could one EVER find the pattern??
Admin
Aww, what a cute implementation of a letter-substitution cipher. Caeser would be proud. Careful; don't get too close, it might bite.
Admin
or fher gb qevax lbhe binygvar
Admin
Hahaha! Great one Phil! Now if only I had a rot13 decoder ring ...
Admin
You and your drink-mix conspirators cannot fool a cypherpunk such as myself!
Admin
That would have been so much easier if he'd just done some addition with a modulus on the ASCII values.
Admin
GNU Source-highlight (http://www.gnu.org/software/src-highlite/source-highlight.html) handles PHP3, and outputs (X)HTML.
Admin
... wishing php had the rot13 function (www.php.net/rot13)
Admin
Someone ought to remind this fellow what a poor substitution cipher might just cost you...
"The correspondence between Mary Queen of Scots and Anthony Babington was encrypted with a substitution cipher. ... However, the ninth-century Arab codebreaker al-Kindi realised that there is an effective way of cracking the substitution cipher. Every letter in a language appears with a certain average frequency, so that in English, for example, 'e' accounts for 13% of all letters, whereas 'z' accounts for less than 1%. Whichever letter is substituted for the original letter will take on the original frequency. So by analysing the frequency of the different letters in a code you can work out which letter each substituted letter represents.
Walsingham's codebreaker used this technique to decipher the letters of Mary Queen of Scots. The letters were used as evidence against her, and she was found guilty of treason and executed in 1587."
http://www.channel4.com/science/microsites/S/secrecy/page1c_t.html
Admin
Does anyone have a good PHP -> HTML converter thingy that is not written in PHP?
Yes, me :-)
Admin
Alex: you can use the output from the Source-highlight mentioned above: http://naivist.net/caesar.html
(Sorry, it becomes quite large...)
Admin
ROFL
Admin
SVANYL!6!6!6! JGS YBY NA RAPELCGVBA NYTBEVGUZ GNUG V PNA CHG VA ZNU CEBTEZF66!66! BZT JGS YBY
ABJ NIRELBAR JVY FR ZNU 828G UNK5E FX6YMM!!!! YBYBY
A8JORV?F!6!!!!6 OUBYQ GURLER VF N AH UNX8E VA 7JA!! JGS
NY666! HE ONRF E OYBAT 7 HF.!66!!!66!
Admin
This one is for Windows http://gnuwin32.sourceforge.net/packages/src-highlite.htm
Admin
<a href="http://www.rot13.com/index.php">Rot13.com</a>
Admin
yaarrrrgggg http://www.rot13.com/index.php
Admin
I wouldn't have reached further back in history than Conan Doyle's "The Dancing Men". Or Hofstadter's Eta Oin/SHRLU dialog....
Admin
Phil - You have submitted the perfect response! You have probably been waiting for years to use it, but it was worth the wait. Well done.
Admin
I assume that he is not aware that PHP includes a function called <a href="http://www.php.net/manual/en/function.str-rot13.php"str_rot13()</a>...
Admin
You might also want devPHP, which has a good syntax highlighter built in.
http://devphp.sourceforge.net/
Admin
Oh you guys!
Everyone knows that this ROT13 (and ROT5 on the digits too) cypher is virtually uncrackable.
It would take all the computing power available longer than all the time in the universe to beat this... Or is it that other one, the one with the prime number factoring thingy...
Anyway its really hard I tell you.
Admin
In the programmer's defense, the PHP rot13 function did not exist when the code was originally written.
That still doesn't excuse the fact that rot13 was used for "security", or the horrendous implementation.
Admin
Wow, just slightly more secure than writing it sdrawkcab.
Admin
I know someone who can read rot13. Kinda rusty at it, but it's been almost ten years since the heyday of usenet anyway. Remember that joke about levels of usenet users? He lived them. ^_~
Admin
Oh, I forgot, there's a mini-wtf in its implementation. PHP has a function made to do this: strtr(). Just call return strtr($string,$shift_array); and you're done. Isn't using a for loop with three identical substring calls and one-byte-longer reallocation calls every iteration the quintessenal VB method?
Admin
Yeah, syntax highlighting for just about any language. What you need is:
vim: <a target="_new" href="http://www.vim.org/">http://www.vim.org/
Open it in vim, and type this:
:source C:\path\to\vim\syntax\2html.vim<enter>
There are some better scripts available from <a target="_new" href="http://www.vim.org/">http://www.vim.org/ in the scripts area, 'syn2html', 'code2html', etc. vim supports >400 languages with its syntax highlighting....
Admin
So PHP with all it's glory does not contain the Perl etc tr/abcd/wtf?/ syntax? nice.
I especially love string catenations.
They are so fast and efficient!
Admin
fogel, strtr does that. strtr('adbecf','abc','def') is tr/adbecf/abc/def. However, since it doesn't have support for regular expressions, the strings have to be explicitly written out. (Not usually a bad idea for its usual uses.)
Admin
wtf, that looks alot like rot13 to me... it was years since i last looked at something like that
snyhpung!
Admin
LOL. this rox.
Admin
wtf, and $case_match is obviously defaults to a string, why does he compare it against a boolean, that is the one thing i hate about php, you can do program as stupid as possible and they still works.. that must be why so many people "know" php :/
Admin
Or you could just do the obvious thing and employ str_rot13() to do the hard work for you...
Admin
Well I can't see what all those arrays are for - why not just look through the string and handle the translation with a big If (or select/case if PHP has that).
Could this be renamed PCP? (Pretty Crap Privacy) ?
Admin
goot highlightning tool with GUI:
http://www.andre-simon.de/
Admin
+1 in Internationalization for supporting encodings where Latin letters are not contiguous :)
Though I’m sure it will fail when tested on MBCS strings. Give that +1 back.
Admin
Man, that's just batshit fucking loco right there.
Admin
I find it interesting how some people obviously don't read the comments before commenting themselves. Maybe it's human nature, but that's a WTF to me.
Also, I think the implementation of this function is more of a WTF than the fact that it's a ROT13 algorithm. Sometimes obfuscation is sufficient, and hard encryption is not necessary. Of course, as some of us like to point out, we can't prove the inappropriateness of the function without more context. On the other hand, the name of the function, "encryptStr", is often evidence of it's intention.
Admin
I like PHP but I really think that you should stop posting PHP WTFs. It seems to bring the overall intelligence level of the commenters down a few notches. Lets stick with something serious. Like C and VB.
smirk
Admin
"I broke it with this."
"A Drogen's Decoder Wheel? They put these into cereal boxes for kid!"
"Yeah, I found it in a box of, uh . . . Lucky Charms."
Hail Caesar!
Admin
Personally, I prefer double ROT13 encoding for the additional security.
Admin
I offered a work collegue the chance the optimise the above function and convert it to python, thus giving him the chance to show off his mad coding sk1llz.
He came up with :
#!/usr/bin/python
import sys
a = sys.stdin.read(1)
while a:
sys.stdout.write( chr(ord(a) + 13))
a = sys.stdin.read(1)
+1 for knowing about chr() and ord()
+1 for making it into a shell script, thus making it callable from just about everything
-10 for having it work for the letters a-m and A-M only.
-100 for being the first person to implement ROT-13 in such a way as to require a UNROT-13 function.
Admin
OT: You know your blog is popular when you have spambots exploiting your hand-written comment system - and said spambots get HTML escaping done better than you.