SlideShare a Scribd company logo
1 of 18
Download to read offline
Introduction to Network Security
Lecture 2: Caesar and RSA
Location:E.T.S. de Ingenierias Informatica y de Telecomunicacion Universidad
de Granada 18071, Granada (SPAIN), 24-28 April 2017
Dr. Tarek Gaber
Faculty of Computers and Informatics,
Suez Canal University, Ismailia, Egypt
tmgaber@gmail.com
Lecture Objectives
To learn Caesar encryption as
an example of symmetric
encryption techniques
To learn RSA encryption as an
example of asymmetric
encryption techniques
Lecture Outlines
What is Caesar Algorithm
How does Caesar algorithm works
What is RSA technique
Simple numerical example of RSA
Caesar Cipher
• The earliest known as substitution cipher by
Julius Caesar
• First attested use in military affairs
• Replaces each letter by 3rd letter later
• example:
meet me after the toga party
PHHW PH DIWHU WKH WRJD SDUWB
http://www.xarg.org/tools/caesar-
cipher/
What is a Caesar Cipher?
• Caesar used to encrypt his messages using a very simple
algorithm, which could be easily decrypted if you know
the key.
• He would take each letter of the alphabet and replace it
with a letter a certain distance away from that letter.
When he got to the end, he would wrap back around to
the beginning.
• Example with a shift of 3:
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
D E F G H I J K L M N O P Q R S T U V W X Y Z A B C
https://www.youtube.com/watch?v=fR8rVR72a6o
Caesar Wheel
Caesar Cipher
• can define transformation as:
a b c d e f g h i j k l m n o p q r s t u v w x y z
D E F G H I J K L M N O P Q R S T U V W X Y Z A B C
• mathematically give each letter a number
a b c d e f g h i j k l m
0 1 2 3 4 5 6 7 8 9 10 11 12
n o p q r s t u v w x y Z
13 14 15 16 17 18 19 20 21 22 23 24 25
• then have Caesar cipher as:
C = E(p) = (p + k) mod (26)
p = D(C) = (C – k) mod (26)
MOD Function
• MOD is short for modulus, which means ' the remainder left
over after a value is divided by something'
Examples:
27 mod 26... 27 / 26 is 1 R 1, so 27 mod 26 is 1
53 mod 26... 53 / 26 is 2 R 1 so 53 mod 26 is also 1
10 mod 3 is also 1 (since 10 / 3 = 3 R 1)
2 mod 2 = 0
5 mod 2 = 1
25 mod 26 = 25
50 mod 26 = 24
• if a = (b) mod c then a = (c*k + b) mod c (where k = 1,2,3.......)
• So, if we have (-4 mod 3), we could write it as ( 3x2 -4) mod 3 =2
Caesar Algorithm
• 1. Convert the characters to numbers
2. Pick a number to shift by
3. Add the number to each character
4. Mod each resulting number by 26
5. You message is now encrypted!
Cryptanalysis of Caesar Cipher
• only have 26 possible ciphers
– A maps to A,B,..Z
• could simply try each in turn
• a brute force search
• given ciphertext, just try all shifts of letters
• do need to recognize when have plaintext
• eg. break ciphertext “ERE L ORYH BRX
DOLFH“ (HOMEWORK)
The Problem with Caesar’s Cipher
• It’s too easy to break! Let’s go back to our five letter alphabet.
• Say you had the word DBCA, but didn’t know the key. It would be easy to
make a list of all possible keys. If you expected the unencrypted text to be
in English, you could easily figure out which word was right:
• If you were using the full English alphabet, this would take longer, but for
someone trying to find our your secret, it’s a small price to pay!
Shift of 1 CABE
Shift of 2 BEAD  The clear winner!
Shift of 3 ADEC
Shift of 4 ECDB
How dare you
insult my cipher!
Though, you have
a good point…
RSA Algorithm
• The RSA algorithm is named after Ron Rivest, Adi Shamir and Len
Adleman, who invented it in 1977.
• The RSA cryptosystem is the most widely-used public key
cryptography algorithm in the world. It can be used to encrypt a
message without the need to exchange a secret key separately.
• The RSA algorithm can be used for both public key encryption
and digital signatures.
• Its security is based on the difficulty of factoring large integers.
Prime Number
• A Prime Number can be divided evenly only by
1 or itself and it must be a whole number
greater than 1.
• Examples:
– Is 8 a Prime Number?
• No, because it can be divided evenly by 2 or 4 (2×4=8),
as well as by 1 and 8.
– Is 73 a Prime Number?
• Yes, it can only be divided evenly by 1 and 73.
Prime and Co-prime Number
• Two numbers are said to be Co-primes when they
have only 1 as a common factor.
• Example 1: Are numbers 6 and 25 Coprime ?
Answer = Two given numbers are 6 and 25
Factors of 6 = 1, 2, 3, 6 and Factors of 25 = 1, 5, 25
On comparing the factors of numbers 6 and 25, you can see
that both have only 1 as a common factor, So, 6 and 25 are
Coprimes.
• The Factors of a given number are those which divide
a given number completely, without leaving any
remainder.
– Factors of a given number 12 are 1, 2, 3, 4, 6 & 12
RSA Key Generation Algorithm
• Generate two large random primes, p and q, of
approximately equal size such that their product n =
pq is of the required bit length, e.g. 1024 bits.
• Compute n = pq and (phi) φ = (p-1)(q-1).
• Choose an integer e, 1 < e < phi, such that gcd(e, phi)
= 1. Compute the secret exponent d, 1 < d < phi, such
that ed ≡ 1 (mod phi).
– ( e *d) / phi = ? with the remainder of 1, (1 mod phi equivalent to e*d
mod phi).
• The public key is (n, e) and the private key (p, q, d) or
(n, d).
• Keep all the values d, p, q and phi secret.
Summary of RSA
• Key Generation
– n = pq, where p and q are distinct primes.
– phi, φ = (p-1)(q-1)
– e < n such that gcd(e, phi)=1
– d = e-1 mod phi.
• Encryption/Decryption
– c = me mod n, 1<m<n.
– m = cd mod n.
Homework (Caesar and RSA)
• Using the Caesar algorithm, how you can get the key
used to get the ciphertext “ERE L ORYH BRX DOLFH“ and
what should be the plaintext of this ciphertext.
• In the RSA numerical example given in the lecture, we
have chosen e = 7,
– change e to 11,
– compute d, and
– compute the public and private key pair
– encrypt the message M =2
• Send it to tmgaber@gmai.com by 12:00 (PM) 27-4-2017
Thanks for your attention
Questions, please

