Skip to content

Instantly share code, notes, and snippets.

@lcherone
Last active October 1, 2017 12:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lcherone/d7046d1595abbab98ed5316f0803feb2 to your computer and use it in GitHub Desktop.
Save lcherone/d7046d1595abbab98ed5316f0803feb2 to your computer and use it in GitHub Desktop.
xor
<?php
$xor = function ($str, $key = 192) {
for ($i = 0; $i < strlen($str); $i++) {
$str[$i] = chr(ord($str[$i]) ^ $key);
}
return $str;
};
$enc = $xor("xorme");
$dec = $xor($enc);
var_dump($enc);
var_dump($dec);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment