Introduction to Cryptography

Total Page:16

File Type:pdf, Size:1020Kb

Introduction to Cryptography Introduction to Cryptography Brian Veitch July 2, 2013 Contents 1 Introduction 3 1.1 Alice, Bob, and Eve . .3 1.2 Basic Terminology . .4 1.3 Brief History of Cryptography . .4 1.4 Kerckhoff's Principles of Cryptographic Secuity . 11 2 Substitution Cipher 13 2.1 Caesar Cipher Activity . 13 2.2 Keyword Cipher Activity . 17 2.3 Vigenere Cipher Activity . 20 3 Transposition 22 3.1 Easy Example . 22 3.2 Railfence Cipher . 22 3.3 Transposition Activity . 23 4 Modular Arithmetic 24 4.1 Examples of Congruences . 26 4.2 Arithmetic with Congruences . 27 4.3 Multipication Tables . 27 4.4 Finding the Inverse . 29 4.5 Solving Equations (mod n) . 32 4.6 The Extended Euclidean Algorithm . 34 1 CONTENTS 2 5 Diffie-Hellman Key Exhange 37 5.1 What is it? . 37 5.2 The Algorithm . 37 5.3 Example of a Key Exhange . 38 5.4 Why is Cracking this Exchange Difficult . 39 5.5 Key Exhange Activity . 40 6 RSA Encryption 42 6.1 Introduction . 42 6.2 Example of RSA Encryption . 42 6.3 RSA Algorithm . 45 6.4 Using The Extended Euclidean Algorithm . 46 6.5 ASCII Table . 50 6.6 Cracking RSA by finding the private key d.............. 52 6.7 Your turn to crack an RSA encrypted message . 53 7 Using RSA for Authentication 54 7.1 Algorithm . 54 7.2 Authentication Activity . 56 8 Important Information 57 8.1 Caesar Shift Wheel . 57 8.2 Letter Frequency Tables . 58 8.3 Vigenere's Table . 59 8.4 ASCII Table . 60 8.5 Useful Websites . 60 1 INTRODUCTION 3 1 Introduction You don't have to be an expert in cryptogrphy to appreciate the field. Cryptography is all around us. We use it to store senstive data, send secret messages, send financial information over the internet, hide messages from parents, etc. The methods we will cover in this paper can be easily picked up with some knowledge of basic arithmetic and some modular algebra. There are two basic types of encryption: substitution and transposition. We will cover the basics of each with some easy examples. Since this is an introduction, the techniques will be easier. After reading a section, try to improve on the method by coming up with your own versions. 1.1 Alice, Bob, and Eve Suppose Alice wants to send Bob a message. She doesn't want Eve to intercept it and read it, so she decides to disguise it. Here's a diagram that outlines the what's happening. Your hope is that Eve doesn't know how to figure out your message or alter it in some way. 1 INTRODUCTION 4 1.2 Basic Terminology 1. Plaintext - this is the original message to be sent. It can letters, numbers, characters, symbols, etc. 2. Encryption - disgusing the plaintext using some method. These methods usually have a key or algorithm to generate the ciphertext. 3. Ciphertext - the result of the encryption. It can be letters, numbers, characters, etc., but unreadable. 4. Decryption - the process of undoing the encryption. You should get the original plaintext when finished. 5. Key - something that is used to encrypt the message. Think of it as a password that disguises and un-disguises your message. 6. Keyspace - the set of all possible keys. For example, a four digit lock has 10000 possible keys. (0000, 0001, 0002, ..., 9998, 9999) 7. Cryptography - the science of the enciphering and deciphering of messages in secret code or cipher. Also referred to as cryptology. 8. Cryptosystem - a system for encrypting information. 9. Cryptanalysis - the science (and art) of recovering information from ciphers without knowledge of the key. 1.3 Brief History of Cryptography Cryptography is an ancient science. The term comes from the Greek language meaning "the study of hidden or secret writing." Ever since there were multiple tribes (or countries), we needed a way to communicate to one another without the other tribe (country) understanding it. Today it's vital to communicatations, authentication, sending sensative data over the internet, purchasing items from 1 INTRODUCTION 5 eBay, Amazon, and more. One of the earliest examples of cryptography was in Egypt around 2000 B.C. where they used hieroglyphics to decorate their tombs. Even though they weren't trying to completely hide the meaning, it still wasn't easy to interpret. The Greek writer Polybius used a 5x5 or a 6x6 (with out alphabet) to disguise the message. Below is an example of how it would work, If you wanted to write the message "SAVE ME", it would be disguised as S-A-V-E-M-E 41-11-44-15-31-15 Another Greek tool for disguising a message was called the Scytale. It is a tool used to perform a transposition cipher, consisting of a cylinder with a strip of parchment wound around it on which is written a message. In other words, it was a way to rearrange the letters. You would wrap a long thin parchment around a rod. You then write your message across the rod, "SEND HELP!" 1 INTRODUCTION 6 When you unwrap the parchment the letters appear rearranged. To understand the message, the receiver would need a rod of the same size. Julius Caesar used his own way of disguising messages to send to his military. We know call it the Caesar Cipher. If he had anything important to send, he would write out his message and then replace each letter of his message with another letter down the alphabet. So A = D, B = E, C = F, D = G, etc. When it needed to be read, the receiver of the message would reverse this process, changing D back to A, E back to B, F back to C. We will go over this method in great detail in the next chapter. The tool we will use will look something like this, 1 INTRODUCTION 7 This method is a form of substitution, where you replace one letter for another. Over the years, the substitution method evolved. In this next chapter, we discuss the Keyword Cipher, which is another form of substitution. The Vigenere cipher was a substitution cipher where each letter of the message used its own caesar shift. This means the first letter might be shifted by 3 letters, the second letter of the message could be shifted by 5 letters, the third letter by 3, the fourth letter by 5, the fifth letter by 3, and so on. This particular pattern would be two Caesar shifts with 3 and 5. For 300 years it was believed to be indecipherable. It can now be broken by determining the number of different caesar shifts and then do a frequency analysis on the letters that use the same Caesar shift. To give you an idea, suppose your keyword is "DOG" and you want to disguise the message "HELP ME", you use the Vigenere Table below to determine the ciphertext. 1 INTRODUCTION 8 Message: H E L P M E Keyword: D O G D O G Cipher: K S R S A K Why was this cipher so strong? Consider the ciphertext. There are two 'K's but each corresonds to a different letter in the plaintext. One 'K' decrypts back to H while the other 'K' decrypts to E. In 1917 U.S. Army Major Joseph Mauborgne developed a technique known as the One-Time Pad. It works the same way as a Vigenere Cipher. The only 1 INTRODUCTION 9 difference is the keyword is a random string of letters that is the same length as the message. That way the keyword never repeats which makes frequency analysis useless. If this method is done correctly, it is the only provably unbreakable encryption algorithm. Here's an example. Suppose the ciphertext is "KNEXYLTCOW." Now suppose you used two different one-time pad keys, "AFTMRDARKF" and "DJWMRDARKF". Let's see what happens. Use the Vigenere Table to convert back to plaintext. Cipher: K N E X Y L T C O W Key: D J W M R D A R K F Plaintext: H E I L H I T L E R Cipher: K N E X Y L T C O W Key: A F T M R D A R K F Plaintext: K I L L H I T L E R This means you can make the plaintext say anything you want. But there are two main weaknessess to this method. 1. Making sure the key is random and of sufficient length. 2. Distributing the keys. How is the receiver suppose to know which key to use? One way to accompish the distribution of keys is to have an agreed upon book. Each day the random key starts with the first letter of a page in that book. Keep reading the letters from the page until it's the same length as the message. Another interesting use of crytography was to send messages through newspapers. Before the telegraph, people needed to send messages through the mail. Postage could be expensive, plus someone could intercept the letter. Newspapers traveled freely and without charge. So someone could publish an article in the newspaper and put a dot above the letter that was part of the plaintext. For example, 1 INTRODUCTION 10 I_am excit_ed t_oa _nnounce the wedding of my brother. He is ba_ck_ from his journey overseas and is looking forward to a new life with his beautiful bride. Excluding i's, which would have two dots, the letters with dots above them spell attack World War II The Germans adopted the use of a family of electro-mechanical encryption devices invented by the German engineer Arthur Scherbuis.
Recommended publications
  • Introduction to Public Key Cryptography and Clock Arithmetic Lecture Notes for Access 2010, by Erin Chamberlain and Nick Korevaar
    1 Introduction to Public Key Cryptography and Clock Arithmetic Lecture notes for Access 2010, by Erin Chamberlain and Nick Korevaar We’ve discussed Caesar Shifts and other mono-alphabetic substitution ciphers, and we’ve seen how easy it can be to break these ciphers by using frequency analysis. If Mary Queen of Scots had known this, perhaps she would not have been executed. It was a long time from Mary Queen of Scots and substitution ciphers until the end of the 1900’s. Cryptography underwent the evolutionary and revolutionary changes which Si- mon Singh chronicles in The Code Book. If you are so inclined and have appropriate leisure time, you might enjoy reading Chapters 2-5, to learn some of these historical cryptography highlights: People came up with more complicated substitution ciphers, for example the Vigen`ere square. This Great Cipher of France baffled people for quite a while but a de- termined cryptographer Etienne Bazeries had a Eureka moment after three years of work, cracked the code, and possibly found the true identity of the Man in the Iron Mask, one of the great mysteries of the seventeeth century. Edgar Allan Poe and Sir Arthur Conan Doyle even dabbled in cryptanalysis. Secrecy was still a problem though because the key needed to be sent, and with the key anyone could encrypt and decrypt the messages. Frequency analysis was used to break all of these codes. In 1918 Scherbius invented his Enigma machine, but Alan Turing’s machine (the first computer?) helped in figuring out that supposedly unbreakable code, and hastened the end of the second World War.
    [Show full text]
  • 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 Mathemathics of Secrets.Pdf
    THE MATHEMATICS OF SECRETS THE MATHEMATICS OF SECRETS CRYPTOGRAPHY FROM CAESAR CIPHERS TO DIGITAL ENCRYPTION JOSHUA HOLDEN PRINCETON UNIVERSITY PRESS PRINCETON AND OXFORD Copyright c 2017 by Princeton University Press Published by Princeton University Press, 41 William Street, Princeton, New Jersey 08540 In the United Kingdom: Princeton University Press, 6 Oxford Street, Woodstock, Oxfordshire OX20 1TR press.princeton.edu Jacket image courtesy of Shutterstock; design by Lorraine Betz Doneker All Rights Reserved Library of Congress Cataloging-in-Publication Data Names: Holden, Joshua, 1970– author. Title: The mathematics of secrets : cryptography from Caesar ciphers to digital encryption / Joshua Holden. Description: Princeton : Princeton University Press, [2017] | Includes bibliographical references and index. Identifiers: LCCN 2016014840 | ISBN 9780691141756 (hardcover : alk. paper) Subjects: LCSH: Cryptography—Mathematics. | Ciphers. | Computer security. Classification: LCC Z103 .H664 2017 | DDC 005.8/2—dc23 LC record available at https://lccn.loc.gov/2016014840 British Library Cataloging-in-Publication Data is available This book has been composed in Linux Libertine Printed on acid-free paper. ∞ Printed in the United States of America 13579108642 To Lana and Richard for their love and support CONTENTS Preface xi Acknowledgments xiii Introduction to Ciphers and Substitution 1 1.1 Alice and Bob and Carl and Julius: Terminology and Caesar Cipher 1 1.2 The Key to the Matter: Generalizing the Caesar Cipher 4 1.3 Multiplicative Ciphers 6
    [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]
  • The Enigma History and Mathematics
    The Enigma History and Mathematics by Stephanie Faint A thesis presented to the University of Waterloo in fulfilment of the thesis requirement for the degree of Master of Mathematics m Pure Mathematics Waterloo, Ontario, Canada, 1999 @Stephanie Faint 1999 I hereby declare that I am the sole author of this thesis. I authorize the University of Waterloo to lend this thesis to other institutions or individuals for the purpose of scholarly research. I further authorize the University of Waterloo to reproduce this thesis by pho­ tocopying or by other means, in total or in part, at the request of other institutions or individuals for the purpose of scholarly research. 11 The University of Waterloo requires the signatures of all persons using or pho­ tocopying this thesis. Please sign below, and give address and date. ill Abstract In this thesis we look at 'the solution to the German code machine, the Enigma machine. This solution was originally found by Polish cryptologists. We look at the solution from a historical perspective, but most importantly, from a mathematical point of view. Although there are no complete records of the Polish solution, we try to reconstruct what was done, sometimes filling in blanks, and sometimes finding a more mathematical way than was originally found. We also look at whether the solution would have been possible without the help of information obtained from a German spy. IV Acknowledgements I would like to thank all of the people who helped me write this thesis, and who encouraged me to keep going with it. In particular, I would like to thank my friends and fellow grad students for their support, especially Nico Spronk and Philippe Larocque for their help with latex.
    [Show full text]
  • Encryption Is Futile: Delay Attacks on High-Precision Clock Synchronization 1
    R. ANNESSI, J. FABINI, F.IGLESIAS, AND T. ZSEBY: ENCRYPTION IS FUTILE: DELAY ATTACKS ON HIGH-PRECISION CLOCK SYNCHRONIZATION 1 Encryption is Futile: Delay Attacks on High-Precision Clock Synchronization Robert Annessi, Joachim Fabini, Felix Iglesias, and Tanja Zseby Institute of Telecommunications TU Wien, Austria Email: fi[email protected] Abstract—Clock synchronization has become essential to mod- endanger control decisions, and adversely affect the overall ern societies since many critical infrastructures depend on a functionality of a wide range of (critical) services that depend precise notion of time. This paper analyzes security aspects on accurate time. of high-precision clock synchronization protocols, particularly their alleged protection against delay attacks when clock syn- In recent years, security of clock synchronization received chronization traffic is encrypted using standard network security increased attention as various attacks on clock synchronization protocols such as IPsec, MACsec, or TLS. We use the Precision protocols (and countermeasures) were proposed. For this Time Protocol (PTP), the most widely used protocol for high- reason, clock synchronization protocols need to be secured precision clock synchronization, to demonstrate that statistical whenever used outside of fully trusted network environments. traffic analysis can identify properties that support selective message delay attacks even for encrypted traffic. We furthermore Clock synchronization protocols are specifically susceptible to identify a fundamental conflict in secure clock synchronization delay attacks since the times when messages are sent and between the need of deterministic traffic to improve precision and received have an actual effect on the receiver’s notion of the need to obfuscate traffic in order to mitigate delay attacks.
    [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]