More Related Content

What's hot (20)

The rsa algorithm JooSeok Song
The rsa algorithm JooSeok SongThe rsa algorithm JooSeok Song
The rsa algorithm JooSeok Song
 
Rsa
RsaRsa
Rsa
 
Lecture6 rsa
Lecture6 rsaLecture6 rsa
Lecture6 rsa
 
Ntewrok secuirty cs7
Ntewrok secuirty cs7Ntewrok secuirty cs7
Ntewrok secuirty cs7
 
RSA Algorithm
RSA AlgorithmRSA Algorithm
RSA Algorithm
 
The rsa algorithm
The rsa algorithmThe rsa algorithm
The rsa algorithm
 
The rsa algorithm
The rsa algorithmThe rsa algorithm
The rsa algorithm
 
RSA
RSARSA
RSA
 
RSA algorithm
RSA algorithmRSA algorithm
RSA algorithm
 
RSA ALGORITHM
RSA ALGORITHMRSA ALGORITHM
RSA ALGORITHM
 
Public Key Algorithms
Public Key AlgorithmsPublic Key Algorithms
Public Key Algorithms
 
The rsa algorithm
The rsa algorithmThe rsa algorithm
The rsa algorithm
 
RSA Algorithm report
RSA Algorithm reportRSA Algorithm report
RSA Algorithm report
 
RSA-W7(rsa) d1-d2
RSA-W7(rsa) d1-d2RSA-W7(rsa) d1-d2
RSA-W7(rsa) d1-d2
 
Network security cs5
Network security cs5Network security cs5
Network security cs5
 
