SlideShare a Scribd company logo
1 of 23
Affine Cipher
A more complicated
cipher formula involves
multiplying the cipher
value of each letter of the
original message. In a
way, this will be more
difficult to track than the
shift cipher technique.
Affine Cipher
M
Encryption Cipher (m, K): C = (mP + K) mod 26
Decryption Cipher (m, K): P = (C – K) mod 26
• 𝑃 is the original position of a letter in the given message
• 𝐶 is the shifted position (code letter),
• 𝐾 is a constant that determines the fixed number of shift
positions.
Affine Cipher
M
Encryption Cipher (m, K): C = (mP + K) mod 26
Decryption Cipher (m, K): P = (C – K) mod 26
As a reminder, denotes the multiplicative
inverse of m with respect to modulo 26
operation.
Affine Cipher
Encryption Cipher (m, K): C = (mP + K) mod 26
Decryption Cipher (m, K): P = (C – K) mod 26
Note also that the pair (m, K) is a valid
encryption cipher parameters if m and 26
are relatively prime.
Encryption with Affine Cipher
Encryption Formula: C = (3P + 5) mod 26
Example 1
Encrypt the message “Let us
drink coffee” using the affine
cipher pair (m, K) = (3, 5).
Encryption Cipher (m, K): C = (mP + K) mod 26
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
Example 1:
Encrypt the message “Let us drink coffee” using
the affine cipher pair (m, K) = (3, 5).
Encryption with Affine Cipher
Encryption Formula:
C = (3P + 5) mod 26
• For letter “L”, P=11
• C=[(3)(11)+5] mod 26
= 38 mod 26 = 12 the code letter for “L” is “M”
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
Example 1:
Verify the following: C = (3P + 5) mod 26
Encryption with Affine Cipher
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
Original
letter
L E T U S D R I N K C O F F E E
Original
position
11 4 19 20 18 3 17 8 13 10 2 14 5 5 4 4
New
position
12 17 10 13 7 14 4 3 18 9 11 21 20 20 17 17
Code
letter
M R K N H O E D S J L V U U R R
The Encrypted message is : MRKNHOEDSJLVUURR
Encryption with Affine Cipher
Encryption Formula: C = (5P + 8) mod 26
Example 2
Encrypt the message “Math is
Fun” using the affine cipher pair
(m, K) = (5, 8).
Encryption Cipher (m, K): C = (mP + K) mod 26
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
Example 2:
Verify the following: C = (5P + 8) mod 26
Encryption with Affine Cipher
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
Original letter
M A T H I S F U N
Original
position
New
position
Code letter
The Encrypted message is :
Affine Cipher
M
Decryption Cipher (m, K): P = (C – K) mod 26
As a reminder, denotes the multiplicative
inverse of m with respect to modulo 26
operation.
Example 1: Decryption with Affine Cipher
Determine a decryption formula for
the pair (m, K)=(3, 5)
Decryption Cipher (m, K): P =
𝟏
𝒎
(C – K) mod 26
1
𝑚
=
1
3
≅ 9 mod 26, since (3)(9) mod 26 = 27 mod 26 = 1
-K = -5 ≅ 21 mod 26, since 5 + 21 = 26 ≅ 0 mod 26
Again, recall that
1
3
denotes the multiplicative inverse of 3 mod 26
while -5 denotes the additive inverse of 5 mod 26.
Example 1: Decrypt for (m, K)=(3, 5)
mod 26, since (3)(9) mod 26 = 27 mod 26 = 1
-K = -5 ≅ 21 mod 26, since 5 + 21 = 26 ≅ 0 mod 26
Again, recall that
1
3
denotes the multiplicative inverse of 3 mod 26
while -5 denotes the additive inverse of 5 mod 26.
1
𝑚
=
1
3
≅ 9
Decryption Cipher (m, K): P =
𝟏
𝒎
(C – K) mod 26
Decryption formula:
P = 9(C + 21) mod 26 or
P = 9(C – 5) mod 26
Example 1: Decrypt : MRKNHOEDSJLVUURR
Decryption formula:
P = 9(C + 21) mod 26 or
P = 9(C – 5) mod 26
Let us use : P = 9(C + 21) mod 26
Example 1: Decrypt : MRKNHOEDSJLVUURR
Decryption formula:
P = 9(C + 21) mod 26
For letter “M”, C=12
==> P=9(12+21) mod 26
= 9 (33) mod 26
= 297 mod 26 = 11
==> P = 11, corresponds to letter “L”
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
Example 1:
Let us use : P = 9 (C + 21) mod 26
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
Encrypted
M R K N H O E D S J L V U U R R
Position (C) 12 17 10 13 7 14 4 3 18 9 11 21 20 20 17 17
Original
position (P)
Original
letter
The Decrypted message is :
11 4 19 20 18 3 17 8 13 10 2 14 5 5 4 4
L E T U S D R I N K C O F F E E
LET US DRINK COFFEE
Decrypt : MRKNHOEDSJLVUURR
Example 1: Decrypt : MRKNHOEDSJLVUURR
Decryption formula:
P = 9(C + 21) mod 26 or
P = 9(C – 5 ) mod 26
Let us use : P = 9(C - 5) mod 26
Example 1: Decrypt : MRKNHOEDSJLVUURR
Decryption formula:
P = 9(C - 5) mod 26
For letter “M”, C=12
==> P=9(12-5) mod 26
= 9 (7) mod 26
= 63 mod 26 = 11
==> P = 11, corresponds to letter “L”
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
Example 1:
Let us use : P = 9 (C – 5 ) mod 26
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
Encrypted
M R K N H O E D S J L V U U R R
Position (C) 12 17 10 13 7 14 4 3 18 9 11 21 20 20 17 17
Original
position (P)
Original
letter
The Decrypted message is :
11 4 19 20 18 3 17 8 13 10 2 14 5 5 4 4
L E T U S D R I N K C O F F E E
LET US DRINK COFFEE
Decrypt : MRKNHOEDSJLVUURR
Example 2: Decrypt “ DTFSKKVTFKLAPVQDR”
Decrypt “DTFSKKVTFKLAPVQDR”
using the affine cipher pair (m, K) = (3, 5).
Decryption formula:
P = 9(C + 21) mod 26 or
P = 9(C – 5 ) mod 26
Example 2:
Verify the following: P = 9(C + 21) mod 26
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
Encrypted
D T F S K K V T F K L A P V Q D R
Position (C)
Original
position (P)
Original
letter
The Decrypted message is :
Decrypt “ DTFSKKVTFKLAPVQDR”
1. Apply Affine Cipher using (m, K) = (3, 4) to
encrypt the message: “STOPTONIGHT”
2. Apply Affine Cipher using (m, K) = (3, 7) to
decrypt the message: “HWWFUTNFABTG”
FOR LISTENING

