update: Added a form online and changed the last chapter
A few weeks ago I was in a what-to-code-right-now-mood and inspired by The Gold Bug I decided to write a little easy cypher in PHP (could have been any language^TM^ of course) without any secret key. You know, just for fun.
So what did I write exactly? Well, I wrote two API functions, one for encrypting and the other for decrypting a string, and used all kinds of string manipulations to get it the way it is. A little example for encrypting the first paragraph of The Gold Bug:
#!/usr/bin/php
<?PHP
include('rotsteroids_contest.inc.php'); $msg = "This Island is a very singular one. (....) The vegetation,
as might be supposed, is scant, or at least dwarfish."; echo rot_encrypt($msg);
Which will print something along the lines of this:
11:m0xbfvtumj=yA5EyOpOWO=RKJUJPzlKKtVnLMoMo
LqYmmtuthcxgmby5jIRScIOOAT2PzTT3JFFKnoMpVooM
MMnHwhvztilbvzSOSO94OOEOWTP2lTJPvUPKBq(.......)
chttOOS5DAqk4jwPvTTKUU2JPMMMVVFVVpMMvhim0tu
mtbyySOyS4OED1AwTlTTFFKzP3ZopVVMrnono
As you can see the cypher hasn't been optimized for speed at all and can :P contain all sorts of salts and/or junk, or am I giving away too much fish now? For encrypting we have the function rotsteroids_encrypt( str ) and rotsteroids_decrypt( str ) for the other way round.
So now the fun part, which is up to those nifty smart minds out here to crack my implementation. I've written the cypher in pure PHP which might use some other string manipulating functions, or not, but still, it is pure PHP. To make it even more fun I'm just going to make it a contest, and for the first reader who is able to send me a reference implementation that works, I'm going to send a bottle of beer trough mail =).
So how to get started? Well, as I said, it is easy to deal with the code, API-wise there are only to functions one for encrypting and the other for decrypting. To not give away the source-code, and thus the answer to my contest, I've created a online form in which you can use the encrypting and decrypting of strings. Earlier today I got a few mails from people that actually decoded the phps file I had uploaded and delivered me the source that way, which is, in fact, cheating.
I'm curious for any responds, let me know!
mail: niels-[AT]-shodan-[DOT]-nl