RSA Algorithm - Public Key Cryptography
RSA Algorithm - Public Key CryptographyRSA Algorithm - Public Key Cryptography
RSA Algorithm - Public Key Cryptography
 
Rsa Crptosystem
Rsa CrptosystemRsa Crptosystem
Rsa Crptosystem
 
RSA Algorithm
RSA AlgorithmRSA Algorithm
RSA Algorithm
 
Presentation about RSA
Presentation about RSAPresentation about RSA
Presentation about RSA
 
Information and Network Security
Information and Network SecurityInformation and Network Security
Information and Network Security
 

Similar to Simple Overview Caesar and RSA Encryption_by_Tarek_Gaber

Introduction to cryptography part2-final
Introduction to cryptography  part2-finalIntroduction to cryptography  part2-final
Introduction to cryptography part2-finalTaymoor Nazmy
 
Cryptography using rsa cryptosystem
Cryptography using rsa cryptosystemCryptography using rsa cryptosystem
Cryptography using rsa cryptosystemSamdish Arora
 
Cryptography and applications
Cryptography and applicationsCryptography and applications
Cryptography and applicationsthai
 
Cyber Security Part-3.pptx
Cyber Security Part-3.pptxCyber Security Part-3.pptx
Cyber Security Part-3.pptxRavikumarVadana
 
cryptography symmentric.pptx
cryptography symmentric.pptxcryptography symmentric.pptx
cryptography symmentric.pptxChethanKrishna14
 
RSA Algm.pptx
RSA Algm.pptxRSA Algm.pptx
RSA Algm.pptxSou Jana
 
EncryptionTechChap2.ppt
EncryptionTechChap2.pptEncryptionTechChap2.ppt
EncryptionTechChap2.pptrajirajesh8
 
CNIT 141: 10. RSA
CNIT 141: 10. RSACNIT 141: 10. RSA
CNIT 141: 10. RSASam Bowne
 
Public Key Cryptography and RSA algorithm
Public Key Cryptography and RSA algorithmPublic Key Cryptography and RSA algorithm
Public Key Cryptography and RSA algorithmIndra97065
 
ch09_rsa_nemo.ppt
ch09_rsa_nemo.pptch09_rsa_nemo.ppt
ch09_rsa_nemo.pptChandraB15
 
Overview on Cryptography and Network Security
Overview on Cryptography and Network SecurityOverview on Cryptography and Network Security
Overview on Cryptography and Network SecurityDr. Rupa Ch
 
CNIT 141: 10. RSA
CNIT 141: 10. RSACNIT 141: 10. RSA
CNIT 141: 10. RSASam Bowne
 
Chapter 06 rsa cryptosystem
Chapter 06   rsa cryptosystemChapter 06   rsa cryptosystem
Chapter 06 rsa cryptosystemAnkur Choudhary
 

Similar to Simple Overview Caesar and RSA Encryption_by_Tarek_Gaber (20)

Introduction to cryptography part2-final
Introduction to cryptography  part2-finalIntroduction to cryptography  part2-final
Introduction to cryptography part2-final
 
Cryptography using rsa cryptosystem
Cryptography using rsa cryptosystemCryptography using rsa cryptosystem
Cryptography using rsa cryptosystem
 
Cryptography and applications
Cryptography and applicationsCryptography and applications
Cryptography and applications
 
Class3
Class3Class3
Class3
 
Rsa cryptosystem
Rsa cryptosystemRsa cryptosystem
Rsa cryptosystem
 
Cyber Security Part-3.pptx
Cyber Security Part-3.pptxCyber Security Part-3.pptx
Cyber Security Part-3.pptx
 
Unit --3.ppt
Unit --3.pptUnit --3.ppt
Unit --3.ppt
 
cryptography symmentric.pptx
cryptography symmentric.pptxcryptography symmentric.pptx
cryptography symmentric.pptx
 
module 1 (part A).pdf
module 1 (part A).pdfmodule 1 (part A).pdf
module 1 (part A).pdf
 
RSA Algm.pptx
RSA Algm.pptxRSA Algm.pptx
RSA Algm.pptx
 
CH4__crypto.pptx
CH4__crypto.pptxCH4__crypto.pptx
CH4__crypto.pptx
 
