Encryption Systems 4/14/18. We have seen earlier that Python supports the sorting of lists with the built- in.sort( ) method

Similar documents
Lecture 1: Introduction

Classical Cryptography

CPSC 467: Cryptography and Computer Security

B. Substitution Ciphers, continued. 3. Polyalphabetic: Use multiple maps from the plaintext alphabet to the ciphertext alphabet.

Grade 7 and 8 Math Circles March 19th/20th/21st. Cryptography

o Broken by using frequency analysis o XOR is a polyalphabetic cipher in binary

The number theory behind cryptography

Colored Image Ciphering with Key Image

Cryptanalysis on short messages encrypted with M-138 cipher machine

Block Ciphers Security of block ciphers. Symmetric Ciphers

EE 418 Network Security and Cryptography Lecture #3

Classification of Ciphers

Cryptography. Module in Autumn Term 2016 University of Birmingham. Lecturers: Mark D. Ryan and David Galindo

Example Enemy agents are trying to invent a new type of cipher. They decide on the following encryption scheme: Plaintext converts to Ciphertext

EE 418: Network Security and Cryptography

Drill Time: Remainders from Long Division

Public Key Cryptography Great Ideas in Theoretical Computer Science Saarland University, Summer 2014

Vernam Encypted Text in End of File Hiding Steganography Technique

TMA4155 Cryptography, Intro

Chapter 4 The Data Encryption Standard

SECURITY OF CRYPTOGRAPHIC SYSTEMS. Requirements of Military Systems

1 Introduction to Cryptology

MA 111, Topic 2: Cryptography

Mathematics Explorers Club Fall 2012 Number Theory and Cryptography

Successful Implementation of the Hill and Magic Square Ciphers: A New Direction

FPGA Implementation of Secured Image STEGNOGRAPHY based on VIGENERE CIPHER and X BOX Mapping Techniques

Linear Congruences. The solutions to a linear congruence ax b (mod m) are all integers x that satisfy the congruence.

Stream Ciphers And Pseudorandomness Revisited. Table of contents

Network Security: Secret Key Cryptography

Example Enemy agents are trying to invent a new type of cipher. They decide on the following encryption scheme: Plaintext converts to Ciphertext

A Novel Encryption System using Layered Cellular Automata

Software Security. Encryption. Encryption. Encryption. Encryption. Encryption. Week 5 Part 1. Masking Data from Unwelcome eyes

Interleaving And Channel Encoding Of Data Packets In Wireless Communications

Cryptography CS 555. Topic 20: Other Public Key Encryption Schemes. CS555 Topic 20 1

