Homework 1 1 Substitution Cipher 2 OTP Cipher Variations 3 Perfect

Total Page:16

File Type:pdf, Size:1020Kb

Homework 1 1 Substitution Cipher 2 OTP Cipher Variations 3 Perfect ICS 268: Cryptography and Communication Security 9/28/2004 Homework 1 Due Tuesday, 10/5/2004, at the beginning of the class 1 Substitution cipher Have a look at the substitution cipher in Lecture Notes 1 (section 3.3) and recall the definition of perfect secrecy. Prove that the substitution cipher is perfectly secure for the special case of ℓ = 1, and that it it is not perfectly secure if ℓ ≥ 2. 2 OTP cipher variations n Notation: We will denote by A a set of n-long sequences of symbols A1A2 ...An where n each Ai is an element of A. For example, taking A = {0, 1}, we will write {0, 1} to denote a set of all n-long binary strings. We showed that One-Time Pad encryption satisfies perfect secrecy if M = K = {0, 1}ℓ, for any ℓ. In this exercise we will look at variations of the OTP cipher, where the messages and/or keys are not any binary strings. For example, consider set S of three 2-bit strings, S = {00, 01, 10}. Consider the following three variations on the OTP cipher. In all these variations the key generation algorithm chooses k ∈ K uniformly, and encryption and decryption work as in OTP, i.e. Enc(k,m)= k ⊕ m and Dec(k, c)= k ⊕ c. Consider the following three OTP variants: 1. Let M = Sℓ and K = {0, 1}2ℓ. In this way both the message and the key are (2ℓ)-long bit strings, but not every (2ℓ)-bit string can be a valid message. For example, for ℓ = 3, we could have m = [00, 01, 00] = 000100 but m = [11, 00, 11] = 110011 is not in M because 11 6∈ S. 2. Let M = {0, 1}2ℓ and K = Sℓ 3. Let M = K = Sℓ. [[Hint: This one is actually not perfectly secure...]] For each of these OTP variants do the following: (1) Say what the space C of the ciphertexts is, and note the sizes of the message space M and key space K; and (2) Say whether the resulting cipher is perfectly secure or not, and prove your answer. Do the sizes of the key space and the message space correlate in any way with whether or not the cipher is secure? Explain how and why. 3 Perfect Secrecy implies Shannon Secrecy [bonus] Prove that if an encryption scheme is perfectly secret than it must also be secret in Shannon’s sense. H1-1.
Recommended publications
  • Enhancing the Security of Caesar Cipher Substitution Method Using a Randomized Approach for More Secure Communication
    International Journal of Computer Applications (0975 – 8887) Volume 129 – No.13, November2015 Enhancing the Security of Caesar Cipher Substitution Method using a Randomized Approach for more Secure Communication Atish Jain Ronak Dedhia Abhijit Patil Dept. of Computer Engineering Dept. of Computer Engineering Dept. of Computer Engineering D.J. Sanghvi College of D.J. Sanghvi College of D.J. Sanghvi College of Engineering Engineering Engineering Mumbai University, Mumbai, Mumbai University, Mumbai, Mumbai University, Mumbai, India India India ABSTRACT communication can be encoded to prevent their contents from Caesar cipher is an ancient, elementary method of encrypting being disclosed through various techniques like interception plain text message into cipher text protecting it from of message or eavesdropping. Different ways include using adversaries. However, with the advent of powerful computers, ciphers, codes, substitution, etc. so that only the authorized there is a need for increasing the complexity of such people can view and interpret the real message correctly. techniques. This paper contributes in the area of classical Cryptography concerns itself with four main objectives, cryptography by providing a modified and expanded version namely, 1) Confidentiality, 2) Integrity, 3) Non-repudiation for Caesar cipher using knowledge of mathematics and and 4) Authentication. [1] computer science. To increase the strength of this classical Cryptography is divided into two types, Symmetric key and encryption technique, the proposed modified algorithm uses Asymmetric key cryptography. In Symmetric key the concepts of affine ciphers, transposition ciphers and cryptography a single key is shared between sender and randomized substitution techniques to create a cipher text receiver. The sender uses the shared key and encryption which is nearly impossible to decode.
    [Show full text]
  • Simple Substitution and Caesar Ciphers
    Spring 2015 Chris Christensen MAT/CSC 483 Simple Substitution Ciphers The art of writing secret messages – intelligible to those who are in possession of the key and unintelligible to all others – has been studied for centuries. The usefulness of such messages, especially in time of war, is obvious; on the other hand, their solution may be a matter of great importance to those from whom the key is concealed. But the romance connected with the subject, the not uncommon desire to discover a secret, and the implied challenge to the ingenuity of all from who it is hidden have attracted to the subject the attention of many to whom its utility is a matter of indifference. Abraham Sinkov In Mathematical Recreations & Essays By W.W. Rouse Ball and H.S.M. Coxeter, c. 1938 We begin our study of cryptology from the romantic point of view – the point of view of someone who has the “not uncommon desire to discover a secret” and someone who takes up the “implied challenged to the ingenuity” that is tossed down by secret writing. We begin with one of the most common classical ciphers: simple substitution. A simple substitution cipher is a method of concealment that replaces each letter of a plaintext message with another letter. Here is the key to a simple substitution cipher: Plaintext letters: abcdefghijklmnopqrstuvwxyz Ciphertext letters: EKMFLGDQVZNTOWYHXUSPAIBRCJ The key gives the correspondence between a plaintext letter and its replacement ciphertext letter. (It is traditional to use small letters for plaintext and capital letters, or small capital letters, for ciphertext. We will not use small capital letters for ciphertext so that plaintext and ciphertext letters will line up vertically.) Using this key, every plaintext letter a would be replaced by ciphertext E, every plaintext letter e by L, etc.
    [Show full text]
  • Index-Of-Coincidence.Pdf
    The Index of Coincidence William F. Friedman in the 1930s developed the index of coincidence. For a given text X, where X is the sequence of letters x1x2…xn, the index of coincidence IC(X) is defined to be the probability that two randomly selected letters in the ciphertext represent, the same plaintext symbol. For a given ciphertext of length n, let n0, n1, …, n25 be the respective letter counts of A, B, C, . , Z in the ciphertext. Then, the index of coincidence can be computed as 25 ni (ni −1) IC = ∑ i=0 n(n −1) We can also calculate this index for any language source. For some source of letters, let p be the probability of occurrence of the letter a, p be the probability of occurrence of a € b the letter b, and so on. Then the index of coincidence for this source is 25 2 Isource = pa pa + pb pb +…+ pz pz = ∑ pi i=0 We can interpret the index of coincidence as the probability of randomly selecting two identical letters from the source. To see why the index of coincidence gives us useful information, first€ note that the empirical probability of randomly selecting two identical letters from a large English plaintext is approximately 0.065. This implies that an (English) ciphertext having an index of coincidence I of approximately 0.065 is probably associated with a mono-alphabetic substitution cipher, since this statistic will not change if the letters are simply relabeled (which is the effect of encrypting with a simple substitution). The longer and more random a Vigenere cipher keyword is, the more evenly the letters are distributed throughout the ciphertext.
    [Show full text]
  • The Enigma Cipher Machine
    The Enigma Cipher Machine Anna Hurlbut 2018-11-27 Abstract The Enigma cipher machine was invented in the early 1920s to help businesses protect commercial secrets, but the German military soon saw its potential application to military communications. By the mid-1930s, every branch of the German military was using Enigma for nearly all their encrypted communications. The electromechanical cipher machine works using a system of wires, rotors, a reflector and a plugboard to send an electrical signal from the keyboard to the lampboard, encrypting each message letter by letter. Enigma masterfully balances ease of use and security, the opposing forces of any cryptosystem. The key space is ap- proximately 15 million million million, and it could be compared to a Vigen´erecipher with a key length of 16900. Though it seemed infallible, the infamous machine eventually failed. While the cryptosystem did have inherent technical flaws, its defeat was mainly a result of errors in human operation. British intelligence at Bletchley Park was able to find patterns in German messages and used these patterns as cracks to break into the entire system. Enigma represents a vital moment in the field of cryptogra- phy. It initiated the transition from by-hand methods to automated and mechanized methods and acted as a catalyst for the development of com- puters. Additionally, Enigma's ultimate failure illustrated the inadequacy of security through obscurity and pointed the future of cryptography to- wards more advanced methods. 1 Contents 1 Historical Context 3 2 Cryptography Basics and Simple Substitution Ciphers 4 2.1 Caesar Cipher . 6 3 The Vigen´ereCipher 6 3.1 Vigen´ereCryptanalysis .
    [Show full text]
  • Shift Cipher Substitution Cipher Vigenère Cipher Hill Cipher
    Lecture 2 Classical Cryptosystems Shift cipher Substitution cipher Vigenère cipher Hill cipher 1 Shift Cipher • A Substitution Cipher • The Key Space: – [0 … 25] • Encryption given a key K: – each letter in the plaintext P is replaced with the K’th letter following the corresponding number ( shift right ) • Decryption given K: – shift left • History: K = 3, Caesar’s cipher 2 Shift Cipher • Formally: • Let P=C= K=Z 26 For 0≤K≤25 ek(x) = x+K mod 26 and dk(y) = y-K mod 26 ʚͬ, ͭ ∈ ͔ͦͪ ʛ 3 Shift Cipher: An Example ABCDEFGHIJKLMNOPQRSTUVWXYZ 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 • P = CRYPTOGRAPHYISFUN Note that punctuation is often • K = 11 eliminated • C = NCJAVZRCLASJTDQFY • C → 2; 2+11 mod 26 = 13 → N • R → 17; 17+11 mod 26 = 2 → C • … • N → 13; 13+11 mod 26 = 24 → Y 4 Shift Cipher: Cryptanalysis • Can an attacker find K? – YES: exhaustive search, key space is small (<= 26 possible keys). – Once K is found, very easy to decrypt Exercise 1: decrypt the following ciphertext hphtwwxppelextoytrse Exercise 2: decrypt the following ciphertext jbcrclqrwcrvnbjenbwrwn VERY useful MATLAB functions can be found here: http://www2.math.umd.edu/~lcw/MatlabCode/ 5 General Mono-alphabetical Substitution Cipher • The key space: all possible permutations of Σ = {A, B, C, …, Z} • Encryption, given a key (permutation) π: – each letter X in the plaintext P is replaced with π(X) • Decryption, given a key π: – each letter Y in the ciphertext C is replaced with π-1(Y) • Example ABCDEFGHIJKLMNOPQRSTUVWXYZ πBADCZHWYGOQXSVTRNMSKJI PEFU • BECAUSE AZDBJSZ 6 Strength of the General Substitution Cipher • Exhaustive search is now infeasible – key space size is 26! ≈ 4*10 26 • Dominates the art of secret writing throughout the first millennium A.D.
    [Show full text]
  • Classic Crypto
    Classic Crypto Classic Crypto 1 Overview We briefly consider the following classic (pen and paper) ciphers o Transposition ciphers o Substitution ciphers o One-time pad o Codebook These were all chosen for a reason o We see same principles in modern ciphers Classic Crypto 2 Transposition Ciphers In transposition ciphers, we transpose (scramble) the plaintext letters o The scrambled text is the ciphertext o The transposition is the key Corresponds to Shannon’s principle of diffusion (more about this later) o This idea is widely used in modern ciphers Classic Crypto 3 Scytale Spartans, circa 500 BC Wind strip of leather around a rod Write message across the rod T H E T I M E H A S C O M E T H E W A L R U S S A I D T O T A L K O F M A N Y T H I N G S When unwrapped, letters are scrambled TSATAHCLONEORTYTMUATIESLHMTS… Classic Crypto 4 Scytale Suppose Alice and Bob use Scytale to encrypt a message o What is the key? o How hard is it for Trudy to break without key? Suppose many different rod diameters are available to Alice and Bob… o How hard is it for Trudy to break a message? o Can Trudy attack messages automatically—without manually examining each putative decrypt? Classic Crypto 5 Columnar Transposition Put plaintext into rows of matrix then read ciphertext out of columns For example, suppose matrix is 3 x 4 o Plaintext: SEETHELIGHT o Ciphertext: SHGEEHELTTIX Same effect as Scytale o What is the key? Classic Crypto 6 Keyword Columnar Transposition For example o Plaintext: CRYPTOISFUN o Matrix 3 x 4 and keyword MATH o Ciphertext:
    [Show full text]
  • Substitution Ciphers
    Foundations of Computer Security Lecture 40: Substitution Ciphers Dr. Bill Young Department of Computer Sciences University of Texas at Austin Lecture 40: 1 Substitution Ciphers Substitution Ciphers A substitution cipher is one in which each symbol of the plaintext is exchanged for another symbol. If this is done uniformly this is called a monoalphabetic cipher or simple substitution cipher. If different substitutions are made depending on where in the plaintext the symbol occurs, this is called a polyalphabetic substitution. Lecture 40: 2 Substitution Ciphers Simple Substitution A simple substitution cipher is an injection (1-1 mapping) of the alphabet into itself or another alphabet. What is the key? A simple substitution is breakable; we could try all k! mappings from the plaintext to ciphertext alphabets. That’s usually not necessary. Redundancies in the plaintext (letter frequencies, digrams, etc.) are reflected in the ciphertext. Not all substitution ciphers are simple substitution ciphers. Lecture 40: 3 Substitution Ciphers Caesar Cipher The Caesar Cipher is a monoalphabetic cipher in which each letter is replaced in the encryption by another letter a fixed “distance” away in the alphabet. For example, A is replaced by C, B by D, ..., Y by A, Z by B, etc. What is the key? What is the size of the keyspace? Is the algorithm strong? Lecture 40: 4 Substitution Ciphers Vigen`ere Cipher The Vigen`ere Cipher is an example of a polyalphabetic cipher, sometimes called a running key cipher because the key is another text. Start with a key string: “monitors to go to the bathroom” and a plaintext to encrypt: “four score and seven years ago.” Align the two texts, possibly removing spaces: plaintext: fours corea ndsev enyea rsago key: monit orsto gotot hebat hroom ciphertext: rcizl qfkxo trlso lrzet yjoua Then use the letter pairs to look up an encryption in a table (called a Vigen`ere Tableau or tabula recta).
    [Show full text]
  • Hill Cipher: a Cryptosystem Using Linear Algebra
    The Hill Cipher: A Cryptosystem Using Linear Algebra Robyn N. Taylor Mentor: Gerard LaVarnway Norwich University Northfield, VT April 6, 2013 Classic Cryptology Classic cryptology refers to methods of encipherment from antiquity to the middle of the 20th century Hudson River Undergraduate Mathematics Conference The Central Problem of Classic Cryptology Alice Eve Bob Communication channel Key channel Hudson River Undergraduate Mathematics Conference Polygraphic Substitution Ciphers polygraphic substitution cipher: blocks of plaintext characters are replaced by blocks of ciphertext characters Hudson River Undergraduate Mathematics Conference Lester Hill of Hunter College first introduced his “system” in an article in 1929 published in the American Mathematical Monthly entitled “Cryptology in an Algebraic Alphabet” Hudson River Undergraduate Mathematics Conference Lester Hill’s Cipher Machine Hudson River Undergraduate Mathematics Conference Principle Idea Group plaintext letters into blocks (size of 2,3,4 …) Encipher blocks as other equal length blocks plaintext ciphertext MI EQ SS GC Hudson River Undergraduate Mathematics Conference Block size Hill worked in three letter blocks We will work in two letter blocks Restrict alphabet to capital letters: A, B, C, D, ….Z Hudson River Undergraduate Mathematics Conference Monoalphabetic Substitution How many two letter blocks can we form from the letters A…Z? 26 X 26 = 676 Therefore, we can think of Hill’s system as a monoalphabetic substitution cipher on a 676 character alphabet. Hudson River Undergraduate Mathematics Conference Y Axmod26 Y is a 2 x 1 matrix of ciphertext numerical equivalents A is a 2 x 2 matrix x is a 2 x1 matrix of plaintext numerical equivalents. yx11 ab mod 26 yx22 cd Hudson River Undergraduate Mathematics Conference The Key The key to the encryption scheme is the coefficient matrix A.
    [Show full text]
  • Index of Coincidence Can Be Verbally Defined As Follows Number of Pairs of Equal Letters in Ciphertext I =
    Index of Conincidence A. Garsia - 1988 The estimation of period in a substitution cipher. Let us suppose that we are given a ciphertext C1,C2,...,CN which is known to have been encrypted by a Vigenere substitution with keyword of length N p. For convenience let us assume that N is a multiple of p and set M = p . This means that if the original plaintext was X1,X2,...,XN then for each k = 1, 2,...,M the kth block of ciphertext C(k−1)p+1,C(k−1)p+2,...,C(k−1)p+p is obtained from the corresponding kth block of plaintext X(k−1)p+1,X(k−1)p+2,...,X(k−1)p+p (1) by the p substitutions C(k−1)p+j = φj(X(k−1)p+j)(j = 1, 2, ..., p). For a Vigenere cipher each of the substitutions φj circularly shifts the alphabet. In the case of a general periodic substitution cipher each of the φj’s permutes the alphabet in an arbitrary manner. We shall present here a statistic which may be used to estimate the period p of a Vigenere substitution. It may be used as well for the most general periodic substitution cipher provided a sufficiently large ciphertext sample is available. This statistic usually referred to as the index of coincidence can be verbally defined as follows number of pairs of equal letters in ciphertext I = . (2) C the total number of pairs of letters Note that if NA denotes the total number of A’s in the ciphertext then the binomial NA(NA−1) coefficient 2 gives the number of A − A pairs.
    [Show full text]
  • A Complete Bibliography of Publications in Cryptologia
    A Complete Bibliography of Publications in Cryptologia Nelson H. F. Beebe University of Utah Department of Mathematics, 110 LCB 155 S 1400 E RM 233 Salt Lake City, UT 84112-0090 USA Tel: +1 801 581 5254 FAX: +1 801 581 4148 E-mail: [email protected], [email protected], [email protected] (Internet) WWW URL: http://www.math.utah.edu/~beebe/ 04 September 2021 Version 3.64 Title word cross-reference 10016-8810 [?, ?]. 1221 [?]. 125 [?]. 15.00/$23.60.0 [?]. 15th [?, ?]. 16th [?]. 17-18 [?]. 18 [?]. 180-4 [?]. 1812 [?]. 18th (t; m)[?]. (t; n)[?, ?]. $10.00 [?]. $12.00 [?, ?, ?, ?, ?]. 18th-Century [?]. 1930s [?]. [?]. 128 [?]. $139.99 [?]. $15.00 [?]. $16.95 1939 [?]. 1940 [?, ?]. 1940s [?]. 1941 [?]. [?]. $16.96 [?]. $18.95 [?]. $24.00 [?]. 1942 [?]. 1943 [?]. 1945 [?, ?, ?, ?, ?]. $24.00/$34 [?]. $24.95 [?, ?]. $26.95 [?]. 1946 [?, ?]. 1950s [?]. 1970s [?]. 1980s [?]. $29.95 [?]. $30.95 [?]. $39 [?]. $43.39 [?]. 1989 [?]. 19th [?, ?]. $45.00 [?]. $5.95 [?]. $54.00 [?]. $54.95 [?]. $54.99 [?]. $6.50 [?]. $6.95 [?]. $69.00 2 [?, ?]. 200/220 [?]. 2000 [?]. 2004 [?, ?]. [?]. $69.95 [?]. $75.00 [?]. $89.95 [?]. th 2008 [?]. 2009 [?]. 2011 [?]. 2013 [?, ?]. [?]. A [?]. A3 [?, ?]. χ [?]. H [?]. k [?, ?]. M 2014 [?]. 2017 [?]. 2019 [?]. 20755-6886 [?, ?]. M 3 [?]. n [?, ?, ?]. [?]. 209 [?, ?, ?, ?, ?, ?]. 20th [?]. 21 [?]. 22 [?]. 220 [?]. 24-Hour [?, ?, ?]. 25 [?, ?]. -Bit [?]. -out-of- [?, ?]. -tests [?]. 25.00/$39.30 [?]. 25.00/839.30 [?]. 25A1 [?]. 25B [?]. 26 [?, ?]. 28147 [?]. 28147-89 000 [?]. 01Q [?, ?]. [?]. 285 [?]. 294 [?]. 2in [?, ?]. 2nd [?, ?, ?, ?]. 1 [?, ?, ?, ?]. 1-4398-1763-4 [?]. 1/2in [?, ?]. 10 [?]. 100 [?]. 10011-4211 [?]. 3 [?, ?, ?, ?]. 3/4in [?, ?]. 30 [?]. 310 1 2 [?, ?, ?, ?, ?, ?, ?]. 312 [?]. 325 [?]. 3336 [?, ?, ?, ?, ?, ?]. affine [?]. [?]. 35 [?]. 36 [?]. 3rd [?]. Afluisterstation [?, ?]. After [?]. Aftermath [?]. Again [?, ?]. Against 4 [?]. 40 [?]. 44 [?]. 45 [?]. 45th [?]. 47 [?]. [?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?]. Age 4in [?, ?]. [?, ?]. Agencies [?]. Agency [?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?].
    [Show full text]
  • 2018 an Automatic Cryptanalysis of Simple Substitution
    An automatic cryptanalysis of simple substitution ciphers using ANGOR UNIVERSITY compression Alkazaz, Noor R.; Irvine, Sean A.; Teahan, William J. Information Security Journal: A Global Perspective DOI: 10.1080/19393555.2018.1426799 PRIFYSGOL BANGOR / B Published: 01/01/2018 Peer reviewed version Cyswllt i'r cyhoeddiad / Link to publication Dyfyniad o'r fersiwn a gyhoeddwyd / Citation for published version (APA): Alkazaz, N. R., Irvine, S. A., & Teahan, W. J. (2018). An automatic cryptanalysis of simple substitution ciphers using compression. Information Security Journal: A Global Perspective, 27(1), 57-75. https://doi.org/10.1080/19393555.2018.1426799 Hawliau Cyffredinol / General rights Copyright and moral rights for the publications made accessible in the public portal are retained by the authors and/or other copyright owners and it is a condition of accessing publications that users recognise and abide by the legal requirements associated with these rights. • Users may download and print one copy of any publication from the public portal for the purpose of private study or research. • You may not further distribute the material or use it for any profit-making activity or commercial gain • You may freely distribute the URL identifying the publication in the public portal ? Take down policy If you believe that this document breaches copyright please contact us providing details, and we will remove access to the work immediately and investigate your claim. 28. Sep. 2021 Information Security Journal: A Global Perspective manuscript No. (will be inserted by the editor) An Automatic Cryptanalysis of Simple Substitution Ciphers Using Compression Noor R. Al-Kazaz · Sean A. Irvine · William J.
    [Show full text]
  • 1402 Hill Cipher.Pdf
    Spring 2015 Chris Christensen MAT/CSC 483 Polygraphic Substitution Ciphers: The Hill cipher The Playfair cipher is a polygraphic cipher; it enciphers more than one letter at a time. Recall that the Playfair cipher enciphers digraphs – two-letter blocks. An attack by frequency analysis would involve analyzing the frequencies of the 26×= 26 676 digraphs of plaintext. Complications also occur when digraph frequencies are considered because sometimes common plaintext digraphs are split between blocks. For example, when encrypting the phrase another type the digraphs are an ot he rt yp e_, and the common digraph th is split between blocks. Frequency analysis would be even more complicated if we had a cryptosystem that enciphered trigraphs – three-letter blocks. Frequency analysis would involve knowing the frequencies of the 26××= 26 26 17576 trigraphs. Systems that enciphered even larger blocks would make cryptanalysis even more difficult. There are 26×××= 26 26 26 456976 blocks of length 4, 26××××= 26 26 26 26 11881376 blocks of length 5, 26×××××= 26 26 26 26 26 308915776 blocks of length 6 … . If we had a cryptosystem that encipher blocks of length 100, there would be 3142930641582938830174357788501626427282669988762475256374173 1753989959842010402346543259906970228933096407508161171919783 5869803511992549376 plaintext blocks. But, there is no obvious way to extend the Playfair key square to three or more dimensions. … cryptographers … tried to extend [Wheatstone’s Playfair cipher’s] geometrical technique to trigraphic substitutions. Nearly all have failed. Perhaps the best known effort was that of Count Luigi Gioppi di Tükheim, who in 1897 produced a pseudo-trigraphic system in 1 which two letters were monoalphabetically enciphered and the third depended only on the second.
    [Show full text]