EncryptionTechChap2.ppt
EncryptionTechChap2.pptEncryptionTechChap2.ppt
EncryptionTechChap2.ppt
 
CNIT 141: 10. RSA
CNIT 141: 10. RSACNIT 141: 10. RSA
CNIT 141: 10. RSA
 
Public Key Cryptography and RSA algorithm
Public Key Cryptography and RSA algorithmPublic Key Cryptography and RSA algorithm
Public Key Cryptography and RSA algorithm
 
ch09_rsa_nemo.ppt
ch09_rsa_nemo.pptch09_rsa_nemo.ppt
ch09_rsa_nemo.ppt
 
Overview on Cryptography and Network Security
Overview on Cryptography and Network SecurityOverview on Cryptography and Network Security
Overview on Cryptography and Network Security
 
CNIT 141: 10. RSA
CNIT 141: 10. RSACNIT 141: 10. RSA
CNIT 141: 10. RSA
 
Rsa
RsaRsa
Rsa
 
CNS.ppt
CNS.pptCNS.ppt
CNS.ppt
 
Chapter 06 rsa cryptosystem
Chapter 06   rsa cryptosystemChapter 06   rsa cryptosystem
Chapter 06 rsa cryptosystem
 

More from Tarek Gaber

Writing a Successful Paper (Academic Writing Engineering)
Writing a Successful Paper (Academic Writing Engineering)Writing a Successful Paper (Academic Writing Engineering)
Writing a Successful Paper (Academic Writing Engineering)Tarek Gaber
 
Feature Selection Method Based on Chaotic Maps and Butterfly Optimization Alg...
Feature Selection Method Based on Chaotic Maps and Butterfly Optimization Alg...Feature Selection Method Based on Chaotic Maps and Butterfly Optimization Alg...
Feature Selection Method Based on Chaotic Maps and Butterfly Optimization Alg...Tarek Gaber
 
Thermal Imaging: Opportunities and Challenges for Breast Cancer Detection
Thermal Imaging: Opportunities and Challenges for Breast Cancer DetectionThermal Imaging: Opportunities and Challenges for Breast Cancer Detection
Thermal Imaging: Opportunities and Challenges for Breast Cancer DetectionTarek Gaber
 
Using Google Scholar to get similar paper to your class/gradation project
Using Google Scholar to get similar paper to your class/gradation projectUsing Google Scholar to get similar paper to your class/gradation project
Using Google Scholar to get similar paper to your class/gradation projectTarek Gaber
 
Brief Guidelines for Writing Graduation Project Thesis
Brief Guidelines for Writing Graduation Project ThesisBrief Guidelines for Writing Graduation Project Thesis
Brief Guidelines for Writing Graduation Project ThesisTarek Gaber
 
Simple Overview of PKI and Digital signature by Tarek_Gaber
Simple Overview of PKI and Digital signature by Tarek_GaberSimple Overview of PKI and Digital signature by Tarek_Gaber
Simple Overview of PKI and Digital signature by Tarek_GaberTarek Gaber
 
Integer Wavelet Transform for Thermal Image Authentication
Integer Wavelet Transform for Thermal Image AuthenticationInteger Wavelet Transform for Thermal Image Authentication
Integer Wavelet Transform for Thermal Image AuthenticationTarek Gaber
 
Segmentation of thermograms breast cancer tarek-to-slid share
Segmentation of thermograms breast cancer tarek-to-slid shareSegmentation of thermograms breast cancer tarek-to-slid share
Segmentation of thermograms breast cancer tarek-to-slid shareTarek Gaber
 
Touch paper presentation-tarek
Touch paper presentation-tarekTouch paper presentation-tarek
Touch paper presentation-tarekTarek Gaber
 
Overview on security and privacy issues in wireless sensor networks-2014
Overview on security and privacy issues in  wireless sensor networks-2014Overview on security and privacy issues in  wireless sensor networks-2014
Overview on security and privacy issues in wireless sensor networks-2014Tarek Gaber
 
Sift based arabic sign language recognition aecia 2014 –november17-19, addis ...
Sift based arabic sign language recognition aecia 2014 –november17-19, addis ...Sift based arabic sign language recognition aecia 2014 –november17-19, addis ...
Sift based arabic sign language recognition aecia 2014 –november17-19, addis ...Tarek Gaber
 
