IM cipher code Cipher model Substitution cipher For
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 ASCII Text 97 a 98 encrypt Text Decrypt 68 D a D 69 E '7', b ] 70 F ']', 99 c V 71 G 'f', 100 d ? 72 H ', ', 101 e * 73 I 'E', 102 f G 74 J 'F', 103 g 6 75 K 'p', 104 h w 76 L 'Y', 105 i @
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 [root@bridge ~]# psad -m /var/log/messages. 1 --gnuplot --CSV-fields "dst: not 192. 168. 10. 0/24 dp: countuniq" -gnuplot-graph points --gnuplot-xrange 0: 10000 --gnuplot-file-prefix test 1 [+] Entering Gnuplot mode. . . [+] Parsing iptables log messages from file: /var/log/messages. 1 [+] Parsed 71992 iptables log messages. [+] Writing parsed iptables data to: test 1. dat [+] Writing gnuplot directive file: test 1. gnu [root@bridge ~]# gnuplot test 1. gnu f 1 jj. Q$]1@? 6*R~Fq. RKt. D? Rol. RMUD 1 M Cj 6 Ml*tt. D 6*t. N=Roo 6_<KCj. QRoo. Ox+o G@*C? t. R, ? t. Q&_j. Q=k 0 N=`"N=r. Nr. M 0 z. R ? K&Vj<_Q<_@^, Roo 6_<KCj. Qo 61 DKw. R Kj@_Qt. Roo 6_<KCj. Qom 1 D_6*Rr&=rrrr Roo 6_<KCj. Qo. G@C*o. K 1*G@m. RQ*t. Q=. fe. FRI_Q*1@_6 R%_<KCj. QRlj? *NNN. fe. F Ra. D 1 t@_6 R@KQD]C*t. RCj 6 Rl*tt. D 6*t. R G 1 jl. RG@C*&RMUD 1 MCj 6 Ml*tt. D 6*t. N =. fe. FRa. D 1 t*? RE=kk 0 R@KQD]C*t. RCj 6 R l*tt. D 6*t. N. fe. FR 81@Q@_6 RKD 1 t*? R@ KQD]C*t. R? DQDRQj&RQ*t. Q=N? DQ. fe. F R 81@Q@_6 R 6_<KCj. QR? @1*VQ@U*R G@C*&RQ*t. Q=N 6_<. . f 1 jj. Q$]1@? 6*R~ Fq. R 6_<KCj. QRQ*t. Q=N 6_<.
- Slides: 8