This document provides an overview of the RSA cryptosystem. It begins with the mathematical foundations of RSA, including the group ZN* and Euler's totient function. It then covers the RSA trapdoor permutation using modular exponentiation and key generation. The document discusses encrypting and signing with RSA, as well as implementations using libraries and algorithms like square-and-multiply. It concludes with topics like side-channel attacks, optimizations for speed, and ways implementations can fail like the Bellcore attack on RSA-CRT.
For a college course -- CNIT 141: Cryptography for Computer Networks, at City College San Francisco
Based on "Serious Cryptography: A Practical Introduction to Modern Encryption", by Jean-Philippe Aumasson, No Starch Press (November 6, 2017), ISBN-10: 1593278268 ISBN-13: 978-1593278267
Instructor: Sam Bowne
More info: https://samsclass.info/141/141_S19.shtml
For a college course -- CNIT 141: Cryptography for Computer Networks, at City College San Francisco
Based on "Serious Cryptography: A Practical Introduction to Modern Encryption", by Jean-Philippe Aumasson, No Starch Press (November 6, 2017), ISBN-10: 1593278268 ISBN-13: 978-1593278267
Instructor: Sam Bowne
More info: https://samsclass.info/141/141_S19.shtml
Simple Overview Caesar and RSA Encryption_by_Tarek_GaberTarek Gaber
Lecture Objectives
1- To learn Caesar encryption as an example of symmetric encryption techniques
2- To learn RSA encryption as an example of asymmetric encryption techniques
Information and network security 33 rsa algorithmVaibhav Khanna
RSA algorithm is asymmetric cryptography algorithm. Asymmetric actually means that it works on two different keys i.e. Public Key and Private Key. As the name describes that the Public Key is given to everyone and Private key is kept private
Overview on Cryptography and Network SecurityDr. Rupa Ch
These slides give some overview on the the concepts which were in Crytography and network security. I have prepared these slides by the experiece after refer the text bbok as well as resources from the net. Added figures directly from the references. I would like to acknowledge all the authors by originally.
This presentation is based on the paper :
"A Method for Obtaining Digital Signatures and Public-Key Cryptosystems" by R.L. Rivest, A. Shamir, and L. Adleman
Public-Key Cryptography.pdfWrite the result of the following operation with t...FahmiOlayah
Write the result of the following operation with the correct number of significant figure of 0.248?Write the result of the following operation with the correct number of signi
Simple Overview Caesar and RSA Encryption_by_Tarek_GaberTarek Gaber
Lecture Objectives
1- To learn Caesar encryption as an example of symmetric encryption techniques
2- To learn RSA encryption as an example of asymmetric encryption techniques
Information and network security 33 rsa algorithmVaibhav Khanna
RSA algorithm is asymmetric cryptography algorithm. Asymmetric actually means that it works on two different keys i.e. Public Key and Private Key. As the name describes that the Public Key is given to everyone and Private key is kept private
Overview on Cryptography and Network SecurityDr. Rupa Ch
These slides give some overview on the the concepts which were in Crytography and network security. I have prepared these slides by the experiece after refer the text bbok as well as resources from the net. Added figures directly from the references. I would like to acknowledge all the authors by originally.
This presentation is based on the paper :
"A Method for Obtaining Digital Signatures and Public-Key Cryptosystems" by R.L. Rivest, A. Shamir, and L. Adleman
Public-Key Cryptography.pdfWrite the result of the following operation with t...FahmiOlayah
Write the result of the following operation with the correct number of significant figure of 0.248?Write the result of the following operation with the correct number of signi
Synthetic Fiber Construction in lab .pptxPavel ( NSTU)
Synthetic fiber production is a fascinating and complex field that blends chemistry, engineering, and environmental science. By understanding these aspects, students can gain a comprehensive view of synthetic fiber production, its impact on society and the environment, and the potential for future innovations. Synthetic fibers play a crucial role in modern society, impacting various aspects of daily life, industry, and the environment. ynthetic fibers are integral to modern life, offering a range of benefits from cost-effectiveness and versatility to innovative applications and performance characteristics. While they pose environmental challenges, ongoing research and development aim to create more sustainable and eco-friendly alternatives. Understanding the importance of synthetic fibers helps in appreciating their role in the economy, industry, and daily life, while also emphasizing the need for sustainable practices and innovation.
Model Attribute Check Company Auto PropertyCeline George
In Odoo, the multi-company feature allows you to manage multiple companies within a single Odoo database instance. Each company can have its own configurations while still sharing common resources such as products, customers, and suppliers.
The Roman Empire A Historical Colossus.pdfkaushalkr1407
The Roman Empire, a vast and enduring power, stands as one of history's most remarkable civilizations, leaving an indelible imprint on the world. It emerged from the Roman Republic, transitioning into an imperial powerhouse under the leadership of Augustus Caesar in 27 BCE. This transformation marked the beginning of an era defined by unprecedented territorial expansion, architectural marvels, and profound cultural influence.
The empire's roots lie in the city of Rome, founded, according to legend, by Romulus in 753 BCE. Over centuries, Rome evolved from a small settlement to a formidable republic, characterized by a complex political system with elected officials and checks on power. However, internal strife, class conflicts, and military ambitions paved the way for the end of the Republic. Julius Caesar’s dictatorship and subsequent assassination in 44 BCE created a power vacuum, leading to a civil war. Octavian, later Augustus, emerged victorious, heralding the Roman Empire’s birth.
Under Augustus, the empire experienced the Pax Romana, a 200-year period of relative peace and stability. Augustus reformed the military, established efficient administrative systems, and initiated grand construction projects. The empire's borders expanded, encompassing territories from Britain to Egypt and from Spain to the Euphrates. Roman legions, renowned for their discipline and engineering prowess, secured and maintained these vast territories, building roads, fortifications, and cities that facilitated control and integration.
The Roman Empire’s society was hierarchical, with a rigid class system. At the top were the patricians, wealthy elites who held significant political power. Below them were the plebeians, free citizens with limited political influence, and the vast numbers of slaves who formed the backbone of the economy. The family unit was central, governed by the paterfamilias, the male head who held absolute authority.
Culturally, the Romans were eclectic, absorbing and adapting elements from the civilizations they encountered, particularly the Greeks. Roman art, literature, and philosophy reflected this synthesis, creating a rich cultural tapestry. Latin, the Roman language, became the lingua franca of the Western world, influencing numerous modern languages.
Roman architecture and engineering achievements were monumental. They perfected the arch, vault, and dome, constructing enduring structures like the Colosseum, Pantheon, and aqueducts. These engineering marvels not only showcased Roman ingenuity but also served practical purposes, from public entertainment to water supply.
Instructions for Submissions thorugh G- Classroom.pptxJheel Barad
This presentation provides a briefing on how to upload submissions and documents in Google Classroom. It was prepared as part of an orientation for new Sainik School in-service teacher trainees. As a training officer, my goal is to ensure that you are comfortable and proficient with this essential tool for managing assignments and fostering student engagement.
Read| The latest issue of The Challenger is here! We are thrilled to announce that our school paper has qualified for the NATIONAL SCHOOLS PRESS CONFERENCE (NSPC) 2024. Thank you for your unwavering support and trust. Dive into the stories that made us stand out!
2024.06.01 Introducing a competency framework for languag learning materials ...Sandy Millin
http://sandymillin.wordpress.com/iateflwebinar2024
Published classroom materials form the basis of syllabuses, drive teacher professional development, and have a potentially huge influence on learners, teachers and education systems. All teachers also create their own materials, whether a few sentences on a blackboard, a highly-structured fully-realised online course, or anything in between. Despite this, the knowledge and skills needed to create effective language learning materials are rarely part of teacher training, and are mostly learnt by trial and error.
Knowledge and skills frameworks, generally called competency frameworks, for ELT teachers, trainers and managers have existed for a few years now. However, until I created one for my MA dissertation, there wasn’t one drawing together what we need to know and do to be able to effectively produce language learning materials.
This webinar will introduce you to my framework, highlighting the key competencies I identified from my research. It will also show how anybody involved in language teaching (any language, not just English!), teacher training, managing schools or developing language learning materials can benefit from using the framework.
How to Make a Field invisible in Odoo 17Celine George
It is possible to hide or invisible some fields in odoo. Commonly using “invisible” attribute in the field definition to invisible the fields. This slide will show how to make a field invisible in odoo 17.
The Art Pastor's Guide to Sabbath | Steve ThomasonSteve Thomason
What is the purpose of the Sabbath Law in the Torah. It is interesting to compare how the context of the law shifts from Exodus to Deuteronomy. Who gets to rest, and why?
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptxEduSkills OECD
Andreas Schleicher presents at the OECD webinar ‘Digital devices in schools: detrimental distraction or secret to success?’ on 27 May 2024. The presentation was based on findings from PISA 2022 results and the webinar helped launch the PISA in Focus ‘Managing screen time: How to protect and equip students against distraction’ https://www.oecd-ilibrary.org/education/managing-screen-time_7c225af4-en and the OECD Education Policy Perspective ‘Students, digital devices and success’ can be found here - https://oe.cd/il/5yV
2. Topics
• The Math Behind RSA
• The RSA Trapdoor Permutation
• RSA Key Generation and Security
• Encrypting with RSA
• Signing with RSA
• RSA Implementations
• How Things Can Go Wrong
4. The Group ZN*
• Integers modulo N
• Must contain an identity element: 1
• Each member must have an inverse
• So zero is excluded
• But Z4* contains {1,3}
• 2 has no inverse
• Because 4 is a multiple of 2
5. The Group ZN*
• If N is prime, Zp* contains {1,2, 3, ... p-1}
• So Z5* contains {1,2,3,4}
• 0 is excluded because it has no inverse
6. The Group Z10*
• Z10* contains {1, 3, 7, 9}
• 0, 2, 4, 5, 6, 8 are excluded
• Because they have no inverse
• Because they have a common factor with 10
• They aren't co-prime with 10
7. Euler's Totient
• How many elements are in the group Zn*?
• When n is not prime, but the product of
several prime numbers
• n = p1
✖︎
p2
✖︎
...
✖︎
pm
• ϕ(n) = (p1 - 1)
✖︎
(p2 - 1)
✖︎
...
✖︎
(pm - 1)
• For Z10*
• n = 10 = 2
✖︎
5
• ϕ(10) = 1
✖︎
4 : 4 elements in Z10*
9. RSA Parameters
• n is the modulus
• Product of two primes p and q
• e is the public exponent
• In practice, usually 65537
• Public key: (n, e)
• Private key: p and other values easily derived
from it
10. Trapdoor Permutation
• x is the plaintext message
• y is the ciphertext
Encryption: y = xe mod n
Decryption: x = yd mod n
• d is the decryption key
• calculated from p and q
11. Calculating d
• ed = 1 mod ϕ(n)
• Decryption: x = yd mod n
= (xe)d mod n
= xed mod n
= x mod n
= x
12. Why mod ϕ(n) ?
• Fermat's Little Theorem (aka Euler's Theorem)
• Stated by Fermat in 1640 without proof
• Proven by Euler in 1736
17. • Z10* contains {1, 3, 7, 9}
• 4 elements
• 3 is a generator of the group
• Although n is 10, the powers of 3 repeat with a
cycle of 4 (ϕ(n) )
• Encrypt by raising x to power e, forming y
• Decrypt by raising y to power d, returning x
Powers of 3 31 mod 10 = 3
32 mod 10 = 9
33 mod 10 = 7
34 mod 10 = 1
35 mod 10 = 3
18. • Z10* contains {1, 3, 7, 9}
• 4 elements
• p = 2 and q = 5
• ϕ(n) = (p-1)(q-1) = 1x4 = 4
• ed = 1 mod ϕ(n)
• For e = 3, d = 3
Finding d
n=10; e=3
3x1 mod 4 = 3
3x2 mod 4 = 2
3x3 mod 4 = 1
19. • x is the plaintext message (3)
• y is the ciphertext
Encryption: y = xe mod n
= 33 mod 10
= 27 mod 10
= 7
Decryption: x = yd mod n
= 73 mod 10
= 343 mod 10
= 3
n=10; x=3; e=3; d=7
24. • Z14* contains
{1, 3, 5, 9, 11, 13}
• 6 elements (ϕ(n) )
• 3 is a generator of the group
Powers of 3
31 mod 14 = 3
32 mod 14 = 9
33 mod 14 = 13
34 mod 14 = 11
35 mod 14 = 5
36 mod 14 = 1
25. • Z14* contains
{1, 3, 5, 9, 11, 13}
• 6 elements
• p = 2 and q = 7
• ϕ(n) = (p-1)(q-1) = 1x6 = 6
• ed = 1 mod ϕ(n)
• For e = 5, d = 5
Finding d
n=14; x=3; e=5
5x1 mod 6 = 5
5x2 mod 6 = 4
5x3 mod 6 = 3
5x4 mod 6 = 2
5x5 mod 6 = 1
26. • x is the plaintext message (3)
• y is the ciphertext
Encryption: y = xe mod n
= 35 mod 14
= 243 mod 14
= 5
Decryption: x = yd mod n
= 55 mod 14
= 3125 mod 14
= 3
n=14; x=3; e=5; d=5
31. Chapter 7 of Understanding Cryptography by Christof Paar and Jan Pelzl
31
Speed of Calculations
• Encryption is fastest
• Decryption is much slower
• Key generation is slowest
32. RSA in Python 3
Commands
from Crypto.PublicKey import RS
A
import tim
e
for i in range(5)
:
keylen = 2048 * (2 ** i
)
t0 = time.time(
)
key = RSA.generate(keylen
)
t1 = time.time() - t
0
print("Key length:", keylen, "Time:", t1)
35. Used with AES
• RSA typically not used to encrypt plaintext
directly
• RSA is used to encrypt an AES private key
36. Textbook RSA
• Plaintext converted to ASCII bytes
• Placed in x
• RSA used to compute y = xe mod n
37. Malleability
• Encrypt two plaintext messages x1 and x2
• y1 = x1e mod n
• y2 = x2e mod n
• Consider the plaintext (x1)(x2)
• Multiplying x1 and x2 together
• y = (x1e mod n)(x2e mod n) = (y1)(y2)
• An attacker can create valid ciphertext without
the key
38. Strong RSA Encryption:
OAEP
• Optimal Asymmetric Encryption Padding
• Padded plaintext is as long as n
• Includes extra data and randomness
39.
40. PKCS#1 v1.5
• An old method created by RSA
• Much less secure than OAEP
• Used in many systems
• https://cryptosense.com/blog/why-
pkcs1v1-5-encryption-should-be-put-out-of-
our-misery/
42. Digital Signatures
• Sign a message x with y = xd mod n
• No one can forge the signature because d is
secret
• Everyone can verify the signature using e
• x = ye mod n
• Notice that x is not secret
• Signatures prevent forgeries, they don't
provide confidentiality
43. Signing a Hash
• Signing long messages is slow and
uncommon
• Typically the message is hashed
• Then the hash is signed
44. Textbook RSA Signatures
• Sign a message x with y = xd mod n
• Attacker can forge signatures
• For x =0, 1, or n - 1
45. Blinding Attack
• You want to get the signature for message M
• Which the targeted user would never
willingly sign
• Find a value R such that ReM mod n
• Is a message the user will sign
• That signature S is (ReM)d mod n
• = RedMd mod n = RMd mod n
• The signature we want is Md mod n = S/R
46. The PSS Signature Standard
• Probabilistic Signature Standard
• Makes signatures more secure, the way OAEP makes
encryption more secure
• Combines the message with random and fixed bits
48. FDH v. PSS
• PSS came later
• More proof of theoretical security
• Because of added randomness
• But in practice they are similar in security
• But PSS is safer against fault attacks
• Explained later
51. Chapter 7 of Understanding Cryptography by Christof Paar and Jan Pelzl
Square-and-Multiply
• Consider RSA with a 1024-bit key
• We need to calculate xe where e is 1024
bits long
• x * x * x * x .... 21024 multiplications
• Competely impossible -- we can't even
crack a 72-bit key yet (272 calculations)
51
52. Chapter 7 of Understanding Cryptography by Christof Paar and Jan Pelzl
Square-and-Multiply
• Use memory to save time
• Do these ten multiplications
• x2 = x * x
• x4 = x2 * x2
• x8 = x4 * x4
• x16 = x8 * x8
• ...
• x1024 = x512 * x512
• ...
• Combine the results to make any exponent
52
53. Chapter 7 of Understanding Cryptography by Christof Paar and Jan Pelzl
Square-and-Multiply
• With this trick, a 1024-bit exponent can be
calculated with only 1536 multiplications
• But each number being multiplied is 1024
bits long, so it still takes a lot of CPU
53
54. Side-Channel Attacks
• The speedup from square-and-multiply means
that exponent bits of 1 take more time than
exponent bits of 0
• Measuring power consumption or timing can
leak out information about the key
• Few libraries are protected from such attacks
55. • EverCrypt -- a library immune to timing attacks
• From Microsoft research
• Link Ch 10b
56. Small e for Faster
Encryption
• Encryption: y = xe mod n
• Decryption: x = yd mod n
• Choosing small e makes encryption faster, but
decryption slower
57. Chinese Remainder
Theorem
• Replaces one operation mod n
• Encryption: y = xe mod n
• With two operations mod p and q
• Making RSA four times faster
59. Bellecore Attack on
RSA-CRT
• Fault injection causes the CPU to make
errors
• Alter the power supply
• or hit chips with a laser pulse
• Can break deterministic schemes like CRT
• But not ones including randomness like PSS