ืืงืืื
ืืจืขืขืืื ืืก.
ื ืื ืึทืืื ืืึทื ื ืฆืืจืืง, ืืืขื ืืื ืืขืืขืจื ื ืืื ืืขืจ ืืื ืืืืขืจืกืืืขื, ืขืก ืืื ืืขืืืขื ืึท ืงืึธืืจืกืขืืืึธืจืง ืืื ืื ืืืกืฆืืคึผืืื "ืกืึธืคืืืืึทืจืข ืืขืืืึธืืก ืคืื ืืื ืคึฟืึธืจืืึทืฆืืข ืืืืขืจืืืื." ืื ืึทืกืืื ืืึทื ื ืคืืจืืื ืื ืืื ืื ืฆื ืฉืึทืคึฟื ืึท ืคึผืจืึธืืจืึทื ืืืึธืก ืขืืืขืื ืึท ืึธื ืืึธื ืืื GIF ืืขืงืขืก. ืืื ืืึทืฉืืึธืกื ืฆื ืืึธื ืืึธืก ืืื ืืืฉืึทืืืึท.
ืืื ืืขื ืึทืจืืืงื ืืื ืืืขื ืืึทืฉืจืืึทืื ืขืืืขืืข ืืขืึธืจืขืืืฉ ืคืื ืงืื, ืืื ืืขืืื ื ืืื ืืื ืืึธืก ืงืืืื ืคึผืจืึธืืจืึทื ืืื ืืืฉืืคื.
ืืขืึธืจืขืืืฉ ืืืื
GIF ืคึฟืึธืจืืึทื
GIF (Graphics Interchange Format - ืึท ืคึฟืึธืจืืึทื ืคึฟืึทืจ ืืงืกืืฉืืื ืืืฉืื ื ืืืืืขืจ) ืืื ืึท ืคึฟืึธืจืืึทื ืคึฟืึทืจ ืกืืึธืจืื ื ืืจืึทืคืืง ืืืืืขืจ, ืืืึธืก ืืื ืืืืืืช ืฆื ืกืืึธืจืื ื ืงืึทืืคึผืจืขืกื ืืึทืื ืึธื ืงืืืึทืืืืขื ืึธื ืืืขืจ ืืื ืึท ืคึฟืึธืจืืึทื ืคืื ืึทืจืืืฃ ืฆื 256 ืคืืจืื. ืืขืจ ืคึฟืึธืจืืึทื ืืื ืืขืืืขืืึธืคึผืขื ืืื 1987 (GIF87a) ืืืจื CompuServe ืคึฟืึทืจ ืืจืึทื ืกืืืืื ื ืจืึทืกืืขืจ ืืืืืขืจ ืืืืขืจ ื ืขืืืืึธืจืงืก. ืืื 1989, ืื ืคึฟืึธืจืืึทื ืืื ืืึทืืึทืคืืื (GIF89a), ืฉืืืฆื ืคึฟืึทืจ ืืืจืืืขืืงืืึทื ืืื ืึทื ืึทืืืืฉืึทื ืืื ืฆืืืขืืขืื.
GIF ืืขืงืขืก ืืึธืื ืึท ืืืึธืง ืกืืจืืงืืืจ. ืื ืืืึทืงืก ืฉืืขื ืืืง ืืึธืื ืึท ืคืึทืจืคืขืกืืืงื ืืขื ื (ืึธืืขืจ ืขืก ืืขืคึผืขื ืืก ืืืืฃ ืขืืืขืืข ืคืืึทืืก), ืึทืืื ืขืก ืืื ืึผืืขื ืืืืืขืืืขื ืฆื ืืึทืื ืึท ืืจืืึทื ืืืขืื ืืื ืืขืืขืจ ืืืึธืง ืืื ืืืื. ืื ืกืืจืืงืืืจ ืคืื ืื ืกืืืคึผืืึทืกื ื ืื-ืึทื ืืืืืืื GIF ืืืื ืืื GIF89a ืคึฟืึธืจืืึทื:
ืคืื ืึทืืข ืื ืืืึทืงืก ืคืื ืื ืกืืจืืงืืืจ, ืืื ืืขื ืคืึทื ืืืจ ืืืขืื ืืืื ืืื ืืขืจืขืกืืจื ืืื ืื ืืืืืืืข ืคึผืึทืืืืจืข ืืืึธืง ืืื ืื ืคึผืึทืจืึทืืขืืขืจืก ืคืึทืจืึทื ืืืืึธืจืืืขื ืคึฟืึทืจ ืื ืคึผืึทืืืืจืข:
CT
- ืืืึทืืืึทื ืคืื ืึท ืืืืืืืข ืคึผืึทืืืืจืข. ืืืื ืืขื ืคืึธื ืืื ืืึทืฉืืืื, ืื ืืืืืืืข ืคึผืึทืืืืจืข ืืืื ืึธื ืืืืื ืืื ื ืึธื ืื ืืึทืืืฉืืงืึทื ืคืึทืจืฉืืขืื ืฉืขืคึผื.Size
- ืคึผืึทืืืืจืข ืืจืืืก ืืื ื ืืืขืจ ืคืื ืคืืจืื ืืื ืื ืืืื. ืืืึทืืืขืก ืคึฟืึทืจ ืืขื ืคึผืึทืจืึทืืขืืขืจ:
ืืจืืืก
ื ืืืขืจ ืคืื ืคืืจืื
ืคึผืึทืืืืจืข ืืจืืืก, ืืืืขืก
7
256
768
6
128
384
5
64
192
4
32
96
3
16
48
2
8
24
1
4
12
0
2
6
ืขื ืงืจืืคึผืฉืึทื ืืขืืืึธืืก
ืื ืคืืืืขื ืืข ืืขืืืึธืืก ืืืขื ืืืื ืืขื ืืฆื ืฆื ืขื ืงืจืืคึผื ืึทืจืืืงืืขื ืืื ืืืื ืืขืงืขืก:
- LSB (Least Significant Bit) ืืืคึฟื
- ืคึผืึทืืขืืืข ืืขืจืฆื ืืืคึฟื
LSB ืืืคึฟื - ืึท ืคึผืจืึธืกื ืืืคึฟื ืคืื ืกืืขืืึทื ืึธืืจืึทืคื. ืขืก ืืืฉืืืื ืคืื ืจืืคึผืืืืกืื ื ืื ืืขืฆืืข ืืึทืืืึทืืืง ืืืื ืืื ืืขื ืงืึทื ืืืื ืขืจ (ืืื ืืื ืืืขืจ ืคืึทื, ืื ืืืืืืืข ืคึผืึทืืืืจืข ืืืืขืก) ืืื ืื ืืืื ืคืื ืื ืคืึทืจืืึธืจืื ืึธื ืืึธื.
ืืขืจ ืคึผืจืึธืืจืึทื ืืืขื ื ืืฆื ืื ืืขืฆืืข ืฆืืืื ืืืื ืืื ืื ืืืืืืืข ืคึผืึทืืืืจืข ืืืืขืก ืืื ืึท ืืืื ืคืื ืืขื ืืืคึฟื. ืืขื ืืืื ืึทื ืคึฟืึทืจ ืึท 24-ืืืกื ืืืื, ืืื ืื ืคึผืึทืืืืจืข ืงืึธืืืจ ืืื ืืจืื ืืืืขืก ืคึฟืึทืจ ืจืืื, ืืืื ืืื ืืจืื, ื ืึธื ืขืืืขืืืื ื ืึท ืึธื ืืึธื ืืื ืขืก, ืืขืืขืจ ืงืึธืืืจ ืงืึธืืคึผืึธื ืขื ื ืืืขื ืืืืฉื ืืื ืึท ืืึทืงืกืืืื ืคืื 3/255 ืืจืึทืืืฉืืืฉืึทื ื. ืึทืืึท ืึท ืขื ืืขืจืื ื, ืขืจืฉืืขืจ, ืืืขื ืืืื ืืืืขืืง ืึธืืขืจ ืฉืืืขืจ ืฆื ืืึทืืขืจืงื ืคึฟืึทืจ ืื ืืขื ืืฉืืขื ืืืื, ืืื ืฆืืืืืื ืก, ืขืก ืืืขื ื ืืฉื ืืืื ืงืขื ืืืง ืืืืฃ ื ืืืขืจืืง-ืงืืืึทืืืืขื ืืื ืคึฟืึธืจืืึทืฆืืข ืคึผืจืึธืืืงืฆืืข ืืขืืืืกืขืก.
ืื ืกืืืข ืคืื โโืืื ืคึฟืึธืจืืึทืฆืืข ืืืขื ืืืืึทื ืึธืคืขื ืืขื ืืืืฃ ืื ืืจืืืก ืคืื ืื ืืืื ืคึผืึทืืืืจืข. ืืื ื ืื ืืึทืงืกืืืื ืืจืืืก ืคืื ืืขืจ ืคึผืึทืืืืจืข ืืื 256 ืคึฟืึทืจืื, ืืื ืืืื ืฆืืืื ืึธื ืืึธื ืืืื ืืขื ืขื ืืขืฉืจืืื ืืื ืื ืงืึธืืคึผืึธื ืขื ื ืคืื ืืขืืขืจ ืงืึธืืืจ, ืื ืืึทืงืกืืืื ืึธื ืืึธื ืืขื ื (ืืื ืื ืืึทืงืกืืืื ืคึผืึทืืืืจืข ืืื ืื ืืืื) ืืื 192 ืืืืขืก. ืึทืืึธื ืืขืจ ืึธื ืืึธื ืืื ืขืืืขืืื ืืื ืื ืืืื, ืื ืืขืงืข ืืจืืืก ืืื ื ืืฉื ืืืืฉื.
ืคึผืึทืืขืืืข ืืงืกืคึผืึทื ืฉืึทื ืืืคึฟื, ืืืึธืก ืึทืจืืขื ืืืืื ืคึฟืึทืจ ืื GIF ืกืืจืืงืืืจ. ืขืก ืืืขื ืืืื ืืขืจืกื ืขืคืขืงืืืื ืืืืฃ ืืืืืขืจ ืืื ืึท ืงืืืื ืคึผืึทืืืืจืข. ืืืึทื ืขืกืึทื ืก ืืื ืึทื ืขืก ืื ืงืจืืกืื ืื ืืจืืืก ืคืื ืืขืจ ืคึผืึทืืืืจืข, ืืขืจืืื ืคึผืจืึทืืืืืืื ื ื ืึธื ืคึผืืึทืฅ ืคึฟืึทืจ ืฉืจืืืื ืื ื ืืืืืง ืืืืขืก ืืื ืคึผืืึทืฅ ืคืื ืงืึธืืืจ ืืืืขืก. ืืืื ืืืจ ืืึทืืจืึทืืื ืึทื ืื ืืื ืืืื ืืจืืืก ืคืื ืื ืคึผืึทืืืืจืข ืืื 2 ืคืืจืื (6 ืืืืขืก), ืื ืืึทืงืกืืืื ืืจืืืก ืคืื ืื ืขืืืขืืื ืึธื ืืึธื ืงืขื ืขื ืืืื 256 ร 3-6 = 762 ืืืืขืก. ืื ืืืกืึธืจื ืืื ื ืืืขืจืืง ืงืจืืคึผืืึธืืจืึทืคืืง ืืืืขืจืืืื; ืื ืขืืืขืืื ืึธื ืืึธื ืงืขื ืขื ืืืื ืืืืขื ืขื ืืื ืงืืื ืืขืงืกื ืจืขืืึทืงืืึธืจ ืืืื ืืขืจ ืึธื ืืึธื ืืื ื ืืฉื ืืื ืืขืจืืขื ืืง ืฆื ื ืึธื ืขื ืงืจืืคึผืฉืึทื.
ืคึผืจืึทืงืืืฉ ืืืื
ืคึผืจืึธืืจืึทื ืคึผืืึทื
ืึทืืข ื ืืืืืง ืืืฉืืจืื ืคึฟืึทืจ ืืืคึผืืึทืืขื ืื ื ืขื ืงืจืืคึผืฉืึทื ืืื ืืขืงืจืืคึผืืืึธื ืึทืืืขืจืืืึทืื ืืืขื ืืืื ืึทืจืืึทื ืืขืจืขืื ื ืืื ืืขื ืคึผืขืงื com.tsarik.steganography
. ืืขื ืคึผืขืงื ืืืื ืื ืฆืืืื ื Encryptor
ืืื ืืขืืืึธืืก encrypt
ะธ decrypt
, ืงืืึทืก Binary
, ืืืึธืก ืืื ืื ืคืืืืงืืื ืฆื ืึทืจืืขืื ืืื ืืืกื ืขืจืืื, ืืื ืืขืืื ื ืืื ืืืกื ืขื ืงืืืกื UnableToEncryptException
ะธ UnableToDecryptException
, ืืืึธืก ืืึธื ืืืื ืืขื ืืฆื ืืื ืฆืืืื ื ืืขืืืึธืืก Encryptor
ืืื ืคืึทื ืคืื ืงืึธืืืจืื ื ืืื ืืืงืึธืืืื ื ืขืจืจืึธืจืก ืจืืกืคึผืขืงืืืืืื.
ืืืืคึผื ืคึผืจืึธืืจืึทื ืคึผืขืงื com.tsarik.programs.gifed
ืืืขื ืึทืจืืึทื ื ืขืืขื ืึท ืจืึทื ืึทืืึทื ืคึผืจืึธืืจืึทื ืงืืึทืก ืืื ืึท ืกืืึทืืืง ืืืคึฟื main
, ืึทืืึทืืื ื ืืืจ ืฆื ืืืืคื ืืขื ืคึผืจืึธืืจืึทื; ืึท ืงืืึทืก ืืืึธืก ืกืืึธืจื ืคึผืจืึธืืจืึทื ืคึผืึทืจืึทืืขืืขืจืก; ืืื ืคึผืึทืงืึทืืืฉืึทื ืืื ืื ืืขืจืข ืงืืืกื.
ืื ืืืคึผืืึทืืขื ืืืืฉืึทื ืคืื ืื ืึทืืืขืจืืืึทืื ืืื ืืืขื ืืืื ืืขืจืืื ืื ืืื ืืขื ืคึผืขืงื com.tsarik.programs.gifed.gif
ืงืืืกื GIFEncryptorByLSBMethod
ะธ GIFEncryptorByPaletteExtensionMethod
. ืืืืืข ืคืื โโืื ืงืืืกื ืืืขื ืื ืกืืจืืืขื ื ืื ืฆืืืื ื Encryptor
.
ืืึทืืืจื ืืืืฃ ืื ืกืืจืืงืืืจ ืคืื ืื GIF ืคึฟืึธืจืืึทื, ืืืจ ืงืขื ืขื ืืึทืื ืึท ืืขื ืขืจืึทื ืึทืืืขืจืืืึทื ืคึฟืึทืจ ืื ืืจืึธืืืืกืื ื ืึท ืึธื ืืึธื ืืื ืื ืืืื ืคึผืึทืืืืจืข:
ืฆื ืืึทืฉืืืืขื ืืขื ืืืึทืืืึทื ืคืื ืึท ืึธื ืืึธื ืืื ืึท ืืืื, ืขืก ืืื ื ืืืืืง ืฆื ืืืืื ืึท ืืืืขืจ ืกืืงืืืึทื ืก ืคืื ืืืื ืฆื ืื ืึธื ืืืื ืคืื ืื ืึธื ืืึธื, ืืืึธืก ืื ืืืงืึธืืืขืจ ืืืืขื ื ืขืจืฉืืขืจ ืืื ืืฉืขืงืก ืคึฟืึทืจ ืจืืืืืง. ืืืื ืขืก ืืื ื ืืฉื ืืืืึทืื, ืขืก ืืื ืงืึทื ืกืืืขืจื ืึทื ืขืก ืืื ืงืืื ืคืึทืจืืึธืจืื ืึธื ืืึธื ืืื ืื ืืืื. ืืืืึทืืขืจ ืืืจ ืืึทืจืคึฟื ืฆื ืกืคึผืขืฆืืคืืฆืืจื ืื ืืขื ื ืคืื ืื ืึธื ืืึธื. ืืขืจื ืึธื ืืขืจ ืืขืงืกื ืคืื ืืขืจ ืึธื ืืึธื ืืื.
ืงืืึทืก ืืืึทืืจืึทืืข ืคืื โโืื ืืื ืฆืข ืึทืคึผืืึทืงืืืฉืึทื:
ืืืคึผืืึทืืขื ืืืืฉืึทื ืคืื ืื ืคึผืจืึธืืจืึทื
ืื ืืืคึผืืึทืืขื ืืืืฉืึทื ืคืื ืื ืืื ืฆืข ืคึผืจืึธืืจืึทื ืงืขื ืขื ืืืื ืฆืขืืืืื ืืื ืฆืืืื ืงืึทืืคึผืึธืื ืึทื ืฅ: ืืืคึผืืึทืืขื ืืืืฉืึทื ืคืื ืฆืืืื ื ืขื ืงืจืืคึผืฉืึทื ืืื ืืขืงืจืืคึผืืืึธื ืืขืืืึธืืก Encryptor
, ืืื ืงืืืกื GIFEncryptorByLSBMethod
ะธ GIFEncryptorByPaletteExtensionMethod
, ืืื ืื ืืืคึผืืึทืืขื ืืืืฉืึทื ืคืื ืื ืืึทื ืืฆืขืจ ืฆืืืื ื.
ืืึทืืจืึทืืื ืื ืงืืึทืก GIFEncryptorByLSBMethod
.
ืคืืขืืืก firstLSBit
ะธ secondLSBit
ืึทื ืืืึทืืื ืื ื ืืืขืจ ืคืื ืืืื ืคืื ืืขืืขืจ ืืืื ืคืื ืื ืืืื ืืื ืืืึธืก ืื ืึธื ืืึธื ืืึธื ืืืื ืืจืืื ืืื ืคืื ืืื ืื ืึธื ืืึธื ืืึธื ืืืื ืืืืขื ืขื. ืคืขืื checkSequence
ืกืืึธืจื ืึท ืืฉืขืง ืืืกื ืกืืงืืืึทื ืก ืฆื ืขื ืฉืืจ ืืขืจืงืขื ืื ื ืคืื ืื ืขืืืขืืื ืึธื ืืึธื. ืกืืึทืืืง ืืืคึฟื getEncryptingFileParameters
ืงืขืจื ืื ืคึผืึทืจืึทืืขืืขืจืก ืคืื ืื ืกืคึผืขืกืึทืคืืื ืืขืงืข ืืื ืื ืงืขืจืึทืงืืขืจืืกืืืงืก ืคืื ืื ืคึผืึธืืขื ืฆืืขื ืึธื ืืึธื.
ืืืคึฟื ืึทืืืขืจืืืึทื encrypt
ืงืืึทืก GIFEncryptorByLSBMethod
:
ืืื ืืืื ืงืึธื:
@Override
public void encrypt(File in, File out, String text) throws UnableToEncodeException, NullPointerException, IOException {
if (in == null) {
throw new NullPointerException("Input file is null");
}
if (out == null) {
throw new NullPointerException("Output file is null");
}
if (text == null) {
throw new NullPointerException("Text is null");
}
// read bytes from input file
byte[] bytes = new byte[(int)in.length()];
InputStream is = new FileInputStream(in);
is.read(bytes);
is.close();
// check format
if (!(new String(bytes, 0, 6)).equals("GIF89a")) {
throw new UnableToEncodeException("Input file has wrong GIF format");
}
// read palette size property from first three bits in the 10-th byte from the file
byte[] b10 = Binary.toBitArray(bytes[10]);
byte bsize = Binary.toByte(new byte[] {b10[0], b10[1], b10[2]});
// calculate color count and possible message length
int bOrigColorCount = (int)Math.pow(2, bsize+1);
int possibleMessageLength = bOrigColorCount*3/4;
int possibleTextLength = possibleMessageLength-2;// one byte for check and one byte for message length
if (possibleTextLength < text.length()) {
throw new UnableToEncodeException("Text is too big");
}
int n = 13;
// write check sequence
for (int i = 0; i < checkSequence.length/2; i++) {
byte[] ba = Binary.toBitArray(bytes[n]);
ba[firstLSBit] = checkSequence[2*i];
ba[secondLSBit] = checkSequence[2*i+1];
bytes[n] = Binary.toByte(ba);
n++;
}
// write text length
byte[] cl = Binary.toBitArray((byte)text.length());
for (int i = 0; i < cl.length/2; i++) {
byte[] ba = Binary.toBitArray(bytes[n]);
ba[firstLSBit] = cl[2*i];
ba[secondLSBit] = cl[2*i+1];
bytes[n] = Binary.toByte(ba);
n++;
}
// write message
byte[] textBytes = text.getBytes();
for (int i = 0; i < textBytes.length; i++) {
byte[] c = Binary.toBitArray(textBytes[i]);
for (int ci = 0; ci < c.length/2; ci++) {
byte[] ba = Binary.toBitArray(bytes[n]);
ba[firstLSBit] = c[2*ci];
ba[secondLSBit] = c[2*ci+1];
bytes[n] = Binary.toByte(ba);
n++;
}
}
// write output file
OutputStream os = new FileOutputStream(out);
os.write(bytes);
os.close();
}
ืึทืืืขืจืืืึทื ืืื ืืงืืจ ืงืึธื ืคืื ืืขื ืืืคึฟื decrypt
ืงืืึทืก GIFEncryptorByLSBMethod
:
@Override
public String decrypt(File in) throws UnableToDecodeException, NullPointerException, IOException {
if (in == null) {
throw new NullPointerException("Input file is null");
}
// read bytes from input file
byte[] bytes = new byte[(int)in.length()];
InputStream is = new FileInputStream(in);
is.read(bytes);
is.close();
// check format
if (!(new String(bytes, 0, 6)).equals("GIF89a")) {
throw new UnableToDecodeException("Input file has wrong GIF format");
}
// read palette size property from first three bits in the 10-th byte from the file
byte[] b10 = Binary.toBitArray(bytes[10]);
byte bsize = Binary.toByte(new byte[] {b10[0], b10[1], b10[2]});
// calculate color count and possible message length
int bOrigColorCount = (int)Math.pow(2, bsize+1);
int possibleMessageLength = bOrigColorCount*3/4;
int possibleTextLength = possibleMessageLength-2; // one byte for check and one byte for message length
int n = 13;
// read check sequence
byte[] csBits = new byte[checkSequence.length];
for (int i = 0; i < 4; i++) {
byte[] ba = Binary.toBitArray(bytes[n]);
csBits[2*i] = ba[firstLSBit];
csBits[2*i+1] = ba[secondLSBit];
n++;
}
byte cs = Binary.toByte(csBits);
if (cs != Binary.toByte(checkSequence)) {
throw new UnableToDecodeException("There is no encrypted message in the image (Check sequence is incorrect)");
}
// read text length
byte[] cl = new byte[8];
for (int i = 0; i < 4; i++) {
byte[] ba = Binary.toBitArray(bytes[n]);
cl[2*i] = ba[firstLSBit];
cl[2*i+1] = ba[secondLSBit];
n++;
}
byte textLength = Binary.toByte(cl);
if (textLength < 0) {
throw new UnableToDecodeException("Decoded text length is less than 0");
}
if (possibleTextLength < textLength) {
throw new UnableToDecodeException("There is no messages (Decoded message length (" + textLength + ") is less than Possible message length (" + possibleTextLength + "))");
}
// read text bits and make text bytes
byte[] bt = new byte[textLength];
for (int i = 0; i < bt.length; i++) {
byte[] bc = new byte[8];
for (int bci = 0; bci < bc.length/2; bci++) {
byte[] ba = Binary.toBitArray(bytes[n]);
bc[2*bci] = ba[firstLSBit];
bc[2*bci+1] = ba[secondLSBit];
n++;
}
bt[i] = Binary.toByte(bc);
}
return new String(bt);
}
ืืืคึผืืึทืืขื ืืืืฉืึทื ืคืื ืื ืงืืึทืก GIFEncryptorByPaletteExtensionMethod
ืืืขื ืืืื ืขื ืืขื, ืืืืื ืืขืจ ืืืคึฟื ืคืื ืฉืคึผืึธืจื / ืืืืขื ืขื ืืื ืคึฟืึธืจืืึทืฆืืข ืืื ืึทื ืืขืจืฉ.
ืืื ืงืืึทืก MainFrame
ืจืึทืคึผืขืจ ืืขืืืึธืืก ืืขื ืขื ืืืกืงืจืืืื: encryptImage(Encryptor encryptor)
ะธ decryptImage(Encryptor encryptor)
, ืคึผืจืึทืกืขืกืื ื ืื ืจืขืืืืืึทืื ืคืื ืฆืืืื ื ืืขืืืึธืืก Encryptor
ืืื ืื ืืขืจืึทืงืืื ื ืืื ืืขืจ ืืึทื ืืฆืขืจ, ื"ื ืขืคื ืึท ืืขืงืข ืกืขืืขืงืฆืืข ืืืึทืืึธื, ืืืืึทืืื ื ืืขืืช ืึทืจืืืงืืขื, ืืื"ื ื; ืืื ืืืื ืื ืืขืจืข ืืขืืืึธืืก: openImage()
, ืึทืืึทืืื ื ืืขืจ ืืึทื ืืฆืขืจ ืฆื ืืืืกืงืืืึทืื ืึท ืืืื, exit()
, ืืืึธืก ืึทืจืืืกืืึทื ื ืื ืึทืคึผืืึทืงืืืฉืึทื. ืื ืืขืืืึธืืก ืืขื ืขื ืืขืจืืคื ืคืื Action
ืก ืงืึธืจืึทืกืคึผืึทื ืืื ื ืืขื ืื ืืืื. ืืขืจ ืงืืึทืก ืืืื ืืืคึผืืึทืืึทื ืฅ ืึทืืืืืืขืจื ืืขืืืึธืืก: createComponents()
- ืฉืึทืคืื ื ืคืื ืคืึธืจืขื ืงืึทืืคึผืึธืื ืึทื ืฅ, loadImageFile(File f)
- ืืึธืืืื ื ืึท ืืืื ืืื ืึท ืกืคึผืขืฆืืขื ืงืึธืืคึผืึธื ืขื ื ืคึฟืื ืึท ืืขืงืข. ืืืคึผืืึทืืขื ืืืืฉืึทื ืคืื ืื ืงืืึทืก GIFEncryptorByPaletteExtensionMethod
ืขื ืืขื ืฆื ืื ืงืืึทืก ืืืคึผืืึทืืขื ืืืืฉืึทื GIFEncryptorByLSBMethod
, ืืขืจ ืืืืคึผื ืืืืืง ืืื ืืื ืื ืืืขื ืึธื ืืึธื ืืืืขืก ืืขื ืขื ืืขืฉืจืืื ืืื ืืืืขื ืขื ืคืื ืื ืคึผืึทืืืืจืข.
ืคึผืจืึธืืจืึทื ืึธืคึผืขืจืึทืฆืืข
LBS ืืืคึฟื
ืืื ืก ืืึธืื ืขืก ืืื ืึท ืืืื ืืื ืืึธืก:
ืืื ืืขื ืืืื, ืื ืคึผืึทืืืืจืข ืืืฉืืืื ืคืื 256 ืคืืจืื (ืืื ืคึผืึทืื ื ืกืึทืืืขืก). ืื ืขืจืฉืืข ืคืืจ ืคืืจืื ืืขื ืขื: ืืืืึทืก, ืฉืืืึทืจืฅ, ืจืืื, ืืจืื. ืื ืืขืจืข ืคืืจืื ืืขื ืขื ืฉืืืึทืจืฅ. ืื ืืืืืืืข ืคึผืึทืืืืจืข ืืืกื ืกืืงืืืึทื ืก ืืืขื ืืืื ืืื ืืืื:
11111111 11111111 11111111 00000000 00000000 00000000 11111111 00000000 00000000 00000000 11111111 00000000...
ืึทืืึธื ืืขืจ ืึธื ืืึธื ืืื ืขืืืขืืื, ืื ืึทื ืืขืจืืืื ื ืืืื ืืืขื ืืืื ืจืืคึผืืืืกื ืืื ืื ืืืื ืคืื ืืขืจ ืึธื ืืึธื. ืื ืจืืืึทืืืื ื ืืืื ืืื ืึผืืขื ื ืื ืึทื ืืขืจืฉ ืคืื ืืขืจ ืึธืจืืืื ืขื.
ืึธืจืืืื ืขื
ืืืื ืืื ืขืืืขืืื ืึธื ืืึธื
ืคึผืึทืืขืืืข ืืงืกืคึผืึทื ืฉืึทื ืืืคึฟื
ืืืขื ืืืจ ืขืคึฟืขื ืขื ืึท ืืืื ืืื ืึท ืึธื ืืึธื ืืื ืืขื ืืืคึฟื, ืืืจ ืืืขื ืืขื ืื ืคืืืืขื ืืข ืืืื:
ืขืก ืืื ืงืืึธืจ ืึทื ืืขืจ ืืืคึฟื ืืืขื ื ืืฉื ืึทืจืืขืื ืคึฟืึทืจ ืคืื-ืคืืขืืืฉื ืฉืคึผืืึธื ืึทืืฉ ืึทืงืืืืืืืขืื, ืืื ืงืขื ืืึทืจืคื ื ืึธื ืขื ืงืจืืคึผืฉืึทื ืคืื ืืขื ืึธื ืืึธื.
ืขื ืงืจืืคึผืฉืึทื / ืืขืงืจืืคึผืืืึธื ืืื ืึทื ืืืึทืืขื ืืืืืขืจ ืึทืจืืขื ืคึผืื ืงื ืืื ืืื ืจืขืืืืขืจ ืกืืึทืืืง ืืืืืขืจ, ืึธืืขืจ ืื ืึทื ืึทืืืืฉืึทื ืืื ื ืืฉื ืฆืขืืจืืื.
ืืงืืจืื ืืขื ืืฆื:
http://ru.wikipedia.org/wiki/Gif http://ru.wikipedia.org/wiki/ะกัะตะณะฐะฝะพะณัะฐัะธั http://home.onego.ru/~chiezo/gif.htm
ืืึทืื ืืึธืื:
ืืงืืจ: www.habr.com