Simple Obfuscation of .txt file
Posted: Tue Nov 12, 2013 11:06 pm
I am trying to use this code for simple obfuscation. But I presume nothing is returned to the function. Here's the code:
Code: Select all
<?php
$source = "setup.txt";
$destination = "setup.ini";
function enc($temp)
{
$len = strlen($temp);
for($i=0;$i<$len;$i++)
{
$ch = $temp[$i];
$ch = ~$ch;
$temp[$i]=$ch;
}
}
function createid($src,$dest)
{
$handle_1 = fopen($src, "rb");
$handle_2 = fopen($dest,"rb");
while(!feof($handle_1))
{
$Byte = fgetc($handle_1);
sprintf($tmp,"%c",$Byte);
enc($tmp);
$len = strlen($tmp);
$newByte = $tmp[0];
fputs($newByte,$handle_2);
}
fclose($handle_1);
fclose($handle_2);
}
createid($source,$destination);
?>