IM cipher code
Cipher model Substitution cipher – For cleartext character, substitute character in encipher table – For ciphertext character, substitute character in decipher table
ASCII Table (first half)
Format of encryption table ASCIITextencrypt 97a D 98b ] 99c V 100d ? 101e * 102f G 103g 6 104h w ASCIITextDecrypt 68Da 69E'7', 70F']', 71G'f', 72H',', 73I'E', 74J'F', 75K'p', 76L'Y',
Encipher Table char encr[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 'b', '.', 0, 'c', '[', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'R', 'u', ',', 'q', '\t', 'Y', '\n', '\'', 'n', 's', 'v', 'e', 'H', 'o', 'N', 'M', 'r', '=', '0', ';', 'z', '/', '`', 'E', '\"', 'k', '&', '5', '>', 'i', 'p', ')', '$', '!', '2', 'O', '(', 'I', 'J', '%', 'Z', 'g', '\\', '{', 'h', '7', 'S', 'P', 'a', ' ', 'W', 'x', 'y', 'T', '+', '8', '-', 'L', '9', 'f', '#', 'F', '\r', 'B', '3', 'D', ']', 'V', '?', '*', 'G', '6', 'w', '}', '|', 'C', 'l', '_', 'j', 'K', '^', '1', 't', 'Q', '<', 'U', 'd', 'm', ':', 'A', 'X', '\f', '4', '~', 0, 0, 0 };
Decipher Table char decr[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, '$', '&', 0, '|', '^', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Q', 'A', '8', '\\', 'G', ':', '\'', 'D', '?', 'e', 'V', '\"', 'X', '\n', '5', '2', 'r', 'B', '`', '}', ';', 'g', 'M', 'W', 'Z', 'y', '3', 'u', '1', '<', 'd', 'i', 'z', '_', 'l', 'a', '7', ']', 'f', ',', 'E', 'F', 'p', 'Y', '/', '.', 'C', 'O', 't', ' ', 'N', 'U', 'v', 'c', 'R', '{', '%', 'H', '\r', 'J', 'b', 'q', 'n', '6', 'P', '\t', '\f', 'w', '+', '[', 'I', 'L', '=', 'o', '9', 'm', 'x', '(', '-', '>', '#', '0', ')', 's', '!', '*', 'h', 'S', 'T', '4', 'K', 'k', 'j', '~', 0, 0, 0};
Basic code snippet while (fin.get(inchar)) { if (((int) inchar) < 32) //for debugging cout << "Read (" << (int)inchar << ") "; if (task == 'e') // we are encoding { outchar = encr[(int)inchar]; } else { outchar = decr[(int)inchar]; } fout << outchar; if (((int) inchar) < 32) //for debugging cout << ": Wrote " << outchar << endl; }
example ~]# psad -m /var/log/messages.1 --gnuplot --CSV-fields "dst:not /24 dp:countuniq" -- gnuplot-graph points --gnuplot-xrange 0: gnuplot-file-prefix test1 [+] Entering Gnuplot mode... [+] Parsing iptables log messages from file: /var/log/messages.1 [+] Parsed iptables log messages. [+] Writing parsed iptables data to: test1.dat [+] Writing gnuplot directive file: test1.gnu ~]# gnuplot test1.gnu Cj6Ml*ttD6*tN=Roo6_<KCjQRooOx+o @KQD]C*tR?DQDRQj&RQ*tQ=N?DQ.f R~FqR6_<KCjQRQ*tQ=N6_<.