here is a bit of code that will handle the swapping part..
sub swap {
my ($filechar, $msgbit) = @_;
$filechar=unpack("B8",$filechar);
$filechar=~pack("B8",$filechar)=~(substr($filechar,-1,1)=$msgbit);
return $filechar;
}
to hide the message i:
1) calculate the number of bytes i'll need from the source file
2) read the bytes into a buffer
3) turn the hidden message into binary
4) loop thru' the bit message and the file buffer replacing the low order bit
5) putting the buffer back into the source file..
reasonably easy...
|