Tuesday, September 07, 2010

[qbgkpxjk] Whitespace only encoding

The "joke" white-space only binary encoding {0->newline, 1->space} might be useful in a scenario where an adversary becomes unable to print a hardcopy of an incriminating document. Or steganographically useful so the adversary does not see anything.

#! perl -w
while(defined($c=getc)){
    #we use little endian, because with 7-bit clean 
    #characters, the last character will always be
    #zero, which gets converted to linefeed, so
    #every output line is terminated with a linefeed.
    $_=unpack("b*",$c);

    die unless 8==length;
    y[01][\n ];
    print;
}

#! perl -w
undef $/;
$_=<>; #slurp
y[\n ][01];
$_=pack("b*",$_);
print;

No comments :