More Related Content

What's hot (20)

Cryptography and Information Security
Cryptography and Information SecurityCryptography and Information Security
Cryptography and Information Security
 
Network Security and Cryptography
Network Security and CryptographyNetwork Security and Cryptography
Network Security and Cryptography
 
The rsa algorithm
The rsa algorithmThe rsa algorithm
The rsa algorithm
 
6. cryptography
6. cryptography6. cryptography
6. cryptography
 
CRYPTOGRAPHY & NETWORK SECURITY
CRYPTOGRAPHY & NETWORK SECURITYCRYPTOGRAPHY & NETWORK SECURITY
CRYPTOGRAPHY & NETWORK SECURITY
 
Email security presentation
Email security presentationEmail security presentation
Email security presentation
 
Cryptography
CryptographyCryptography
Cryptography
 
Security Attacks.ppt
Security Attacks.pptSecurity Attacks.ppt
Security Attacks.ppt
 
Cryptography
CryptographyCryptography
Cryptography
 
Cryptography
CryptographyCryptography
Cryptography
 
Attribute Based Encryption
Attribute Based EncryptionAttribute Based Encryption
Attribute Based Encryption
 
Classical encryption techniques
Classical encryption techniquesClassical encryption techniques
Classical encryption techniques
 
Diffie-hellman algorithm
Diffie-hellman algorithmDiffie-hellman algorithm
Diffie-hellman algorithm
 