Fair and abuse free contract signing protocol supporting fair license reselli...
Fair and abuse free contract signing protocol supporting fair license reselli...Fair and abuse free contract signing protocol supporting fair license reselli...
Fair and abuse free contract signing protocol supporting fair license reselli...Tarek Gaber
 
Drm digital rights managment-june2014-tarek gaber
Drm digital rights managment-june2014-tarek gaberDrm digital rights managment-june2014-tarek gaber
Drm digital rights managment-june2014-tarek gaberTarek Gaber
 
A novel approach to allow multiple resales of DRM protected contents - icces2...
A novel approach to allow multiple resales of DRM protected contents - icces2...A novel approach to allow multiple resales of DRM protected contents - icces2...
A novel approach to allow multiple resales of DRM protected contents - icces2...Tarek Gaber
 
تطبيق محمول للصم والبكم يحول الاشارات الى صوت Unesco-cairo-13-2-2014
تطبيق محمول للصم والبكم يحول الاشارات الى صوت Unesco-cairo-13-2-2014تطبيق محمول للصم والبكم يحول الاشارات الى صوت Unesco-cairo-13-2-2014
تطبيق محمول للصم والبكم يحول الاشارات الى صوت Unesco-cairo-13-2-2014Tarek Gaber
 

More from Tarek Gaber (15)

Writing a Successful Paper (Academic Writing Engineering)
Writing a Successful Paper (Academic Writing Engineering)Writing a Successful Paper (Academic Writing Engineering)
Writing a Successful Paper (Academic Writing Engineering)
 
Feature Selection Method Based on Chaotic Maps and Butterfly Optimization Alg...
Feature Selection Method Based on Chaotic Maps and Butterfly Optimization Alg...Feature Selection Method Based on Chaotic Maps and Butterfly Optimization Alg...
Feature Selection Method Based on Chaotic Maps and Butterfly Optimization Alg...
 
Thermal Imaging: Opportunities and Challenges for Breast Cancer Detection
Thermal Imaging: Opportunities and Challenges for Breast Cancer DetectionThermal Imaging: Opportunities and Challenges for Breast Cancer Detection
Thermal Imaging: Opportunities and Challenges for Breast Cancer Detection
 
Using Google Scholar to get similar paper to your class/gradation project
Using Google Scholar to get similar paper to your class/gradation projectUsing Google Scholar to get similar paper to your class/gradation project
Using Google Scholar to get similar paper to your class/gradation project
 
Brief Guidelines for Writing Graduation Project Thesis
Brief Guidelines for Writing Graduation Project ThesisBrief Guidelines for Writing Graduation Project Thesis
Brief Guidelines for Writing Graduation Project Thesis
 
Simple Overview of PKI and Digital signature by Tarek_Gaber
Simple Overview of PKI and Digital signature by Tarek_GaberSimple Overview of PKI and Digital signature by Tarek_Gaber
Simple Overview of PKI and Digital signature by Tarek_Gaber
 
Integer Wavelet Transform for Thermal Image Authentication
Integer Wavelet Transform for Thermal Image AuthenticationInteger Wavelet Transform for Thermal Image Authentication
Integer Wavelet Transform for Thermal Image Authentication
 
Segmentation of thermograms breast cancer tarek-to-slid share
Segmentation of thermograms breast cancer tarek-to-slid shareSegmentation of thermograms breast cancer tarek-to-slid share
Segmentation of thermograms breast cancer tarek-to-slid share
 
Touch paper presentation-tarek
Touch paper presentation-tarekTouch paper presentation-tarek
Touch paper presentation-tarek
 
Overview on security and privacy issues in wireless sensor networks-2014
Overview on security and privacy issues in  wireless sensor networks-2014Overview on security and privacy issues in  wireless sensor networks-2014
Overview on security and privacy issues in wireless sensor networks-2014
 
Sift based arabic sign language recognition aecia 2014 –november17-19, addis ...
Sift based arabic sign language recognition aecia 2014 –november17-19, addis ...Sift based arabic sign language recognition aecia 2014 –november17-19, addis ...
Sift based arabic sign language recognition aecia 2014 –november17-19, addis ...
 
