Cryptography Reference
In-Depth Information
c[j]=(byte)res1;
c[j+1]=(byte)res2;
}
}
}
Here is a sample run of the program. Check its results for correctness (bear in mind that
the program does not display the leading zeros).
C:\ java>java CharCompressDemo LOULOUSKIPTOMYLOUSKIPTOMY
LOUMYDARLIN
Original string in binary:
1001100010011110101010101001100010011110101010101010011010010
1101001001010100000101010001001111010011010101100101001100010
0111101010101010100110100101101001001010100000101010001001111
0100110101011001010011000100111101010101010011010101100101000
1000100000101010010010011000100100101001110
Compressed string in binary:
1011011101010000101101110101000100100101001000001111100110111
0001100110000101100111010100100100010100100001111010011011100
1100011000010110111001010001100110000000110000010001001011010
0001101
You may want to write a program that decompresses messages of this type; consider
how you might do this. The topic of compression is as interesting as anything in cryptog-
raphy, and I encourage you to study it.
Search WWH ::




Custom Search