String Matching (Naive,Rabin-Karp,KMP)
String Matching (Naive,Rabin-Karp,KMP)String Matching (Naive,Rabin-Karp,KMP)
String Matching (Naive,Rabin-Karp,KMP)
 
RSA ALGORITHM
RSA ALGORITHMRSA ALGORITHM
RSA ALGORITHM
 
Mathematics:Cryptography
Mathematics:CryptographyMathematics:Cryptography
Mathematics:Cryptography
 
Rsa cryptosystem
Rsa cryptosystemRsa cryptosystem
Rsa cryptosystem
 
Primality
PrimalityPrimality
Primality
 
Cryptography - 101
Cryptography - 101Cryptography - 101
Cryptography - 101
 
Elgamal Digital Signature
Elgamal Digital SignatureElgamal Digital Signature
Elgamal Digital Signature
 

Similar to Here are the steps to solve the problems:1. Encrypt "STOPTONIGHT" using (m, K) = (3, 4):Encryption formula: C = (3P + 4) mod 26Find the position P of each letter and apply the formula to get the code letter C.The encrypted message is: VXSWVRPJIBW2. Decrypt "HWWFUTNFABTG" using (m, K) = (3, 7): Decryption formula: P = (9(C - 7)) mod 26Find the code letter position C of each letter, apply the formula to get the original position P and then the letter

Cryptology Caesar Cipher
Cryptology Caesar CipherCryptology Caesar Cipher
Cryptology Caesar CipherNakib Akash
 
Matlab_basic2013_1.pdf
Matlab_basic2013_1.pdfMatlab_basic2013_1.pdf
Matlab_basic2013_1.pdfabdul basit
 
Encrypt the message HALT by translating the letters into numbe.pdf
Encrypt the message  HALT  by translating the letters into numbe.pdfEncrypt the message  HALT  by translating the letters into numbe.pdf
Encrypt the message HALT by translating the letters into numbe.pdfaroraenterprisesmbd
 
EL GAMAL computer and network security .pptx
EL GAMAL computer and network security .pptxEL GAMAL computer and network security .pptx
EL GAMAL computer and network security .pptxpeter1097
 
Syed Ubaid Ali Jafri - Cryptography Techniques
Syed Ubaid Ali Jafri - Cryptography TechniquesSyed Ubaid Ali Jafri - Cryptography Techniques
Syed Ubaid Ali Jafri - Cryptography TechniquesSyed Ubaid Ali Jafri
 
27-Equivalent under modulo-27-Oct-2020Material_I_27-Oct-2020_Cryptography_.pdf
27-Equivalent under modulo-27-Oct-2020Material_I_27-Oct-2020_Cryptography_.pdf27-Equivalent under modulo-27-Oct-2020Material_I_27-Oct-2020_Cryptography_.pdf
27-Equivalent under modulo-27-Oct-2020Material_I_27-Oct-2020_Cryptography_.pdfMohamedshabana38
 
Caesar Cipher.pptx Information Security ppt
Caesar Cipher.pptx Information Security pptCaesar Cipher.pptx Information Security ppt
Caesar Cipher.pptx Information Security pptAliSaddique
 
Novel Performance Analysis of Network Coded Communications in Single-Relay Ne...
Novel Performance Analysis of Network Coded Communications in Single-Relay Ne...Novel Performance Analysis of Network Coded Communications in Single-Relay Ne...
Novel Performance Analysis of Network Coded Communications in Single-Relay Ne...Communication Systems & Networks
 
Known plaintext attack of hill cipher
Known plaintext attack of hill cipherKnown plaintext attack of hill cipher
Known plaintext attack of hill cipherMinghongGao
 
Signyourd digital signature certificate provider
Signyourd   digital signature certificate providerSignyourd   digital signature certificate provider
Signyourd digital signature certificate providerKishankant Yadav
 
Digital electronics k map comparators and their function
Digital electronics k map comparators and their functionDigital electronics k map comparators and their function
Digital electronics k map comparators and their functionkumarankit06875
 
Reed Solomon encoder and decoder \ ريد سلمون
Reed Solomon encoder and decoder \ ريد سلمونReed Solomon encoder and decoder \ ريد سلمون
Reed Solomon encoder and decoder \ ريد سلمونMuhammed Abdulmahdi
 