Fair and abuse free contract signing protocol supporting fair license reselli...
Fair and abuse free contract signing protocol supporting fair license reselli...Fair and abuse free contract signing protocol supporting fair license reselli...
Fair and abuse free contract signing protocol supporting fair license reselli...
 
Drm digital rights managment-june2014-tarek gaber
Drm digital rights managment-june2014-tarek gaberDrm digital rights managment-june2014-tarek gaber
Drm digital rights managment-june2014-tarek gaber
 
A novel approach to allow multiple resales of DRM protected contents - icces2...
A novel approach to allow multiple resales of DRM protected contents - icces2...A novel approach to allow multiple resales of DRM protected contents - icces2...
A novel approach to allow multiple resales of DRM protected contents - icces2...
 
تطبيق محمول للصم والبكم يحول الاشارات الى صوت Unesco-cairo-13-2-2014
تطبيق محمول للصم والبكم يحول الاشارات الى صوت Unesco-cairo-13-2-2014تطبيق محمول للصم والبكم يحول الاشارات الى صوت Unesco-cairo-13-2-2014
تطبيق محمول للصم والبكم يحول الاشارات الى صوت Unesco-cairo-13-2-2014
 

Recently uploaded

Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
Capitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitolTechU
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfUjwalaBharambe
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxAvyJaneVismanos
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxsocialsciencegdgrohi
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementmkooblal
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,Virag Sontakke
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupJonathanParaisoCruz
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerunnathinaik
 

Recently uploaded (20)

Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
Capitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptx
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptx
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of management
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized Group
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developer
 

