IM cipher code. Cipher model Substitution cipher – For cleartext character, substitute character in encipher table – For ciphertext character, substitute.

Slides:



Advertisements
Similar presentations
1 Cryptosystems When defining a cryptosystem, details must be given of: The alphabets M and C the keyspace K and how keys are to be chosen The encryption.
Advertisements

By Sunny Mahesh and Andy Yuwen. Cryptography = Secret Messages = Cool Stuff Ciphers Difference between plaintext and ciphertext Enciphering and Deciphering.
Starting Out with C++, 3 rd Edition 1 Chapter 10 – Characters, Strings, and the string Class.
390 Codes, Ciphers, and Cryptography
Revision.
Cryptology with Spreadsheets A Computer Course for Everyone Jim Belk Texas A&M University.
1 DATA ABSTRACTION: USER DEFINED TYPES AND THE CLASS.
PASSING PARAMETERS 1. 2 Parameter Passing (by Value) Parameters Formal Parameters – parameters listed in the header of the function Variables used within.
CMPUT 101 Lab # 5 October 22, :00 – 17:00.
Conditional Operator (?:) Conditional operator (?:) takes three arguments (ternary) Syntax for using the conditional operator:
Array Application Programming. COMP102 Prog. Fundamentals I: Arrays Application / Slide 2 Character Array: Ex. 1 l Note: a palindrome is a word (or words)
1 10/11/06CS150 Introduction to Computer Science 1 do/while and Nested Loops.
ITIS 3200: Introduction to Information Security and Privacy Dr. Weichao Wang.
Nyhoff, ADTs, Data Structures and Problem Solving with C++, Second Edition, © 2005 Pearson Education, Inc. All rights reserved Standard.
The If/Else Statement, Boolean Flags, and Menus Page 180
CS 240: Data Structures Supplemental: Command Line Input.
Chris Christensen Northern Kentucky University. Lester S. Hill
 Write a program that uses a one dimension to do a table look-up  Learn about parallel arrays.
Chapter 05 (Part V) Control Statements: Part II. Nested For-Structures Consider the following codes: for (int i=0; i
Binary Search Trees II Morse Code.
© Copyright 2013 by Pearson Education, Inc. All Rights Reserved.1 Chapter 4 Mathematical Functions, Characters, and Strings.
3. The Nuts and Bolts of C++ Computer Programming 3. The Nuts and Bolts of C++ 1 Learning the C++ language 3. The Nuts and Bolts of C++ (4)
Mastering Char to ASCII AND DOING MORE RELATED STRING MANIPULATION Why VB.Net ?  The Language resembles Pseudocode - good for teaching and learning fundamentals.
1 CS 192 Lecture 5 Winter 2003 December 10-11, 2003 Dr. Shafay Shamail.
Cryptography By, Anthony Lonigro & Valentine Mbah.
Required Functions for Program 3 int readUntilValidBaseRead( ); int readNumbersReturningValue( int base ); int decimalValueOf( char chDigit ); bool isValid(
Introduction to Computer Security ©2004 Matt Bishop Information Security Principles Assistant Professor Dr. Sana’a Wafa Al-Sayegh 1 st Semester
CSE 232: C++ debugging in Visual Studio and emacs C++ Debugging (in Visual Studio and emacs) We’ve looked at programs from a text-based mode –Shell commands.
Chapter 7 Pointers: Java does not have pointers. Used for dynamic memory allocation.
Review the following : Flowcharting Variable declarations Output Input Arithmetic Calculations Conditional Statements Loops.
I/O in C++ October 7, Junaed Sattar. Stream I/O a stream is a flow of bytes/characters/ints or any type of data input streams: to the program output.
File I/O in C++ II. Open() function Open() is a member function in each classes ( fstream, ifstream, ofstream) Void fstream :: open ( const char *filename,
CRYPTOLOGY IN WWII ByJOE&SEAN. SIGABA SIGABA was similar to the Enigma in basic theory A series of rotors enciphered every character of the plaintext.
Encryption CS110: Computer Science and the Internet.
Road map char data type Reading –Liang 5: Chapter 2: 2.7.4; 2.9; –Liang 6: Chapter 2: 2.7.4; 2.9 –Liang 7: Chapter 2: 2.7.4; 2.9.
Cryptography.
1 Huffman Codes Drozdek Chapter Encoding Next we will add the capability to encode a message entered as normal text. The Huffman Tree that we use.
Computer Security coursework 3 Dr Alexei Vernitski.
Selection Control Structures 2 (L09) * Nested if Statements * The if-else Chain * Exercise: if, if-else, nested if, and if-else chain Selection Control.
ROT13 cipher. The ROT13 cipher is a substitution cipher with a specific key where the letters of the alphabet are offset 13 places. Example: all 'A's.
 Learn how to form strings using one-dimensional array  String manipulation functions:  strcpy  strrev  strcmp  Program using strings.
13/15/2016CS150 Introduction to Computer Science 1 Summary  Assignment due on Wednesday, October 29,  Tutor will be in the lab on Tuesday evening,
Introduction to Cryptography Lecture 4. Caesar Cipher Gaius Julius Caesar (100 B.C.- 44 B.C.) General Politician Dictator of Rome Creator of Caesar Cipher.
Encryption. LEARNING OBJECTIVES: BY THE END OF THE LESSON YOU SHOULD KNOW. What encryption is and why it is important The basics of encryption techniques.
Lesson xx Why use functions Program that needs a function Function header Function body Program rewritten using a function.
Characters must also be encoded in binary. ASCII maps characters to numbers.
Standard C++ Input/Output and String Classes
From the ASCII table… Symbol Decimal Binary A B 66
Data Transfer ASCII FILES.
Whatcha doin'? Aims: To understand the Caesar Cipher.
CAP Cryptographic Analysis Program
Don’t Forget (Enciphered) Codes
Data Encoding Characters.
CSEC 630 Innovative Education--snaptutorial.com
File I/O.
File I/O with Records Lesson xx
Introduction to Programming
Introduction to Programming
הרצאה 03 אבני היסוד של תוכנית ב- C
From the ASCII table… Symbol Decimal Binary A B 66
Simple Encryption- Lesson 5
CS150 Introduction to Computer Science 1
Cryptography and Cryptanalysis
do/while Selection Structure
Fundamental Programming
Digital Communications
HNDIT11034 More Operators.
Hill Cipher The Hill Cipher uses matrix multiplication to encrypt a message. First, you need to assign two numbers to each letter in the alphabet and also.
Computer Security Chapter Two
Basics Of Symmetric Encryption
Presentation transcript:

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_<.