note 3616 deleted from function.crypt by jimw

From: Date: Sat, 03 Nov 2001 18:15:52 +0000
Subject: note 3616 deleted from function.crypt by jimw
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-20364@lists.php.net to get a copy of this message
With this code you can make your one encrypting. Put it in a file xor.php3: The code is: dfgsdfg452 The first xor: abcde The second xor: edcba $i = "dfgsdfg452"; $s = "abcde"; $p = "edcba"; for($x=0; $x < strlen($i); $x++) { $i[$x] = chr(ord($i[$x]) ^ ord($s[$x % strlen($s)]) ^ ord($p[$x % strlen($p)])); } echo "<form method='POST' action='xor.php3'>"; echo "<input type='text' name='encrip' value='$i'>"; echo "<input type='submit' name='Submit' value='a'>"; echo "</form>"; if ( $Submit == "a") { $k = $encrip; $l = "abcde"; $p = "edcba"; for($x=0; $x < strlen($k); $x++) { $k[$x] = chr(ord($k[$x]) ^ ord($l[$x % strlen($l)]) ^ ord($p[$x % strlen($p)])); } echo"$k"; echo"dfgsdfg452"; } the result is: <form method='POST' action='xor.php3'><input type='text' name='encrip' value='`guba436'><input type='submit' name='Submit' value='a'></form> dfgsdfg452 dfgsdfg452

« previous php.notes (#20364) next »