So what do you do when you need to pass secure data to another system over the web? Web services? Secure-Socket-Layer POST? Well, if you're using PHP, you don't need to worry about any of that fancy stuff. You can use this handy encryption method (as one nameless PHP-driven application does) to send your important data to your vendor or client ...
function encryptStr($string,$case_match="") { $replace=array("a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","0","1","2","3","4","5","6","7","8","9"); if ($case_match) { $shift_array=array( "a"=>"n", "b"=>"o", "c"=>"p", "d"=>"q", "e"=>"r", "f"=>"s", "g"=>"t", "h"=>"u", "i"=>"v", "j"=>"w", "k"=>"x", "l"=>"y", "m"=>"z", "n"=>"a", "o"=>"b", "p"=>"c", "q"=>"d", "r"=>"e", "s"=>"f", "t"=>"g", "u"=>"h", "v"=>"i", "w"=>"j", "x"=>"k", "y"=>"l", "z"=>"m", "A"=>"N", "B"=>"O", "C"=>"P", "D"=>"Q", "E"=>"R", "F"=>"S", "G"=>"T", "H"=>"U", "I"=>"V", "J"=>"W", "K"=>"X", "L"=>"Y", "M"=>"Z", "N"=>"A", "O"=>"B", "P"=>"C", "Q"=>"D", "R"=>"E", "S"=>"F", "T"=>"G", "U"=>"H", "V"=>"I", "W"=>"J", "X"=>"K", "Y"=>"L", "Z"=>"M", "0"=>"5", "1"=>"6", "2"=>"7", "3"=>"8", "4"=>"9", "5"=>"0", "6"=>"1", "7"=>"2", "8"=>"3", "9"=>"4" ); } else { $shift_array=array( "a"=>"N", "b"=>"O", "c"=>"P", "d"=>"Q", "e"=>"R", "f"=>"S", "g"=>"T", "h"=>"U", "i"=>"V", "j"=>"W", "k"=>"X", "l"=>"Y", "m"=>"Z", "n"=>"A", "o"=>"B", "p"=>"C", "q"=>"D", "r"=>"E", "s"=>"F", "t"=>"G", "u"=>"H", "v"=>"I", "w"=>"J", "x"=>"K", "y"=>"L", "z"=>"M", "A"=>"n", "B"=>"o", "C"=>"p", "D"=>"q", "E"=>"r", "F"=>"s", "G"=>"t", "H"=>"u", "I"=>"v", "J"=>"w", "K"=>"x", "L"=>"y", "M"=>"z", "N"=>"a", "O"=>"b", "P"=>"c", "Q"=>"d", "R"=>"e", "S"=>"f", "T"=>"g", "U"=>"h", "V"=>"i", "W"=>"j", "X"=>"k", "Y"=>"l", "Z"=>"m", "0"=>"5", "1"=>"6", "2"=>"7", "3"=>"8", "4"=>"9", "5"=>"0", "6"=>"1", "7"=>"2", "8"=>"3", "9"=>"4" ); } for($i=0;$i<strlen($string);$i++) { if (in_array(substr($string,$i,1),$replace)) { $newstring.=$shift_array[substr($string,$i,1)]; } else { $newstring.=substr($string,$i,1); } } return $newstring; }
Please forgive the lack of hilighting [thanks asdfs] Does anyone have a good PHP -> HTML converter thingy that is not written in PHP? And one that has Windows binaries or is something that a lazy fella like me can quickly use ;-)?
[Advertisement]
BuildMaster allows you to create a self-service release management platform that allows different teams to manage their applications. Explore how!