Lecture 32. Handout or Document Camera or Class Exercise. Which of the following is equal to [53] [5] 1 in Z 7? (Do not use a calculator.

Discrete Mathematics & Mathematical Reasoning Multiplicative Inverses and Some Cryptography

DUBLIN CITY UNIVERSITY

Historical cryptography 2. CSCI 470: Web Science Keith Vertanen

Cryptography s Application in Numbers Station

An Introduction to Traditional Cryptography and Cryptanalysis for Amateurs. Chris Spackman

Table 1: Vignere cipher with key MATH.

La Storia dei Messaggi Segreti fino alle Macchine Crittografiche

Dr. V.U.K.Sastry Professor (CSE Dept), Dean (R&D) SreeNidhi Institute of Science & Technology, SNIST Hyderabad, India. P = [ p

DUBLIN CITY UNIVERSITY

A basic guitar is a musical string instrument with six strings. In standard tuning they have the notes E, A, D, G, B and E

Quasi group based crypto-system

Grade 7/8 Math Circles Winter March 24/25 Cryptography

Codes and Nomenclators

Chapter 4 MASK Encryption: Results with Image Analysis

Anusuya S. Jeya et.al; International Journal of Advance Research, Ideas and Innovations in Technology

ElGamal Public-Key Encryption and Signature

Journal of Discrete Mathematical Sciences & Cryptography Vol. ( ), No., pp. 1 10

V.Sorge/E.Ritter, Handout 2

MA/CSSE 473 Day 9. The algorithm (modified) N 1

JOINT BINARY CODE COMPRESSION AND ENCRYPTION

Secure Distributed Computation on Private Inputs

Image Steganography with Cryptography using Multiple Key Patterns

#27: Number Theory, Part II: Modular Arithmetic and Cryptography May 1, 2009

Automated Analysis and Synthesis of Block-Cipher Modes of Operation

Pixel Image Steganography Using EOF Method and Modular Multiplication Block Cipher Algorithm

The Cryptoclub. Blackline Masters. Using Mathematics to Make and Break Secret Codes. to accompany. Janet Beissinger Vera Pless

Symmetric-key encryption scheme based on the strong generating sets of permutation groups

A very brief guide to writing a good technical abstract. Computer Architecture Laboratory Jeremy R. Cooperstock

Design and Implementation of Game Based Security Model to Secure the Information Contents

Cryptography Made Easy. Stuart Reges Principal Lecturer University of Washington

Implementation and Performance Testing of the SQUASH RFID Authentication Protocol

DES Data Encryption standard

Diffie-Hellman key-exchange protocol

Lecture #2. EE 471C / EE 381K-17 Wireless Communication Lab. Professor Robert W. Heath Jr.

Grade 7 & 8 Math Circles October 12, 2011 Modular Arithmetic

A Secure Image Encryption Algorithm Based on Hill Cipher System

Chapter 3 LEAST SIGNIFICANT BIT STEGANOGRAPHY TECHNIQUE FOR HIDING COMPRESSED ENCRYPTED DATA USING VARIOUS FILE FORMATS

Course Business. Harry. Hagrid. Homework 2 Due Now. Midterm is on March 1. Final Exam is Monday, May 1 (7 PM) Location: Right here

Number Theory and Public Key Cryptography Kathryn Sommers

Chaotically Modulated RSA/SHIFT Secured IFFT/FFT Based OFDM Wireless System

CRYPTANALYSIS OF THE PERMUTATION CIPHER OVER COMPOSITION MAPPINGS OF BLOCK CIPHER

Merkle s Puzzles. c Eli Biham - May 3, Merkle s Puzzles (8)

A STENO HIDING USING CAMOUFLAGE BASED VISUAL CRYPTOGRAPHY SCHEME

A Cryptosystem Based on the Composition of Reversible Cellular Automata

Towards a Cryptanalysis of Scrambled Spectral-Phase Encoded OCDMA

A Public-key-based Optical Image Cryptosystem with Data Embedding Techniques

High-Capacity Reversible Data Hiding in Encrypted Images using MSB Prediction

Enhance Image using Dynamic Histogram and Data Hiding Technique

Number Theory and Security in the Digital Age

Amalgamation of Cyclic Bit Operation in SD-EI Image Encryption Method: An Advanced Version of SD-EI Method: SD-EI Ver-2

Why (Special Agent) Johnny (Still) Can t Encrypt: A Security Analysis of the APCO Project 25 Two-Way Radio System

Algorithmic Number Theory and Cryptography (CS 303)

Seventeenth Annual University of Oregon Eugene Luks Programming Competition

New Linear Cryptanalytic Results of Reduced-Round of CAST-128 and CAST-256

Purple. Used by Japanese government. Not used for tactical military info. Used to send infamous 14-part message

LECTURE VI: LOSSLESS COMPRESSION ALGORITHMS DR. OUIEM BCHIR

MAT 302: ALGEBRAIC CRYPTOGRAPHY. Department of Mathematical and Computational Sciences University of Toronto, Mississauga.

Secure Function Evaluation

Available online at ScienceDirect. Procedia Computer Science 34 (2014 )

Proceedings of Meetings on Acoustics

arxiv: v1 [nlin.cd] 29 Oct 2007

Keywords: dynamic P-Box and S-box, modular calculations, prime numbers, key encryption, code breaking.

Geoencryption Using Loran

Proposal of New Block Cipher Algorithm. Abstract

IND-CCA Secure Hybrid Encryption from QC-MDPC Niederreiter

Transcription:

Sorting Encryption Systems CSC121, Introduction to Computer Programming We have seen earlier that Python supports the sorting of lists with the built- in.sort( ) method >>> a = [ 5, 2, 3, 1, 4 ] >>> a.sort( ) >>> a [ 1, 2, 3, 4, 5 ] Sorting There is also the sorted( ) function that builds a new sorted list from an iterable >>> d = { 4 : D, 3 : B, 1 : E, 5 : B, 2 : A } >>> d {5: 'B', 2: 'A', 3: 'B', 1: 'E', 4: 'D'} >>> sorted(d.items( )) [(1, 'E'), (2, 'A'), (3, 'B'), (4, 'D'), (5, 'B')] Reverse Sorting The operator module provides tools that permit more exotic forms of sorting the itemgetter( ) function can be used to pick out which item to sort the reverse flag can also be used to create descending sort orders 1

: print the list of students in descending order by age from operator import itemgetter tuples: Name, Grade, Age students = [ ("John", "A", 10), ("Jane", "A", 12), ("Dave", "B", 15) ] def reversesorttuples(tuples): list = sorted(tuples, key=itemgetter(2), reverse=true) print list from operator import itemgetter students = [ ("John", "A", 10), ("Jane", "A", 12), ("Dave", "B", 15) ] def reversesorttuples(tuples): list = sorted(tuples, key=itemgetter(2), reverse=true) print list identify which item to base the sort descending sort indicated >>> reversesorttuples(students) [('Dave', 'B', 15), ('Jane', 'A', 12), ('John', 'A', 10)] Cryptography and Cryptosystems Cryptography and Cryptosystems cryptography is the study of secret codes a cryptosystem is a system that provides the means for transmitting and receiving secure messages that are shared only by intended agents computer networks have made cryptosystems and cryptography a necessity for secure commercial transactions 2

Email SMTP is a messaging protocol (like other application layer protocols here it is simulated using a telnet session $ telnet example.org 25 S: 220 example.org ESMTP Sendmail 8.13.1/8.13.1; Wed, 30 Aug 20xx 07:36:42-0400 C: HELO mailout1.phrednet.com S: 250 example.org Hello ip068.subnet71.gci- net.com [216.183.71.68], pleased to meet you C: MAIL FROM:xxxx@example.com S: 250 2.1.0 <xxxx@example.com>... Sender ok C: RCPT TO:yyyy@example.com S: 250 2.1.5 <yyyy@example.com>... Recipient ok C: DATA S: 354 Enter mail, end with "." on a line by itself From: Dave\r\nTo: Test Recipient\r\nSubject: SPAM SPAM SPAM\r\n\r\nThis is message 1 from our test script.\r\n.\r\n S: 250 2.0.0 k7tkibyb024731 Message accepted for delivery C: QUIT S: 221 2.0.0 example.org closing connection Connection closed by foreign host. $ Cryptosystems Cryptosystems Symmetric Secret Key Cryptosystems encryption is the process that converts the plaintext message to a ciphertext using some key required by the encryption algorithm decryption is the process that converts the ciphertext to a plaintext message using some key required by the decryption algorithm for centuries, the only known type of cryptosystem was symmetric secret key cryptosystems symmetric key means that the sender and receiver must possess the same key in order to encrypt messages and/or decrypt codes secret key means that the encryption/decryption processes are compromised when the key is known by unauthorized agents 3

Caesar Cipher One of the earliest recorded symmetric secret key systems is known as the Caesar cipher the historian Suetonius tells us that Julius Caesar used this method with a key value of 3 each letter of the message is shifted three places in the alphabet to create the ciphertext ABCDEFGHIJKLMNOPQRSTUVWXYZ 3 DEFGHIJKLMNOPQRSTUVWXYZABC HELLO WORLD is encrypted as KHOOR ZRUOG Substitution Ciphers Caesar Cipher is an example of a simple substitution cipher whereby a individual symbol is assigned a different value (other than itself) for purposes of creating a ciphertext Caesar Cipher is a monoalphabetic substitution cipher each symbol has only one ciphertext assignment Polyalphabetic substitution ciphers use multiple monoalphabetic assignment for each symbol Vignere Cipher is an example Substitution Ciphers Vignere cipher can be considered an n- place Caesar cipher where n = the length or number of keys a b c d e f g h i j k l m n o p q r s t u v w x y z S T U V W X Y Z A B C D E F G H I J K L M N O P Q R O P Q R S T U V W X Y Z A B C D E F G H I J K L M N N O P Q R S T U V W X Y Z A B C D E F G H I J K L M G H I J K L M N O P Q R S T U V W X Y Z A B C D E F B C D E F G H I J K L M N O P Q R S T U V W X Y Z A I J K L M N O P Q R S T U V W X Y Z A B C D E F G H R S T U V W X Y Z A B C D E F G H I J K L M N O P Q D E F G H I J K L M N O P Q R S T U V W X Y Z A B C Substitution Ciphers the Caesar Cipher is both easy to implement and to break a brute force attack requires only 25 attempts general substitution ciphers are not so easy to break if each letter of the alphabet is encoded with a different symbol, then the total number of possible codes would be 25 24 23 23 2 1 = 25! or approximately 4 10 24 The plaintext Fight Furman Fight becomes XWTNU NLUEOA LJOYW 4

Letter Frequencies fortunately, brute force methods are not always required. natural languages have redundancies in coding that can be exploited. for e.g., single letter frequencies in English are highly skewed Letter Frequencies there are common two- letter frequencies Letter Frequencies there are common three- letter frequencies too 5

6

N- grams a bigram is an instance of an n- gram, where n = 1, 2, 3, 4, zip( ) makes it easy to create n- grams N- grams How could we use zip( ) to create n- grams for letter frequencies? >>>list=['now,'is,'the,'time,'for,'all,'good,'men,'to,'come,'to,'the,'aid,'of,'their,'country'] >>> zip(list, list[1:]) [('Now', 'is'), ('is', 'the'), ('the', 'time'), ('time', 'for'), ('for', 'all'), ('all', 'good'), ('good', 'men'), ('men', 'to'), ('to', 'come'), ('come', 'to'), ('to', 'the'), ('the', 'aid'), ('aid', 'of'), ('of', 'their'), ('their', 'country')] >>> zip(list, list[1:], list[2:]) [('Now', 'is', 'the'), ('is', 'the', 'time'), ('the', 'time', 'for'), ('time', 'for', 'all'), ('for', 'all', 'good'), ('all', 'good', 'men'), ('good', 'men', 'to'), ('men', 'to', 'come'), ('to', 'come', 'to'), ('come', 'to', 'the'), ('to', 'the', 'aid'), ('the', 'aid', 'of'), ('aid', 'of', 'their'), ('of', 'their', 'country')] 7