| 1 | <?php\r |
| 2 | \r |
| 3 | function bin_trim ($bin) {\r |
| 4 | \r |
| 5 | $x = (8 - strlen($bin));\r |
| 6 | $y = "";\r |
| 7 | while($x) {\r |
| 8 | $y = ($y."0");\r |
| 9 | $x--;\r |
| 10 | }\r |
| 11 | return($y.$bin);\r |
| 12 | \r |
| 13 | }\r |
| 14 | \r |
| 15 | function xor_bytes ($bina, $binb) {\r |
| 16 | $bin = "";\r |
| 17 | $x = 8;\r |
| 18 | while($x) {\r |
| 19 | if ($bina[$x-1] XOR $binb[$x-1])\r |
| 20 | { $bin = ( 1 . $bin ); } else { $bin = ( 0 . $bin ); }\r |
| 21 | $x--;\r |
| 22 | }\r |
| 23 | return $bin;\r |
| 24 | }\r |
| 25 | \r |
| 26 | //CODE/////////////////////////////////////////////////////\r |
| 27 | \r |
| 28 | $message = "POKUS CISLO JEDNA DVA TRI";\r |
| 29 | $message = ")-#&O&$6(.:E/-:H&#&*H--$.";\r |
| 30 |