A study on number theory and its applications
A study on number theory and its applicationsA study on number theory and its applications
A study on number theory and its applicationsItishree Dash
 
Computer Security (Cryptography) Ch02
Computer Security (Cryptography) Ch02Computer Security (Cryptography) Ch02
Computer Security (Cryptography) Ch02Saif Kassim
 
A Parallel Branch And Bound Algorithm For The Quadratic Assignment Problem
A Parallel Branch And Bound Algorithm For The Quadratic Assignment ProblemA Parallel Branch And Bound Algorithm For The Quadratic Assignment Problem
A Parallel Branch And Bound Algorithm For The Quadratic Assignment ProblemMary Calkins
 

Similar to Here are the steps to solve the problems:1. Encrypt "STOPTONIGHT" using (m, K) = (3, 4):Encryption formula: C = (3P + 4) mod 26Find the position P of each letter and apply the formula to get the code letter C.The encrypted message is: VXSWVRPJIBW2. Decrypt "HWWFUTNFABTG" using (m, K) = (3, 7): Decryption formula: P = (9(C - 7)) mod 26Find the code letter position C of each letter, apply the formula to get the original position P and then the letter (20)

Cryptology Caesar Cipher
Cryptology Caesar CipherCryptology Caesar Cipher
Cryptology Caesar Cipher
 
Matlab_basic2013_1.pdf
Matlab_basic2013_1.pdfMatlab_basic2013_1.pdf
Matlab_basic2013_1.pdf
 
Encrypt the message HALT by translating the letters into numbe.pdf
Encrypt the message  HALT  by translating the letters into numbe.pdfEncrypt the message  HALT  by translating the letters into numbe.pdf
Encrypt the message HALT by translating the letters into numbe.pdf
 
EL GAMAL computer and network security .pptx
EL GAMAL computer and network security .pptxEL GAMAL computer and network security .pptx
EL GAMAL computer and network security .pptx
 
Syed Ubaid Ali Jafri - Cryptography Techniques
Syed Ubaid Ali Jafri - Cryptography TechniquesSyed Ubaid Ali Jafri - Cryptography Techniques
Syed Ubaid Ali Jafri - Cryptography Techniques
 
27-Equivalent under modulo-27-Oct-2020Material_I_27-Oct-2020_Cryptography_.pdf
27-Equivalent under modulo-27-Oct-2020Material_I_27-Oct-2020_Cryptography_.pdf27-Equivalent under modulo-27-Oct-2020Material_I_27-Oct-2020_Cryptography_.pdf
27-Equivalent under modulo-27-Oct-2020Material_I_27-Oct-2020_Cryptography_.pdf
 
Caesar Cipher.pptx Information Security ppt
Caesar Cipher.pptx Information Security pptCaesar Cipher.pptx Information Security ppt
Caesar Cipher.pptx Information Security ppt
 
Novel Performance Analysis of Network Coded Communications in Single-Relay Ne...
Novel Performance Analysis of Network Coded Communications in Single-Relay Ne...Novel Performance Analysis of Network Coded Communications in Single-Relay Ne...
Novel Performance Analysis of Network Coded Communications in Single-Relay Ne...
 
Known plaintext attack of hill cipher
Known plaintext attack of hill cipherKnown plaintext attack of hill cipher
Known plaintext attack of hill cipher
 
Matdis 3.4
Matdis 3.4Matdis 3.4
Matdis 3.4
 
Signyourd digital signature certificate provider
Signyourd   digital signature certificate providerSignyourd   digital signature certificate provider
Signyourd digital signature certificate provider
 
Digital electronics k map comparators and their function
Digital electronics k map comparators and their functionDigital electronics k map comparators and their function
Digital electronics k map comparators and their function
 
Reed Solomon encoder and decoder \ ريد سلمون
Reed Solomon encoder and decoder \ ريد سلمونReed Solomon encoder and decoder \ ريد سلمون
Reed Solomon encoder and decoder \ ريد سلمون
 
Muchtadi
MuchtadiMuchtadi
Muchtadi
 
A study on number theory and its applications
A study on number theory and its applicationsA study on number theory and its applications
A study on number theory and its applications
 