Simple Overview Caesar and RSA Encryption_by_Tarek_Gaber

  • 1. Introduction to Network Security Lecture 2: Caesar and RSA Location:E.T.S. de Ingenierias Informatica y de Telecomunicacion Universidad de Granada 18071, Granada (SPAIN), 24-28 April 2017 Dr. Tarek Gaber Faculty of Computers and Informatics, Suez Canal University, Ismailia, Egypt tmgaber@gmail.com
  • 2. Lecture Objectives To learn Caesar encryption as an example of symmetric encryption techniques To learn RSA encryption as an example of asymmetric encryption techniques
  • 3. Lecture Outlines What is Caesar Algorithm How does Caesar algorithm works What is RSA technique Simple numerical example of RSA
  • 4. Caesar Cipher • The earliest known as substitution cipher by Julius Caesar • First attested use in military affairs • Replaces each letter by 3rd letter later • example: meet me after the toga party PHHW PH DIWHU WKH WRJD SDUWB http://www.xarg.org/tools/caesar- cipher/
  • 5. What is a Caesar Cipher? • Caesar used to encrypt his messages using a very simple algorithm, which could be easily decrypted if you know the key. • He would take each letter of the alphabet and replace it with a letter a certain distance away from that letter. When he got to the end, he would wrap back around to the beginning. • Example with a shift of 3: A B C D E F G H I J K L M N O P Q R S T U V W X Y Z D E F G H I J K L M N O P Q R S T U V W X Y Z A B C https://www.youtube.com/watch?v=fR8rVR72a6o
  • 7. Caesar Cipher • can define transformation as: a b c d e f g h i j k l m n o p q r s t u v w x y z D E F G H I J K L M N O P Q R S T U V W X Y Z A B C • mathematically give each letter a number a b c d e f g h i j k l m 0 1 2 3 4 5 6 7 8 9 10 11 12 n o p q r s t u v w x y Z 13 14 15 16 17 18 19 20 21 22 23 24 25 • then have Caesar cipher as: C = E(p) = (p + k) mod (26) p = D(C) = (C – k) mod (26)
  • 8. MOD Function • MOD is short for modulus, which means ' the remainder left over after a value is divided by something' Examples: 27 mod 26... 27 / 26 is 1 R 1, so 27 mod 26 is 1 53 mod 26... 53 / 26 is 2 R 1 so 53 mod 26 is also 1 10 mod 3 is also 1 (since 10 / 3 = 3 R 1) 2 mod 2 = 0 5 mod 2 = 1 25 mod 26 = 25 50 mod 26 = 24 • if a = (b) mod c then a = (c*k + b) mod c (where k = 1,2,3.......) • So, if we have (-4 mod 3), we could write it as ( 3x2 -4) mod 3 =2
  • 9. Caesar Algorithm • 1. Convert the characters to numbers 2. Pick a number to shift by 3. Add the number to each character 4. Mod each resulting number by 26 5. You message is now encrypted!
  • 10. Cryptanalysis of Caesar Cipher • only have 26 possible ciphers – A maps to A,B,..Z • could simply try each in turn • a brute force search • given ciphertext, just try all shifts of letters • do need to recognize when have plaintext • eg. break ciphertext “ERE L ORYH BRX DOLFH“ (HOMEWORK)
  • 11. The Problem with Caesar’s Cipher • It’s too easy to break! Let’s go back to our five letter alphabet. • Say you had the word DBCA, but didn’t know the key. It would be easy to make a list of all possible keys. If you expected the unencrypted text to be in English, you could easily figure out which word was right: • If you were using the full English alphabet, this would take longer, but for someone trying to find our your secret, it’s a small price to pay! Shift of 1 CABE Shift of 2 BEAD  The clear winner! Shift of 3 ADEC Shift of 4 ECDB How dare you insult my cipher! Though, you have a good point…
  • 12. RSA Algorithm • The RSA algorithm is named after Ron Rivest, Adi Shamir and Len Adleman, who invented it in 1977. • The RSA cryptosystem is the most widely-used public key cryptography algorithm in the world. It can be used to encrypt a message without the need to exchange a secret key separately. • The RSA algorithm can be used for both public key encryption and digital signatures. • Its security is based on the difficulty of factoring large integers.
  • 13. Prime Number • A Prime Number can be divided evenly only by 1 or itself and it must be a whole number greater than 1. • Examples: – Is 8 a Prime Number? • No, because it can be divided evenly by 2 or 4 (2×4=8), as well as by 1 and 8. – Is 73 a Prime Number? • Yes, it can only be divided evenly by 1 and 73.
  • 14. Prime and Co-prime Number • Two numbers are said to be Co-primes when they have only 1 as a common factor. • Example 1: Are numbers 6 and 25 Coprime ? Answer = Two given numbers are 6 and 25 Factors of 6 = 1, 2, 3, 6 and Factors of 25 = 1, 5, 25 On comparing the factors of numbers 6 and 25, you can see that both have only 1 as a common factor, So, 6 and 25 are Coprimes. • The Factors of a given number are those which divide a given number completely, without leaving any remainder. – Factors of a given number 12 are 1, 2, 3, 4, 6 & 12
  • 15. RSA Key Generation Algorithm • Generate two large random primes, p and q, of approximately equal size such that their product n = pq is of the required bit length, e.g. 1024 bits. • Compute n = pq and (phi) φ = (p-1)(q-1). • Choose an integer e, 1 < e < phi, such that gcd(e, phi) = 1. Compute the secret exponent d, 1 < d < phi, such that ed ≡ 1 (mod phi). – ( e *d) / phi = ? with the remainder of 1, (1 mod phi equivalent to e*d mod phi). • The public key is (n, e) and the private key (p, q, d) or (n, d). • Keep all the values d, p, q and phi secret.
  • 16. Summary of RSA • Key Generation – n = pq, where p and q are distinct primes. – phi, φ = (p-1)(q-1) – e < n such that gcd(e, phi)=1 – d = e-1 mod phi. • Encryption/Decryption – c = me mod n, 1<m<n. – m = cd mod n.
  • 17. Homework (Caesar and RSA) • Using the Caesar algorithm, how you can get the key used to get the ciphertext “ERE L ORYH BRX DOLFH“ and what should be the plaintext of this ciphertext. • In the RSA numerical example given in the lecture, we have chosen e = 7, – change e to 11, – compute d, and – compute the public and private key pair – encrypt the message M =2 • Send it to tmgaber@gmai.com by 12:00 (PM) 27-4-2017
  • 18. Thanks for your attention Questions, please