Well, you can make it look encrypted
by parsing it in and out of binary format,
not human readable, but definantly not encrypted.
...but hey, it's better than nothing 😉
<?
$str = "mydata is sooooo secret 🙂";
//the easy part is 'encrypting' it...
for($i=0;$i<strlen($str);$i++) { $enc .= pack('C',decbin(ord(substr($str,$i,1)))); }
echo "Here's the binary output<br>\n";
echo $enc;
//now to decode...
$dump = unpack('C*',$enc);
echo "<p>Here is what we found...</p>\n";
print_r($dump);
foreach ($dump as $key=>$val) {
for ($x=0;$x<(8-strlen($val));$x++) { $val .= '0'; }
$test = chr(decbin($val));
if (ord($test) < 255) {
$str .= $test;
}
}
echo "<p>And here's the decrypted string: " . $str;
?>