OTP basic
OTP basicOTP basic
OTP basic
 
kmaps
 kmaps kmaps
kmaps
 
Truss Formulas
Truss FormulasTruss Formulas
Truss Formulas
 
Computer Security (Cryptography) Ch02
Computer Security (Cryptography) Ch02Computer Security (Cryptography) Ch02
Computer Security (Cryptography) Ch02
 
A Parallel Branch And Bound Algorithm For The Quadratic Assignment Problem
A Parallel Branch And Bound Algorithm For The Quadratic Assignment ProblemA Parallel Branch And Bound Algorithm For The Quadratic Assignment Problem
A Parallel Branch And Bound Algorithm For The Quadratic Assignment Problem
 

Recently uploaded

Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
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
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxRoyAbrique
 
Concept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfConcept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfUmakantAnnand
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
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
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting DataJhengPantaleon
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppCeline George
 
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
 

Recently uploaded (20)

Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
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
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
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
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
 
Concept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfConcept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.Compdf
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
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
 
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🔝
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website App
 
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
 

Here are the steps to solve the problems:1. Encrypt "STOPTONIGHT" using (m, K) = (3, 4):Encryption formula: C = (3P + 4) mod 26Find the position P of each letter and apply the formula to get the code letter C.The encrypted message is: VXSWVRPJIBW2. Decrypt "HWWFUTNFABTG" using (m, K) = (3, 7): Decryption formula: P = (9(C - 7)) mod 26Find the code letter position C of each letter, apply the formula to get the original position P and then the letter

  • 1.
  • 2. Affine Cipher A more complicated cipher formula involves multiplying the cipher value of each letter of the original message. In a way, this will be more difficult to track than the shift cipher technique.
  • 3. Affine Cipher M Encryption Cipher (m, K): C = (mP + K) mod 26 Decryption Cipher (m, K): P = (C – K) mod 26 • 𝑃 is the original position of a letter in the given message • 𝐶 is the shifted position (code letter), • 𝐾 is a constant that determines the fixed number of shift positions.
  • 4. Affine Cipher M Encryption Cipher (m, K): C = (mP + K) mod 26 Decryption Cipher (m, K): P = (C – K) mod 26 As a reminder, denotes the multiplicative inverse of m with respect to modulo 26 operation.
  • 5. Affine Cipher Encryption Cipher (m, K): C = (mP + K) mod 26 Decryption Cipher (m, K): P = (C – K) mod 26 Note also that the pair (m, K) is a valid encryption cipher parameters if m and 26 are relatively prime.
  • 6. Encryption with Affine Cipher Encryption Formula: C = (3P + 5) mod 26 Example 1 Encrypt the message “Let us drink coffee” using the affine cipher pair (m, K) = (3, 5). Encryption Cipher (m, K): C = (mP + K) mod 26 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
  • 7. Example 1: Encrypt the message “Let us drink coffee” using the affine cipher pair (m, K) = (3, 5). Encryption with Affine Cipher Encryption Formula: C = (3P + 5) mod 26 • For letter “L”, P=11 • C=[(3)(11)+5] mod 26 = 38 mod 26 = 12 the code letter for “L” is “M” 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
  • 8. Example 1: Verify the following: C = (3P + 5) mod 26 Encryption with Affine Cipher 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 Original letter L E T U S D R I N K C O F F E E Original position 11 4 19 20 18 3 17 8 13 10 2 14 5 5 4 4 New position 12 17 10 13 7 14 4 3 18 9 11 21 20 20 17 17 Code letter M R K N H O E D S J L V U U R R The Encrypted message is : MRKNHOEDSJLVUURR
  • 9. Encryption with Affine Cipher Encryption Formula: C = (5P + 8) mod 26 Example 2 Encrypt the message “Math is Fun” using the affine cipher pair (m, K) = (5, 8). Encryption Cipher (m, K): C = (mP + K) mod 26 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
  • 10. Example 2: Verify the following: C = (5P + 8) mod 26 Encryption with Affine Cipher 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 Original letter M A T H I S F U N Original position New position Code letter The Encrypted message is :
  • 11. Affine Cipher M Decryption Cipher (m, K): P = (C – K) mod 26 As a reminder, denotes the multiplicative inverse of m with respect to modulo 26 operation.
  • 12. Example 1: Decryption with Affine Cipher Determine a decryption formula for the pair (m, K)=(3, 5) Decryption Cipher (m, K): P = 𝟏 𝒎 (C – K) mod 26 1 𝑚 = 1 3 ≅ 9 mod 26, since (3)(9) mod 26 = 27 mod 26 = 1 -K = -5 ≅ 21 mod 26, since 5 + 21 = 26 ≅ 0 mod 26 Again, recall that 1 3 denotes the multiplicative inverse of 3 mod 26 while -5 denotes the additive inverse of 5 mod 26.
  • 13. Example 1: Decrypt for (m, K)=(3, 5) mod 26, since (3)(9) mod 26 = 27 mod 26 = 1 -K = -5 ≅ 21 mod 26, since 5 + 21 = 26 ≅ 0 mod 26 Again, recall that 1 3 denotes the multiplicative inverse of 3 mod 26 while -5 denotes the additive inverse of 5 mod 26. 1 𝑚 = 1 3 ≅ 9 Decryption Cipher (m, K): P = 𝟏 𝒎 (C – K) mod 26 Decryption formula: P = 9(C + 21) mod 26 or P = 9(C – 5) mod 26
  • 14. Example 1: Decrypt : MRKNHOEDSJLVUURR Decryption formula: P = 9(C + 21) mod 26 or P = 9(C – 5) mod 26 Let us use : P = 9(C + 21) mod 26
  • 15. Example 1: Decrypt : MRKNHOEDSJLVUURR Decryption formula: P = 9(C + 21) mod 26 For letter “M”, C=12 ==> P=9(12+21) mod 26 = 9 (33) mod 26 = 297 mod 26 = 11 ==> P = 11, corresponds to letter “L” 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
  • 16. Example 1: Let us use : P = 9 (C + 21) mod 26 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 Encrypted M R K N H O E D S J L V U U R R Position (C) 12 17 10 13 7 14 4 3 18 9 11 21 20 20 17 17 Original position (P) Original letter The Decrypted message is : 11 4 19 20 18 3 17 8 13 10 2 14 5 5 4 4 L E T U S D R I N K C O F F E E LET US DRINK COFFEE Decrypt : MRKNHOEDSJLVUURR
  • 17. Example 1: Decrypt : MRKNHOEDSJLVUURR Decryption formula: P = 9(C + 21) mod 26 or P = 9(C – 5 ) mod 26 Let us use : P = 9(C - 5) mod 26
  • 18. Example 1: Decrypt : MRKNHOEDSJLVUURR Decryption formula: P = 9(C - 5) mod 26 For letter “M”, C=12 ==> P=9(12-5) mod 26 = 9 (7) mod 26 = 63 mod 26 = 11 ==> P = 11, corresponds to letter “L” 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
  • 19. Example 1: Let us use : P = 9 (C – 5 ) mod 26 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 Encrypted M R K N H O E D S J L V U U R R Position (C) 12 17 10 13 7 14 4 3 18 9 11 21 20 20 17 17 Original position (P) Original letter The Decrypted message is : 11 4 19 20 18 3 17 8 13 10 2 14 5 5 4 4 L E T U S D R I N K C O F F E E LET US DRINK COFFEE Decrypt : MRKNHOEDSJLVUURR
  • 20. Example 2: Decrypt “ DTFSKKVTFKLAPVQDR” Decrypt “DTFSKKVTFKLAPVQDR” using the affine cipher pair (m, K) = (3, 5). Decryption formula: P = 9(C + 21) mod 26 or P = 9(C – 5 ) mod 26
  • 21. Example 2: Verify the following: P = 9(C + 21) mod 26 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 Encrypted D T F S K K V T F K L A P V Q D R Position (C) Original position (P) Original letter The Decrypted message is : Decrypt “ DTFSKKVTFKLAPVQDR”
  • 22. 1. Apply Affine Cipher using (m, K) = (3, 4) to encrypt the message: “STOPTONIGHT” 2. Apply Affine Cipher using (m, K) = (3, 7) to decrypt the message: “HWWFUTNFABTG”