{"id":23674,"date":"2023-05-05T07:14:59","date_gmt":"2023-05-05T07:14:59","guid":{"rendered":"https:\/\/www.booksofall.com\/pl\/?post_type=product&#038;p=23674"},"modified":"2023-05-05T07:14:59","modified_gmt":"2023-05-05T07:14:59","slug":"the-joy-of-cryptography","status":"publish","type":"product","link":"https:\/\/www.booksofall.com\/pl\/the-joy-of-cryptography\/","title":{"rendered":"The Joy of Cryptography"},"content":{"rendered":"<h2>0 &#8211; Review of Concepts &amp; Notation<\/h2>\n<p>The material in this section is meant as a review. Despite that, many students report that they \u001bnd this review useful for the rest of the book.<\/p>\n<h4>0.1 Logs &amp; Exponents<\/h4>\n<p>You probably learned (and then forgot) these identities in middle school or high school:<\/p>\n<p id=\"WvKWbtV\"><img loading=\"lazy\" decoding=\"async\" width=\"181\" height=\"101\" class=\"alignnone size-full wp-image-23678 \" src=\"https:\/\/www.booksofall.com\/pl\/wp-content\/uploads\/sites\/11\/2023\/05\/img_6454a8ce347d2.png\" alt=\"\" \/><\/p>\n<p>Well, it\u2019s time to get reacquainted with them again.<\/p>\n<p>In particular, never ever write (xa)(xb ) = xab . If you write this, your cryptography instructor will realize that life is too short, immediately resign from teaching, and join a traveling circus. But not before changing your grade in the course to a zero.<\/p>\n<h4>0.2 Modular Arithmetic<\/h4>\n<p>We write the set of integers as:<\/p>\n<p id=\"FNzZeyG\"><img loading=\"lazy\" decoding=\"async\" width=\"193\" height=\"26\" class=\"alignnone size-full wp-image-23679 \" src=\"https:\/\/www.booksofall.com\/pl\/wp-content\/uploads\/sites\/11\/2023\/05\/img_6454a8f5d8fb9.png\" alt=\"\" \/><\/p>\n<p>and the set of <a href=\"https:\/\/byjus.com\/maths\/natural-numbers\/\">natural numbers<\/a> (nonnegative integers) as:<\/p>\n<p id=\"OvYuGtS\"><img loading=\"lazy\" decoding=\"async\" width=\"118\" height=\"23\" class=\"alignnone size-full wp-image-23680 \" src=\"https:\/\/www.booksofall.com\/pl\/wp-content\/uploads\/sites\/11\/2023\/05\/img_6454a8ffc34c1.png\" alt=\"\" \/><\/p>\n<p>Note that 0 is considered a natural number.<\/p>\n<p><strong>Definition 0.1<br \/>\n<\/strong> For x ,n \u2208 Z, we say that n divides x (or x is a multiple of n), and write n | x , if there exists an integer k such that x = kn.<\/p>\n<p>Remember that the definitions apply to both positive and negative numbers (and to zero). We generally only care about this definition in the case where n is positive, but it is common to consider both positive and negative values of x .<\/p>\n<p><strong>Example<\/strong><br \/>\n7 divides 84 because we can write 84 = 12 \u00b7 7.<br \/>\n7 divides 0 because we can write 0 = 0 \u00b7 7.<br \/>\n7 divides \u221277 because we can write \u221277 = (\u221211) \u00b7 7.<br \/>\n\u22127 divides 42 because we can write 42 = (\u22126) \u00b7 (\u22127).<br \/>\n1 divides every integer (so does \u22121). The only integer that 0 divides is itself.<\/p>\n<p><strong>Definition 0.2 <\/strong>(% operator)<\/p>\n<p>Let n be a positive integer, and let a be any integer. The expression a % n (usually read as \u201ca mod n\u201d) represents the remainder after dividing a by n. More formally, a % n is the unique r \u2208 {0, . . . ,n \u2212 1} such that n | (a \u2212 r ).1<\/p>\n<p>Pay special attention to the fact that a %n is always a nonnegative number, even if a is negative. A good way to remember how this works is:<\/p>\n<p><span style=\"text-decoration: underline;\">a is (a % n) more than a multiple of n. <\/span><\/p>\n<p>Example<br \/>\n21 % 7 = 0 because 21 = 3 \u00b7 7 + 0.<br \/>\n20 % 7 = 6 because 20 = 2 \u00b7 7 + 6.<br \/>\n\u221220 % 7 = 1 because \u221220 = (\u22123) \u00b7 7 + 1. (\u221220 is one more than a multiple of 7.)<br \/>\n\u22121 % 7 = 6 because \u22121 = (\u22121) \u00b7 7 + 6.<\/p>\n<p>Unfortunately, some <a href=\"https:\/\/en.wikipedia.org\/wiki\/Programming_language\">programming languages<\/a> define % for negative numbers as (\u2212a)% n = \u2212(a % n), so they would define \u221220 % 7 to be \u2212(20 % 7) = \u22126. This is madness, and it\u2019s about time we stood up to these programming language designers and smashed them over the head with some mathematical truth! For now, if you are using some programming environment to play around with the concepts in the class, be sure to check whether it defines % in the correct way.<\/p>\n<p><strong>Definition 0.3<\/strong> (Zn)<br \/>\nFor positive n, we write Zn def = {0, . . . ,n \u2212 1} to denote the set of integers modulo n. These are the possible <a href=\"https:\/\/en.wikipedia.org\/wiki\/Remainder\">remainders<\/a> one obtains by dividing by n.2<\/p>\n<p><strong>Definition 0.4<\/strong>(\u2261n)<br \/>\nFor positive n, we say that integers a and b are <a href=\"https:\/\/www.aimath.org\/news\/congruentnumbers\/modulo.html\">congruent modulo<\/a> n, and write a \u2261n b, if n | (a \u2212 b). An alternative definition is that a \u2261n b if and only if a % n = b % n.<\/p>\n<p>You\u2019ll be in a better position to succeed in this class if you can understand the (subtle) distinction between a \u2261n b and a = b % n:<\/p>\n<p>a \u2261n b:<br \/>\nIn this expression, a and b can be integers of any size, and any sign. The left and right side have a certain relationship modulo n.<\/p>\n<p>a = b % n:<br \/>\nThis expression says that two integers are equal. The \u201c=\u201d rather than \u201c\u2261\u201d is your clue that the expression refers to equality over the integers. \u201cb % n\u201d on the right-hand side is an operation performed on two integers that returns an integer result. The result of b % n is an integer in the range {0, . . . ,n \u2212 1}.<\/p>\n<p><strong>Example<\/strong><br \/>\n\u201c99 \u226110 19\u201d is true. Applying the definition, you can see that 10 divides 99 \u2212 19.<br \/>\nOn the other hand, \u201c99 = 19 % 10\u201d is false. The right-hand side evaluates to the integer 9, but 99 and 9 are different integers.<\/p>\n<p>In short, expressions like a \u2261n b make sense for any a,b (including negative!), but expressions like a = b % n make sense only if a \u2208 Zn .<\/p>\n","protected":false},"excerpt":{"rendered":"<p><iframe style=\"width: 100%; height: 750px; border: none;\" src=\"https:\/\/online.visual-paradigm.com\/share\/book\/the-joy-of-cryptography-1cg1mvf48a?p=1\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n","protected":false},"featured_media":23681,"template":"","meta":{"_yoast_wpseo_title":"","_yoast_wpseo_metadesc":"Cryptography is something needed when we want to protect something. It is very closed to mathematics. Learn more about it in this book now!"},"product_brand":[],"product_cat":[383],"product_tag":[],"class_list":{"0":"post-23674","1":"product","2":"type-product","3":"status-publish","4":"has-post-thumbnail","6":"product_cat-security-privacy","8":"first","9":"instock","10":"shipping-taxable","11":"product-type-simple"},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.1.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>The Joy of Cryptography - BooksOfAll Polish<\/title>\n<meta name=\"description\" content=\"Cryptography is something needed when we want to protect something. It is very closed to mathematics. Learn more about it in this book now!\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.booksofall.com\/pl\/the-joy-of-cryptography\/\" \/>\n<meta property=\"og:locale\" content=\"pl_PL\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"The Joy of Cryptography - BooksOfAll Polish\" \/>\n<meta property=\"og:description\" content=\"Cryptography is something needed when we want to protect something. It is very closed to mathematics. Learn more about it in this book now!\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.booksofall.com\/pl\/the-joy-of-cryptography\/\" \/>\n<meta property=\"og:site_name\" content=\"BooksOfAll Polish\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.booksofall.com\/pl\/wp-content\/uploads\/sites\/11\/2023\/05\/The-Joy-of-Cryptography.jpg\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:image\" content=\"https:\/\/www.booksofall.com\/pl\/wp-content\/uploads\/sites\/11\/2023\/05\/The-Joy-of-Cryptography.jpg\" \/>\n<meta name=\"twitter:label1\" content=\"Szacowany czas czytania\" \/>\n\t<meta name=\"twitter:data1\" content=\"3 minuty\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.booksofall.com\/pl\/the-joy-of-cryptography\/\",\"url\":\"https:\/\/www.booksofall.com\/pl\/the-joy-of-cryptography\/\",\"name\":\"The Joy of Cryptography - BooksOfAll Polish\",\"isPartOf\":{\"@id\":\"https:\/\/www.booksofall.com\/pl\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.booksofall.com\/pl\/the-joy-of-cryptography\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.booksofall.com\/pl\/the-joy-of-cryptography\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.booksofall.com\/pl\/wp-content\/uploads\/sites\/11\/2023\/05\/The-Joy-of-Cryptography.jpg\",\"datePublished\":\"2023-05-05T07:14:59+00:00\",\"description\":\"Cryptography is something needed when we want to protect something. It is very closed to mathematics. Learn more about it in this book now!\",\"breadcrumb\":{\"@id\":\"https:\/\/www.booksofall.com\/pl\/the-joy-of-cryptography\/#breadcrumb\"},\"inLanguage\":\"pl-PL\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.booksofall.com\/pl\/the-joy-of-cryptography\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"pl-PL\",\"@id\":\"https:\/\/www.booksofall.com\/pl\/the-joy-of-cryptography\/#primaryimage\",\"url\":\"https:\/\/www.booksofall.com\/pl\/wp-content\/uploads\/sites\/11\/2023\/05\/The-Joy-of-Cryptography.jpg\",\"contentUrl\":\"https:\/\/www.booksofall.com\/pl\/wp-content\/uploads\/sites\/11\/2023\/05\/The-Joy-of-Cryptography.jpg\",\"width\":\"827\",\"height\":\"1169\",\"caption\":\"The Joy of Cryptography\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.booksofall.com\/pl\/the-joy-of-cryptography\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.booksofall.com\/pl\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Categories\",\"item\":\"https:\/\/www.booksofall.com\/pl\/categories\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"The Joy of Cryptography\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.booksofall.com\/pl\/#website\",\"url\":\"https:\/\/www.booksofall.com\/pl\/\",\"name\":\"BooksOfAll Polish\",\"description\":\"Biggest IT eBooks library and learning resources - Free eBooks for programming, computing, artificial intelligence and more.\",\"publisher\":{\"@id\":\"https:\/\/www.booksofall.com\/pl\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.booksofall.com\/pl\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"pl-PL\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.booksofall.com\/pl\/#organization\",\"name\":\"BooksOfAll Polish\",\"url\":\"https:\/\/www.booksofall.com\/pl\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"pl-PL\",\"@id\":\"https:\/\/www.booksofall.com\/pl\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.booksofall.com\/pl\/wp-content\/uploads\/sites\/11\/2022\/06\/booksofall-logo-2.png\",\"contentUrl\":\"https:\/\/www.booksofall.com\/pl\/wp-content\/uploads\/sites\/11\/2022\/06\/booksofall-logo-2.png\",\"width\":166,\"height\":30,\"caption\":\"BooksOfAll Polish\"},\"image\":{\"@id\":\"https:\/\/www.booksofall.com\/pl\/#\/schema\/logo\/image\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"The Joy of Cryptography - BooksOfAll Polish","description":"Cryptography is something needed when we want to protect something. It is very closed to mathematics. Learn more about it in this book now!","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.booksofall.com\/pl\/the-joy-of-cryptography\/","og_locale":"pl_PL","og_type":"article","og_title":"The Joy of Cryptography - BooksOfAll Polish","og_description":"Cryptography is something needed when we want to protect something. It is very closed to mathematics. Learn more about it in this book now!","og_url":"https:\/\/www.booksofall.com\/pl\/the-joy-of-cryptography\/","og_site_name":"BooksOfAll Polish","og_image":[{"url":"https:\/\/www.booksofall.com\/pl\/wp-content\/uploads\/sites\/11\/2023\/05\/The-Joy-of-Cryptography.jpg","type":"","width":"","height":""}],"twitter_card":"summary_large_image","twitter_image":"https:\/\/www.booksofall.com\/pl\/wp-content\/uploads\/sites\/11\/2023\/05\/The-Joy-of-Cryptography.jpg","twitter_misc":{"Szacowany czas czytania":"3 minuty"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.booksofall.com\/pl\/the-joy-of-cryptography\/","url":"https:\/\/www.booksofall.com\/pl\/the-joy-of-cryptography\/","name":"The Joy of Cryptography - BooksOfAll Polish","isPartOf":{"@id":"https:\/\/www.booksofall.com\/pl\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.booksofall.com\/pl\/the-joy-of-cryptography\/#primaryimage"},"image":{"@id":"https:\/\/www.booksofall.com\/pl\/the-joy-of-cryptography\/#primaryimage"},"thumbnailUrl":"https:\/\/www.booksofall.com\/pl\/wp-content\/uploads\/sites\/11\/2023\/05\/The-Joy-of-Cryptography.jpg","datePublished":"2023-05-05T07:14:59+00:00","description":"Cryptography is something needed when we want to protect something. It is very closed to mathematics. Learn more about it in this book now!","breadcrumb":{"@id":"https:\/\/www.booksofall.com\/pl\/the-joy-of-cryptography\/#breadcrumb"},"inLanguage":"pl-PL","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.booksofall.com\/pl\/the-joy-of-cryptography\/"]}]},{"@type":"ImageObject","inLanguage":"pl-PL","@id":"https:\/\/www.booksofall.com\/pl\/the-joy-of-cryptography\/#primaryimage","url":"https:\/\/www.booksofall.com\/pl\/wp-content\/uploads\/sites\/11\/2023\/05\/The-Joy-of-Cryptography.jpg","contentUrl":"https:\/\/www.booksofall.com\/pl\/wp-content\/uploads\/sites\/11\/2023\/05\/The-Joy-of-Cryptography.jpg","width":"827","height":"1169","caption":"The Joy of Cryptography"},{"@type":"BreadcrumbList","@id":"https:\/\/www.booksofall.com\/pl\/the-joy-of-cryptography\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.booksofall.com\/pl\/"},{"@type":"ListItem","position":2,"name":"Categories","item":"https:\/\/www.booksofall.com\/pl\/categories\/"},{"@type":"ListItem","position":3,"name":"The Joy of Cryptography"}]},{"@type":"WebSite","@id":"https:\/\/www.booksofall.com\/pl\/#website","url":"https:\/\/www.booksofall.com\/pl\/","name":"BooksOfAll Polish","description":"Biggest IT eBooks library and learning resources - Free eBooks for programming, computing, artificial intelligence and more.","publisher":{"@id":"https:\/\/www.booksofall.com\/pl\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.booksofall.com\/pl\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"pl-PL"},{"@type":"Organization","@id":"https:\/\/www.booksofall.com\/pl\/#organization","name":"BooksOfAll Polish","url":"https:\/\/www.booksofall.com\/pl\/","logo":{"@type":"ImageObject","inLanguage":"pl-PL","@id":"https:\/\/www.booksofall.com\/pl\/#\/schema\/logo\/image\/","url":"https:\/\/www.booksofall.com\/pl\/wp-content\/uploads\/sites\/11\/2022\/06\/booksofall-logo-2.png","contentUrl":"https:\/\/www.booksofall.com\/pl\/wp-content\/uploads\/sites\/11\/2022\/06\/booksofall-logo-2.png","width":166,"height":30,"caption":"BooksOfAll Polish"},"image":{"@id":"https:\/\/www.booksofall.com\/pl\/#\/schema\/logo\/image\/"}}]}},"_links":{"self":[{"href":"https:\/\/www.booksofall.com\/pl\/wp-json\/wp\/v2\/product\/23674","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.booksofall.com\/pl\/wp-json\/wp\/v2\/product"}],"about":[{"href":"https:\/\/www.booksofall.com\/pl\/wp-json\/wp\/v2\/types\/product"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.booksofall.com\/pl\/wp-json\/wp\/v2\/media\/23681"}],"wp:attachment":[{"href":"https:\/\/www.booksofall.com\/pl\/wp-json\/wp\/v2\/media?parent=23674"}],"wp:term":[{"taxonomy":"product_brand","embeddable":true,"href":"https:\/\/www.booksofall.com\/pl\/wp-json\/wp\/v2\/product_brand?post=23674"},{"taxonomy":"product_cat","embeddable":true,"href":"https:\/\/www.booksofall.com\/pl\/wp-json\/wp\/v2\/product_cat?post=23674"},{"taxonomy":"product_tag","embeddable":true,"href":"https:\/\/www.booksofall.com\/pl\/wp-json\/wp\/v2\/product_tag?post=23674"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}