- 论坛徽章:
- 0
|
感谢2楼4楼提示,程序我写出来了如下,不过我觉得通过"非ASCII码字符串"方式处理似乎不是一中正规的入理方法,不知道正规处理方法是什么?
$infile = "_SC_0011.JPG";
$outfile = ">ct.txt";
open(INPUT, $infile) || die "Can not open $infile";
open(OUTPUT, $outfile) || die "Can not open $outfile";
binmode(INPUT);
binmode(OUTPUT);
$txt = "";
while(read(INPUT, $buf, 100*1024))
{
$txt .= $buf;
}
$len = length($txt);
$c="a";
print "len=$len\n";
#print "txt=$txt\n";
for($i = 0; $i<$len; $i++)
{
substr($txt, $i, 1)= (substr($txt, $i, 1) ^ $c);
#print "2.txt=$txt\n";
}
print OUTPUT $txt;
close(INPUT);
close(OUTPUT);
|
|