Math 373/578: Using Matlab in Cryptography (Spring 2012)

Total Page:16

File Type:pdf, Size:1020Kb

Math 373/578: Using Matlab in Cryptography (Spring 2012) Math 373/578: Using matlab in Cryptography (Spring 2012) Place: Room 422, Armstrong Hall Preparations: (1) visit http://www.math.wvu.edu/~hjlai/Math373_Matlab/ and download all the files into a folder (Math373-Matlab) (2) Open Matlab, change the current directory to this folder. (Click the logo at the right end of "current Directory" for "Browse for folder", and change the folder). (3) Start working on the mathematics. (4) Ordinary Computations (Review) Example Compute 27 + 135=5. >> 2^7 + 135/5 ans = 155 Example Compute 11(126=(9 + 7) − 2(72=12)). >> 11*(126/9+7 - 2^(72/12)) ans = -473 p Example Compute 62 − 1024. >> 6^2 - \sqrt{1024} ans = 4 1 Part 1: Number Theory Basics (1) Factor 123456 into primes. factor(123456) (2) For x; y 2 Z − f0g, find gcd(x; y). gcd(x,y) Example: Find gcd(23456; 987654). gcd(23456, 987654) Ans = 2 Thus 2 = gcd(23456; 987654). (3) For x; y 2 Z − f0g, find u; v such that gcd(x; y) = ux + vy. [a,b,c]=gcd(x,y) Example: Find u; v such that gcd(23456; 987654) = 23456u + 987654v. >> [d,u,v]=gcd(23456, 987654) d = 2 u = -3158 v = 75 This means u = −3158 and v = 75. Thus 2 = gcd(23456; 987654) = 23456·(−3158)+987654·75. (4) Solve equation ax + by = 1 when (a; b) = 1. Example a = 65337 and b = 3511, what is the relationship between this problem and the example in (3)? [d,u,v]=gcd(65337, 3511) How do you interpret the answers? (5) Knowing n, we can find φ(n) and factor n by n = 1234567 eulerphi(n) factor(n) This can be used for deciphering an RSA coded message in the future. However, Matlab may have trouble factoring numbers bigger than 109. 2 Part 2: Operations involving integers modulo m (1) Given m > 1 and a 2 Z, find b 2 Z with 0 ≤ b < m such that a ≡ b (mod m). mod (a,m) (2) Given m > 1 and a; b 2 Z, find c 2 Z with 0 ≤ c < m such that a + b ≡ c (mod m). (Do the same for subtractions and multiplications) mod (a+b,m) (3) Find multiplicative inverse of a (mod m) (assuming that we have already known that a and m are relatively prime). Example: Find the multiplicative inverse of 8787 (mod 91919). >> powermod(8787, -1, 91919) ans = 71374 Thus 8787−1 ≡ 71734 (mod 91919). (4) Find multiplicative inverse of a (mod m) (assuming that we do not know if a and m are relatively prime). Example: Determine if 23456 has an inverse mod 987654, if it does, find it. >> [d,u,v] = gcd(23456, 987654) d = 2 u = -3158 v = 75 This means the gcd(23456; 987654) = 2, and so the inverse does not exist. Example: Determine if 23456 has an inverse mod 987651, if it does, find it. >> [d,u,v] = gcd(23456, 987651) d = 1 u = 256892 v = -6101 This means the gcd(23456; 987651) = 1 = 256892 · 23456 + (−6101) · 987651, and so 23456−1 ≡ 256892 (mod 987651). (5) Find modular exponentiation. Example: Compute 234567 (mod 9871) 3 >> powermod(234, 567, 9871) ans = 5334 Thus 234567 ≡ 5334 (mod 9871). (6) Solving equations. Example: Solve 7654x ≡ 2389 (mod 65537). What do we do? We first find the multiplicative inverse of the coefficient of x. >> powermod(7654, -1, 65537) ans = 54637 >> mod(ans*2389, 65537) ans = 43626 Thus the answer is x ≡ 43626 (mod 65537). (8) Computation modulo m (Reviews) Example Compute (234)(456) (mod 789). >> mod(234*456, 789) ans = 189 Example Compute 234 + 456 (mod 567). >> mod(234*456, 789) ans = 123 Example Compute 234567 (mod 9871). >> powermod(234, 456, 9871) ans = 5334 Example Compute multiplicative inverse of 8787 (mod 91919). >> powermod(8787, -1, 91919) ans = 71374 (9) Shift Ciphers and Affine Ciphers (A) Decoding with Shift-cipher Example Decrypt the Ceasar-encrypted message 'wklvverxogehtxlwhhdvb' 4 allshift('wklvvkrxogehtxlwhhdvb') wklvvkrxogehtxlwhhdvb xlmwwlsyphfiuymxiiewc ymnxxmtzqigjvznyjjfxd znoyynuarjhkwaozkkgye aopzzovbskilxbpallhzf bpqaapwctljmycqbmmiag cqrbbqxdumknzdrcnnjbh drsccryevnloaesdookci estddszfwompbfteppldj ftueetagxpnqcgufqqmek guvffubhyqordhvgrrnfl hvwggvcizrpseiwhssogm iwxhhwdjasqtfjxittphn jxyiixekbtrugkyjuuqio kyzjjyflcusvhlzkvvrjp lzakkzgmdvtwimalwwskq mabllahnewuxjnbmxxtlr nbcmmbiofxvykocnyyums ocdnncjpgywzlpdozzvnt pdeoodkqhzxamqepaawou qefppelriaybnrfqbbxpv rfgqqfmsjbzcosgrccyqw sghrrgntkcadpthsddzrx thisshouldbequiteeasy uijttipvmecfrvjuffbtz vjkuujqwnfdgswkvggcua A study of the output indicates that the plain text should be 'thisshouldbequiteeasy' or 'this should be quite easy' (B) Using Affine cipher to encode plain text. Example Encrypt the plain text 'meetmeinstlouis' with an affine cipher E3;7(x) ≡ 3x + 7 in Z26. >> affinecrypt('meetmeinstlouis', 3, 7) ans = rttmrtfujmoxpfj (C) Using Affine cipher to decrypt cipher text. Example The cipher text 'rttmrtfujmoxpfj' was encrypted using the affine function 3x + 7 in Z26. Decrypt it. (Step 1:) Solve y ≡ 3x + 7 (mod 26) for x. Since 1 = gcd(3; 26) = (9)(3) + (−1)(26), 3−1 ≡ 9 (mod 26). As (9)(7) ≡ 63 ≡ 11 (mod 26), multiplying both sides of the equation by 9 to get 9y ≡ x + 11 (mod 26), and so x ≡ 9y − 11 ≡ 9y + 15 (mod 26). This can also be done by using matlab: >> powermod(3, -1, 26) 5 and = 9 >> mod(-9*7, 26) ans = 15 (Step 2) Knowing that the decrypt function is x ≡ 9y + 15, we can decrypt the message by >> affinecrypt('rttmrtfujmoxpfj', 9, 15) ans = meetmeinstlouis 6 Part 3: Numbers with different bases (1) Converting and Base-b number to a base-10 number To convert a base-b number n = (dk−1dk−2 ··· d1d0)b to base-10, by definition, the answer is k−1 k−2 n = n = dk−1b + dk−2b + ··· + d1b + d0: Example Convert a number-26 number (HP AC)26 to base-10. We can first get the corre- sponding numerical values H = 7;P = 15;A = 0 and C = 2, and get the answer by >> n = 7*26^3 + 15*26^2 + 2 n = 133174 (2) Converting and Base-10 number to a base-b number Example Convert the base-10 number n = 133174 to base-26. >> n = 133174 n = 133174 >> d0 = mod(133174, 26) d0 = 2 >> n1 = (n - 2)/26 n1 = 5122 >>d1 = mod(n1, 26) d1 = 0 >> n2 = (n1 - 0)/26 n2 = 197 >>d2 = mod(n2, 26) d2 = 15 >> n3 = (n2 - 15)/26 n3 = 7 >>d3 = mod(n3, 26) d3 = 7 Thus the answer is n = (7 15 0 2)26 = (HP AC)26. (3) Operations of base-b numbers There are many ways to perform the operations of base-b numbers. One way to use matlab is 7 to first convert the base-b numbers to base-10, and use matlab to do the operations, then use matlab to convert the answers back to base-b. Example Multiply HE by IS in Z26. Step 1: Convert HE = 7(26) + 4 = 186 and IS = 8(28) + 18 = 226. Step 2: Compute the base-10 multiplication. Step 3: Convert the answer back to Base-26. 8 Part 4: Discrete Log and RSA (1) Find a Primitive Root Example Find a primitive root for the prime p = 65537 >> primitiveroot(65537) ans = 3 Thus 3 is a primitive root for 65537. (Remark: the function "primitiveroot" finds the small- est primitive root of the input number.) 13 (2) Example: Computing Discrete Log Find ind2 (7), or log2(7) (mod 13). For n = 1:12; a = powermod(2,n,13); if a == 7; disp(n); end end n = 11 Therefore, log2(7) = 11 (mod 13). This can be verified by >> powermod(2,11,13) ans = 7 (3) Example: Pohlig-Hellman Exponentiation Cipher Choose p = 263; e = 73. Note that φ(263) = 262, and Euclidean Algorithm gives gcd(262; 73) = (−61)(73) + (17)(262) = 1. >> [a,b,c] = gcd(73, 262) a = 1 b = -61 c = 17 Thus d = −17 ≡ 201 (mod 262) For the cipher text c = (246; 18; 156; 0; 256; 127; 18; 156; 96; 256; 235; 0; 132; 68), which will be decrypted by m = f −1(c) ≡ cd (mod 262). (Use powermod, for example). (Note: try to use positive d. Using negative d would sometimes cause computation errors). >> d=201 d = 201 9 >> p=263 p = 263 >> c = [246 18 156 0 256 127 18 156 96 256 235 0 132 68] c = Columns 1 through 5 246 18 156 0 256 Columns 6 through 10 127 18 156 96 256 Columns 11 through 14 235 0 132 68 >> m = powermod(c, d, p) m = Columns 1 through 5 19 17 4 0 18 Columns 6 through 10 20 17 4 8 18 Columns 11 through 14 11 0 13 3 This process gives 246201 ≡ 19; 18201 ≡ 17; 156201 ≡ 4; 0201 ≡ 0; 256201 ≡ 18; 127201 ≡ 20; 18201 ≡ 17; 156201 ≡ 4; 96201 ≡ 8; 256201 ≡ 18; 235201 ≡ 11; 0201 ≡ 0; 132201 ≡ 13; 68201 ≡ 3: and so the cipher text is (19; 17; 4; 0; 18; 20; 17; 4; 8; 18; 11; 0; 13; 3), which means, with Z26 al- phabet, treasure island. (4) Example: Diffie-Hellman Key Exchange Let p = 907, a = 2, x = 32 and y = 153. To find the exchange key, compute x ≡ 319 ≡ 3 >> p = 907 p = 907 >> a = primitiveroot(p) a = 2 >> x = 32 x = 32 >> xx = powermod(a, x, p) xx = 311 >> y = 153 y = 153 >> yy = powermod(a, y, p) 10 yy = 633 Thus x ≡ 232 ≡ 311 and y ≡ 2153 ≡ 633 (mod 907), and so the common key can be computed by k = xy (mod p) >> k = powermod(xx,y,p) k = 121 or by k = yx (mod p) >> k = powermod(yy,x,p) k = 121 (5) Example: Finding p and q when given n = pq and φ(n). Given n = pq = 1009427 and φ(n) = 1007400. To find p and q, we compute >> n = 1009427 n = 1009427 >> f = eulerphi(n) f = 1007400 >> s = n - f + 1 s = 2028 >> d = sqrt(s^2 - 4*n) d = 274 >> p = (s + d)/2 p = 1151 >> q = (s-d)/2 q = 877 Therefore, p = 1151 and q = 877.
Recommended publications
  • Efficient Regular Modular Exponentiation Using
    J Cryptogr Eng (2017) 7:245–253 DOI 10.1007/s13389-016-0134-5 SHORT COMMUNICATION Efficient regular modular exponentiation using multiplicative half-size splitting Christophe Negre1,2 · Thomas Plantard3,4 Received: 14 August 2015 / Accepted: 23 June 2016 / Published online: 13 July 2016 © Springer-Verlag Berlin Heidelberg 2016 Abstract In this paper, we consider efficient RSA modular x K mod N where N = pq with p and q prime. The private exponentiations x K mod N which are regular and con- data are the two prime factors of N and the private exponent stant time. We first review the multiplicative splitting of an K used to decrypt or sign a message. In order to insure a integer x modulo N into two half-size integers. We then sufficient security level, N and K are chosen large enough take advantage of this splitting to modify the square-and- to render the factorization of N infeasible: they are typically multiply exponentiation as a regular sequence of squarings 2048-bit integers. The basic approach to efficiently perform always followed by a multiplication by a half-size inte- the modular exponentiation is the square-and-multiply algo- ger. The proposed method requires around 16% less word rithm which scans the bits ki of the exponent K and perform operations compared to Montgomery-ladder, square-always a sequence of squarings followed by a multiplication when and square-and-multiply-always exponentiations. These the- ki is equal to one. oretical results are validated by our implementation results When the cryptographic computations are performed on which show an improvement by more than 12% compared an embedded device, an adversary can monitor power con- approaches which are both regular and constant time.
    [Show full text]
  • Miller-Rabin Primality Test (Java)
    Miller-Rabin primality test (Java) Other implementations: C | C, GMP | Clojure | Groovy | Java | Python | Ruby | Scala The Miller-Rabin primality test is a simple probabilistic algorithm for determining whether a number is prime or composite that is easy to implement. It proves compositeness of a number using the following formulas: Suppose 0 < a < n is coprime to n (this is easy to test using the GCD). Write the number n−1 as , where d is odd. Then, provided that all of the following formulas hold, n is composite: for all If a is chosen uniformly at random and n is prime, these formulas hold with probability 1/4. Thus, repeating the test for k random choices of a gives a probability of 1 − 1 / 4k that the number is prime. Moreover, Gerhard Jaeschke showed that any 32-bit number can be deterministically tested for primality by trying only a=2, 7, and 61. [edit] 32-bit integers We begin with a simple implementation for 32-bit integers, which is easier to implement for reasons that will become apparent. First, we'll need a way to perform efficient modular exponentiation on an arbitrary 32-bit integer. We accomplish this using exponentiation by squaring: Source URL: http://www.en.literateprograms.org/Miller-Rabin_primality_test_%28Java%29 Saylor URL: http://www.saylor.org/courses/cs409 ©Spoon! (http://www.en.literateprograms.org/Miller-Rabin_primality_test_%28Java%29) Saylor.org Used by Permission Page 1 of 5 <<32-bit modular exponentiation function>>= private static int modular_exponent_32(int base, int power, int modulus) { long result = 1; for (int i = 31; i >= 0; i--) { result = (result*result) % modulus; if ((power & (1 << i)) != 0) { result = (result*base) % modulus; } } return (int)result; // Will not truncate since modulus is an int } int is a 32-bit integer type and long is a 64-bit integer type.
    [Show full text]
  • RSA Power Analysis Obfuscation: a Dynamic FPGA Architecture John W
    Air Force Institute of Technology AFIT Scholar Theses and Dissertations Student Graduate Works 3-22-2012 RSA Power Analysis Obfuscation: A Dynamic FPGA Architecture John W. Barron Follow this and additional works at: https://scholar.afit.edu/etd Part of the Electrical and Computer Engineering Commons Recommended Citation Barron, John W., "RSA Power Analysis Obfuscation: A Dynamic FPGA Architecture" (2012). Theses and Dissertations. 1078. https://scholar.afit.edu/etd/1078 This Thesis is brought to you for free and open access by the Student Graduate Works at AFIT Scholar. It has been accepted for inclusion in Theses and Dissertations by an authorized administrator of AFIT Scholar. For more information, please contact [email protected]. RSA POWER ANALYSIS OBFUSCATION: A DYNAMIC FPGA ARCHITECTURE THESIS John W. Barron, Captain, USAF AFIT/GE/ENG/12-02 DEPARTMENT OF THE AIR FORCE AIR UNIVERSITY AIR FORCE INSTITUTE OF TECHNOLOGY Wright-Patterson Air Force Base, Ohio APPROVED FOR PUBLIC RELEASE; DISTRIBUTION UNLIMITED. The views expressed in this thesis are those of the author and do not reflect the official policy or position of the United States Air Force, Department of Defense, or the United States Government. This material is declared a work of the U.S. Government and is not subject to copyright protection in the United States. AFIT/GE/ENG/12-02 RSA POWER ANALYSIS OBFUSCATION: A DYNAMIC FPGA ARCHITECTURE THESIS Presented to the Faculty Department of Electrical and Computer Engineering Graduate School of Engineering and Management Air Force Institute of Technology Air University Air Education and Training Command In Partial Fulfillment of the Requirements for the Degree of Master of Science in Electrical Engineering John W.
    [Show full text]
  • THE MILLER–RABIN PRIMALITY TEST 1. Fast Modular
    THE MILLER{RABIN PRIMALITY TEST 1. Fast Modular Exponentiation Given positive integers a, e, and n, the following algorithm quickly computes the reduced power ae % n. • (Initialize) Set (x; y; f) = (1; a; e). • (Loop) While f > 1, do as follows: { If f%2 = 0 then replace (x; y; f) by (x; y2 % n; f=2), { otherwise replace (x; y; f) by (xy % n; y; f − 1). • (Terminate) Return x. The algorithm is strikingly efficient both in speed and in space. To see that it works, represent the exponent e in binary, say e = 2f + 2g + 2h; 0 ≤ f < g < h: The algorithm successively computes (1; a; 2f + 2g + 2h) f (1; a2 ; 1 + 2g−f + 2h−f ) f f (a2 ; a2 ; 2g−f + 2h−f ) f g (a2 ; a2 ; 1 + 2h−g) f g g (a2 +2 ; a2 ; 2h−g) f g h (a2 +2 ; a2 ; 1) f g h h (a2 +2 +2 ; a2 ; 0); and then it returns the first entry, which is indeed ae. 2. The Fermat Test and Fermat Pseudoprimes Fermat's Little Theorem states that for any positive integer n, if n is prime then bn mod n = b for b = 1; : : : ; n − 1. In the other direction, all we can say is that if bn mod n = b for b = 1; : : : ; n − 1 then n might be prime. If bn mod n = b where b 2 f1; : : : ; n − 1g then n is called a Fermat pseudoprime base b. There are 669 primes under 5000, but only five values of n (561, 1105, 1729, 2465, and 2821) that are Fermat pseudoprimes base b for b = 2; 3; 5 without being prime.
    [Show full text]
  • Modular Exponentiation: Exercises
    Modular Exponentiation: Exercises 1. Compute the following using the method of successive squaring: (a) 250 (mod 101) (b) 350 (mod 101) (c) 550 (mod 101). 2. Using an example from this lecture, compute 450 (mod 101) with no effort. How did you do it? 3. Explain how we could have predicted the answer to problem 1(a) with no effort. 4. Compute the following using the method of successive squaring: 50 58 44 (a) (3) in Z=101Z (b) (3) in Z=61Z (c)(4) in Z=51Z. 5000 5. Compute (78) in Z=79Z, and explain why this calculation is so very trivial. 4999 What is (78) in Z=79Z? 60 6. Fermat's Little Theorem says that (3) = 1 in Z=61Z. Use this fact to 58 compute (3) in Z=61Z (see problem 4(b) above) without using successive squaring, but by computing the inverse of (3)2 instead, for instance by the Euclidean algorithm. Explain why this works. 7. We may see later on that the set of all a 2 Z=mZ such that gcd(a; m) = 1 is a group. Let '(m) be the number of elements in this group, which is often × × denoted by (Z=mZ) . It turns out that for each a 2 (Z=mZ) , some power × of a must be equal to 1. The order of any a in the group (Z=mZ) is by definition the smallest positive integer e such that (a)e = 1. × (a) Compute the orders of all the elements of (Z=11Z) . × (b) Compute the orders of all the elements of (Z=17Z) .
    [Show full text]
  • Lecture 19 1 Readings 2 Introduction 3 Shor's Order-Finding Algorithm
    C/CS/Phys 191 Shor’s order (period) finding algorithm and factoring 11/01/05 Fall 2005 Lecture 19 1 Readings Benenti et al., Ch. 3.12 - 3.14 Stolze and Suter, Quantum Computing, Ch. 8.3 Nielsen and Chuang, Quantum Computation and Quantum Information, Ch. 5.2 - 5.3, 5.4.1 (NC use phase estimation for this, which we present in the next lecture) literature: Ekert and Jozsa, Rev. Mod. Phys. 68, 733 (1996) 2 Introduction With a fast algorithm for the Quantum Fourier Transform in hand, it is clear that many useful applications should be possible. Fourier transforms are typically used to extract the periodic components in functions, so this is an immediate one. One very important example is finding the period of a modular exponential function, which is also known as order-finding. This is a key element of Shor’s algorithm to factor large integers N. In Shor’s algorithm, the quantum algorithm for order-finding is combined with a series of efficient classical computational steps to make an algorithm that is overall polynomial in the input size 2 n = log2N, scaling as O(n lognloglogn). This is better than the best known classical algorithm, the number field sieve, which scales superpolynomially in n, i.e., as exp(O(n1/3(logn)2/3)). In this lecture we shall first present the quantum algorithm for order-finding and then summarize how this is used together with tools from number theory to efficiently factor large numbers. 3 Shor’s order-finding algorithm 3.1 modular exponentiation Recall the exponential function ax.
    [Show full text]
  • Number Theory
    CS 5002: Discrete Structures Fall 2018 Lecture 5: October 4, 2018 1 Instructors: Tamara Bonaci, Adrienne Slaugther Disclaimer: These notes have not been subjected to the usual scrutiny reserved for formal publications. They may be distributed outside this class only with the permission of the Instructor. Number Theory Readings for this week: Rosen, Chapter 4.1, 4.2, 4.3, 4.4 5.1 Overview 1. Review: set theory 2. Review: matrices and arrays 3. Number theory: divisibility and modular arithmetic 4. Number theory: prime numbers and greatest common divisor (gcd) 5. Number theory: solving congruences 6. Number theory: modular exponentiation and Fermat's little theorem 5.2 Introduction In today's lecture, we will dive into the branch of mathematics, studying the set of integers and their properties, known as number theory. Number theory has very important practical implications in computer science, but also in our every day life. For example, secure online communication, as we know it today, would not be possible without number theory because many of the encryption algorithms used to enable secure communication rely heavily of some famous (and in some cases, very old) results from number theory. We will first introduce the notion of divisibility of integers. From there, we will introduce modular arithmetic, and explore and prove some important results about modular arithmetic. We will then discuss prime numbers, and show that there are infinitely many primes. Finaly, we will explain how to solve linear congruences, and systems of linear congruences. 5-1 5-2 Lecture 5: October 4, 2018 5.3 Review 5.3.1 Set Theory In the last lecture, we talked about sets, and some of their properties.
    [Show full text]
  • Lecture Slides
    CSE 291-I: Applied Cryptography Nadia Heninger UCSD Spring 2020 Lecture 8 Legal Notice The Zoom session for this class will be recorded and made available asynchronously on Canvas to registered students. Announcements 1. HW 3 is due today! Volunteer to grade! 2. HW 4 is due before class in 1 week, April 29. I fixed an error so check the web page again: API_KEY should be 256 bits. Last time: Authenticated encryption This time: Number theory review Fundamental theorem of arithemtic Theorem e e Every n Z n = 0 has unique factorization n = p 1 p 2 ...per 2 6 ± 1 2 r with pi distinct primes and ei positive integers. Division and remainder Theorem a, b Z, b > 0, unique q, r Z s.t. a = bq + r, 0 r < b. 2 9 2 r a mod bamod b = a b a ⌘ − b b c Because we’re in CS, we also write r = a mod b. b a a mod b = 0 | () a = b mod N: (a mod N)=(b mod N) a = b mod N N (a b) () | − - l isan ok N l (b-a) too l ) multiplier Proof. Let I = sa + rb r, s Z Let d be the smallest positive elt. of I . { | 2 } d divides every element of I : • 1. Choose c = sc a + rc b. 2. c = qd + r: r = c qd = s a r b q(ax +by )=(s qx)a+(r qy)b I − c − c − c − c − 2 Thus r = 0byminimalityofd, thus d c. | d is largest: Assume d > d s.t.
    [Show full text]
  • Phatak Primality Test (PPT)
    PPT : New Low Complexity Deterministic Primality Tests Leveraging Explicit and Implicit Non-Residues A Set of Three Companion Manuscripts PART/Article 1 : Introducing Three Main New Primality Conjectures: Phatak’s Baseline Primality (PBP) Conjecture , and its extensions to Phatak’s Generalized Primality Conjecture (PGPC) , and Furthermost Generalized Primality Conjecture (FGPC) , and New Fast Primailty Testing Algorithms Based on the Conjectures and other results. PART/Article 2 : Substantial Experimental Data and Evidence1 PART/Article 3 : Analytic Proofs of Baseline Primality Conjecture for Special Cases Dhananjay Phatak ([email protected]) and Alan T. Sherman2 and Steven D. Houston and Andrew Henry (CSEE Dept. UMBC, 1000 Hilltop Circle, Baltimore, MD 21250, U.S.A.) 1 No counter example has been found 2 Phatak and Sherman are affiliated with the UMBC Cyber Defense Laboratory (CDL) directed by Prof. Alan T. Sherman Overall Document (set of 3 articles) – page 1 First identification of the Baseline Primality Conjecture @ ≈ 15th March 2018 First identification of the Generalized Primality Conjecture @ ≈ 10th June 2019 Last document revision date (time-stamp) = August 19, 2019 Color convention used in (the PDF version) of this document : All clickable hyper-links to external web-sites are brown : For example : G. E. Pinch’s excellent data-site that lists of all Carmichael numbers <10(18) . clickable hyper-links to references cited appear in magenta. Ex : G.E. Pinch’s web-site mentioned above is also accessible via reference [1] All other jumps within the document appear in darkish-green color. These include Links to : Equations by the number : For example, the expression for BCC is specified in Equation (11); Links to Tables, Figures, and Sections or other arbitrary hyper-targets.
    [Show full text]
  • LARGE PRIME NUMBERS This Writeup Is Modeled Closely on A
    LARGE PRIME NUMBERS This writeup is modeled closely on a writeup by Paul Garrett. See, for example, http://www-users.math.umn.edu/~garrett/crypto/overview.pdf 1. Fast Modular Exponentiation Given positive integers a, e, and n, the following algorithm quickly computes the reduced power ae % n. (Here x % n denotes the element of f0; ··· ; n − 1g that is congruent to x modulo n. Note that x % n is not an element of Z=nZ since such elements are cosets rather than coset representatives.) • (Initialize) Set (x; y; f) = (1; a; e). • (Loop) While f > 0, do as follows: { If f%2 = 0 then replace (x; y; f) by (x; y2 % n; f=2), { otherwise replace (x; y; f) by (xy % n; y; f − 1). • (Terminate) Return x. The algorithm is strikingly efficient both in speed and in space. Especially, the operations on f (halving it when it is even, decrementing it when it is odd) are very simple in binary. To see that the algorithm works, represent the exponent e in binary, say e = 2g + 2h + 2k; 0 ≤ g < h < k: The algorithm successively computes (1; a; 2g + 2h + 2k) g (1; a2 ; 1 + 2h−g + 2k−g) g g (a2 ; a2 ; 2h−g + 2k−g) g h (a2 ; a2 ; 1 + 2k−h) g h h (a2 +2 ; a2 ; 2k−h) g h k (a2 +2 ; a2 ; 1) g h k k (a2 +2 +2 ; a2 ; 0); and then it returns the first entry, which is indeed ae. Fast modular exponentiation is not only for computers. For example, to compute 237 % 149, proceed as follows, (1; 2; 37) ! (2; 2; 36) ! (2; 4; 18) ! (2; 16; 9) ! (32; 16; 8) ! (32; −42; 4) ! (32; −24; 2) ! (32; −20; 1) ! ( 105 ; −20; 0): 2.
    [Show full text]
  • With Animation
    Integer Arithmetic Arithmetic in Finite Fields Arithmetic of Elliptic Curves Public-key Cryptography Theory and Practice Abhijit Das Department of Computer Science and Engineering Indian Institute of Technology Kharagpur Chapter 3: Algebraic and Number-theoretic Computations Public-key Cryptography: Theory and Practice Abhijit Das Integer Arithmetic GCD Arithmetic in Finite Fields Modular Exponentiation Arithmetic of Elliptic Curves Primality Testing Integer Arithmetic Public-key Cryptography: Theory and Practice Abhijit Das Integer Arithmetic GCD Arithmetic in Finite Fields Modular Exponentiation Arithmetic of Elliptic Curves Primality Testing Integer Arithmetic In cryptography, we deal with very large integers with full precision. Public-key Cryptography: Theory and Practice Abhijit Das Integer Arithmetic GCD Arithmetic in Finite Fields Modular Exponentiation Arithmetic of Elliptic Curves Primality Testing Integer Arithmetic In cryptography, we deal with very large integers with full precision. Standard data types in programming languages cannot handle big integers. Public-key Cryptography: Theory and Practice Abhijit Das Integer Arithmetic GCD Arithmetic in Finite Fields Modular Exponentiation Arithmetic of Elliptic Curves Primality Testing Integer Arithmetic In cryptography, we deal with very large integers with full precision. Standard data types in programming languages cannot handle big integers. Special data types (like arrays of integers) are needed. Public-key Cryptography: Theory and Practice Abhijit Das Integer Arithmetic GCD Arithmetic in Finite Fields Modular Exponentiation Arithmetic of Elliptic Curves Primality Testing Integer Arithmetic In cryptography, we deal with very large integers with full precision. Standard data types in programming languages cannot handle big integers. Special data types (like arrays of integers) are needed. The arithmetic routines on these specific data types have to be implemented.
    [Show full text]
  • Primality Testing
    Syracuse University SURFACE Electrical Engineering and Computer Science - Technical Reports College of Engineering and Computer Science 6-1992 Primality Testing Per Brinch Hansen Syracuse University, School of Computer and Information Science, [email protected] Follow this and additional works at: https://surface.syr.edu/eecs_techreports Part of the Computer Sciences Commons Recommended Citation Hansen, Per Brinch, "Primality Testing" (1992). Electrical Engineering and Computer Science - Technical Reports. 169. https://surface.syr.edu/eecs_techreports/169 This Report is brought to you for free and open access by the College of Engineering and Computer Science at SURFACE. It has been accepted for inclusion in Electrical Engineering and Computer Science - Technical Reports by an authorized administrator of SURFACE. For more information, please contact [email protected]. SU-CIS-92-13 Primality Testing Per Brinch Hansen June 1992 School of Computer and Information Science Syracuse University Suite 4-116, Center for Science and Technology Syracuse, NY 13244-4100 Primality Testing1 PER BRINCH HANSEN Syracuse University, Syracuse, New York 13244 June 1992 This tutorial describes the Miller-Rabin method for testing the primality of large integers. The method is illustrated by a Pascal algorithm. The performance of the algorithm was measured on a Computing Surface. Categories and Subject Descriptors: G.3 [Probability and Statistics: [Proba­ bilistic algorithms (Monte Carlo) General Terms: Algorithms Additional Key Words and Phrases: Primality testing CONTENTS INTRODUCTION 1. FERMAT'S THEOREM 2. THE FERMAT TEST 3. QUADRATIC REMAINDERS 4. THE MILLER-RABIN TEST 5. A PROBABILISTIC ALGORITHM 6. COMPLEXITY 7. EXPERIMENTS 8. SUMMARY ACKNOWLEDGEMENTS REFERENCES 1Copyright@1992 Per Brinch Hansen Per Brinch Hansen: Primality Testing 2 INTRODUCTION This tutorial describes a probabilistic method for testing the primality of large inte­ gers.
    [Show full text]