Ignoring the fact that nobody (including myself since I omitted the greek/latin substitution) addresses the actual problem, everyone just shifts the character by 3 according to their ASCII value. gameCHIEFs goes one step further by checking the alphanumeric value prior to the encryption/decryption (which is silly, as z will be encrypted to a special char and then it will be unable to be decrypted), all of which can be rewritten as something as small as:
Anything which produces special chars should be an automatic fail.PHP Code:
function crypt($str, $offset) { return implode('', array_map(function($c) { return preg_match('/[a-z]/i', $c) ? chr(ord($c) + $offset) : $c; }, str_split($str))) }
function encrypt($str) { return crypt($str, 3); }
function decrypt($str) { return crypt($str, -3); }
You all suck at programming. Get gud.
Poll Results: 2014 - Most popular programmer goes to....
-
Arti
3 33.33% -
gameCheif
2 22.22% -
Stapled
4 44.44% -
Kings V
0 0%
You may not vote on this poll
9 Votes
Results 1 to 26 of 26
Hybrid View
- 04 Nov. 2014 01:48am #1
- 04 Nov. 2014 02:57am #2
- 04 Nov. 2014 07:13pm #3