SlideShare a Scribd company logo
1 of 18
ENCRYPTION-DECRYPTION
of Devanagri Script Using Affine Cipher
Team :
Astha Goel
Harshit Bhatia
Mohit Singhal
Prachi Gupta
Swati Nagpal
Deen Dayal Upadhaya College
Objective
To design and implement an
Encryption/Decryption scheme based on affine
cipher for plain text in Devanagri(Unicode)
communicating message in Hindi.
Also, to develop a solver which solves the
crypt when the encryption parameters(key)
are not known.
Introduction
CRYPTOGRAPHY
Cryptography, derived from Greek words
krptos- secret and graphy- writing.
 It is the science of using mathematics to hide
information.
 With the help of Cryptography we can store sensitive
information, or transmit it over insecure networks
(such as the internet) so that it can only be read by the
intended recipient.
Encryption
Encryption is the process of converting readable data
(called the plaintext) into a form which hides its
content, called the ciphertext.
Decryption
Decryption is the reverse process, with a ciphertext
converted back into the corresponding plaintext.
NOTE:
Cryptography should not be confused with encryption.
The name encryption itself defines the basic difference.
EN-CRYPT: “en” means to make and “crypt or crypto”
means hidden or secret.
Hence, Encryption is a fundamental tool for protection of
information while Cryptography is the method of
transforming the representation of information for secured
transmission of information.
Ciphers
 A cipher is a mathematical function used in the
encryption and decryption processes. Most ciphers use
a secret key when encrypting, and different keys will
typically encrypt a given plaintext into different
ciphertexts.
 The key is usually only known by the person who
encrypts the data, and the intended recipient.The
secrecy of the key ensures that even if an
eavesdropper were to intercept the transmitted data,
they would be unable to decrypt it.
In general the security of encrypted data is
dependent on two factors:
1. The strength of the cipher.
2.The secrecy of the key.
Classes Of Cipher
Affine Cipher
Affine Cipher
The affine cipher is a type of monoalphabetic
substitution cipher, wherein each letter in an alphabet is
mapped to its numeric equivalent, encrypted using a
simple mathematical function, and converted back to a
letter.
Each letter is enciphered with the function ,
E(x)=(ax+b) (mod m)
where modulus m is the size of the alphabet and a and b
are the key of the cipher. The value a must be chosen
such that a and m are coprime.
Also, 0 ≤ a < m, and 0 ≤ b < m
The decryption function is:
D(x) = a-1(x-b) mod{m}
Where a-1 is the modular multiplicative inverse of a
modulo m, i.e. it satisfies the equation:
1=aa-1 mod{m}
Special Cases:
The Caesar Cipher is the Affine cipher when since the
encrypting function simply reduces to a linear shift ie.
when a=1.
The Decimation Cipher is the Affine cipher when the
encryption function reduces to (ax)MOD m as the value
of b=0.
Algorithms
Encryption :
 The value of the appropriate key (ie. Fulfilling the condition of
the affine cipher), and the plaintext in devanagri is asked from
the user.
 The characters from plaintext are mapped according to the
encryption function.The mapped characters are then printed
in the encrypted file using FileUtils class (provided by Apache).
Decryption :
 The values of a & b for the decryption function, and the
encrypted file are asked from the user.
 The pre-image of the characters is hence found and printed in
the decrypted file using FileUtils class( as done in Encryption).
Algorithms
Key Calculation :
Take any two random characters (x1,x2) from plaintext and the
corresponding mapped characters(y1,y2) from ciphertext.
CASE- 1: SOLVING THE SYSTEM OF LINEAR EQUATIONS
(x1, x2 has both odd and even unicodes )
I. Form the equations in terms of a & b by substituting the values of
x & y in the encryption function.
II. We have 2 variables and 2 equations. Solving the equations, we
get the values of a & b.
CASE - 2 BRUTE FORCE
(when both x1 and x2 have even OR odd unicodes only)
I. For all possible values of a( ie. All the co-primes of m less than the
value of m), we check for all the values of b, satisfying the
encryption function.
II. Then this encryption function is checked for the rest of the file text.
If it matches with the rest of the file, the values for a & b are
returned.
III. Otherwise the value of a & b are discarded and the steps I and II are
repeated again and again till the time a consistent value of
key(that matches the key of the rest of the file) is not found.
Note: In this case, more than 1 unique solution is possible.
Time-Complexity
 Encryption: O(n)
 Decryption: O(n)
 Key Calculation:
* Best Case: O(n)/O(1)cz it is not not dependent on the file
size now
*Worst Case: O(m2n)
where m = 128,
n = no. of characters in original
file
Space-Complexity
 Encryption: O(1)
 Decryption: O(1)
 Key Calculation: O(n)
where n = no. of characters in original file
SystemRequirements
SOFTWARE REQUIREMENTS
 Java Development Kit 1.6 (jdk 1.6) or more
 Java Runtime Environment
 Platform (IDE) (for running source code):
NetBeans IDE 7.0.1
MEMORY REQUIREMENTS
 Software: 500 KB
 Implementation Software and Platform: 1 GB
Conclusion
 The key of the affine cipher can be uniquely
found with just 2 characters from the plaintext
and the corresponding mapped characters from
the ciphertext provided the characters have odd
and even unicodes.
 But if unicodes of both the characters are even or
odd(which is somewhat a rare case), we need to
compare the different combinations of key with
the rest of the text to obtain single unique key
for the entire text.
References
Websites:
 http://en.wikipedia.org/wiki/Affine_cipher
 http://www.johndcook.com/blog/2008/12/10/solving
-linear-congruences/
 http://www.math.sunysb.edu/~scott/Book331/Affine
_enciphering.html
 http://www.engineersgarage.com/articles/what-is-
cryptography-encryption?page=1
 http://www.javaranch.com
 http://cryptointro.wordpress.com

More Related Content

What's hot

Network Security and Cryptography
Network Security and CryptographyNetwork Security and Cryptography
Network Security and CryptographyAdam Reagan
 
Encryption presentation final
Encryption presentation finalEncryption presentation final
Encryption presentation finaladrigee12
 
Intro to modern cryptography
Intro to modern cryptographyIntro to modern cryptography
Intro to modern cryptographyzahid-mian
 
Cryptography and network security
Cryptography and network securityCryptography and network security
Cryptography and network securitypatisa
 
Introduction to Cryptography
Introduction to CryptographyIntroduction to Cryptography
Introduction to CryptographySeema Goel
 
Cryptography and applications
Cryptography and applicationsCryptography and applications
Cryptography and applicationsthai
 
Cryptography
CryptographyCryptography
Cryptographyherrberk
 
Information Security Cryptography ( L02- Types Cryptography)
Information Security Cryptography ( L02- Types Cryptography)Information Security Cryptography ( L02- Types Cryptography)
Information Security Cryptography ( L02- Types Cryptography)Anas Rock
 
Information and network security 31 public key cryptography
Information and network security 31 public key cryptographyInformation and network security 31 public key cryptography
Information and network security 31 public key cryptographyVaibhav Khanna
 
cryptography ppt free download
cryptography ppt free downloadcryptography ppt free download
cryptography ppt free downloadTwinkal Harsora
 
Cryptography and network security
Cryptography and network securityCryptography and network security
Cryptography and network securityNagendra Um
 
Hybrid Cryptography with examples in Ruby and Go
Hybrid Cryptography with examples in Ruby and GoHybrid Cryptography with examples in Ruby and Go
Hybrid Cryptography with examples in Ruby and GoEleanor McHugh
 

What's hot (20)

Network Security and Cryptography
Network Security and CryptographyNetwork Security and Cryptography
Network Security and Cryptography
 
Data encryption
Data encryptionData encryption
Data encryption
 
Encryption presentation final
Encryption presentation finalEncryption presentation final
Encryption presentation final
 
Hybrid encryption ppt
Hybrid encryption pptHybrid encryption ppt
Hybrid encryption ppt
 
Cryptography
CryptographyCryptography
Cryptography
 
Intro to modern cryptography
Intro to modern cryptographyIntro to modern cryptography
Intro to modern cryptography
 
Cryptography.ppt
Cryptography.pptCryptography.ppt
Cryptography.ppt
 
Cryptography and network security
Cryptography and network securityCryptography and network security
Cryptography and network security
 
Introduction to Cryptography
Introduction to CryptographyIntroduction to Cryptography
Introduction to Cryptography
 
Cryptography and applications
Cryptography and applicationsCryptography and applications
Cryptography and applications
 
Cryptography
CryptographyCryptography
Cryptography
 
Cryptography
CryptographyCryptography
Cryptography
 
Information Security Cryptography ( L02- Types Cryptography)
Information Security Cryptography ( L02- Types Cryptography)Information Security Cryptography ( L02- Types Cryptography)
Information Security Cryptography ( L02- Types Cryptography)
 
Information and network security 31 public key cryptography
Information and network security 31 public key cryptographyInformation and network security 31 public key cryptography
Information and network security 31 public key cryptography
 
cryptography ppt free download
cryptography ppt free downloadcryptography ppt free download
cryptography ppt free download
 
Cryptography and network security
Cryptography and network securityCryptography and network security
Cryptography and network security
 
Hybrid Cryptography with examples in Ruby and Go
Hybrid Cryptography with examples in Ruby and GoHybrid Cryptography with examples in Ruby and Go
Hybrid Cryptography with examples in Ruby and Go
 
Cryptography
CryptographyCryptography
Cryptography
 
Itt project
Itt projectItt project
Itt project
 
Cryptography
CryptographyCryptography
Cryptography
 

Viewers also liked

basic encryption and decryption
 basic encryption and decryption basic encryption and decryption
basic encryption and decryptionRashmi Burugupalli
 
Information Security Cryptography ( L03- Old Cryptography Algorithms )
Information Security Cryptography ( L03- Old Cryptography Algorithms )Information Security Cryptography ( L03- Old Cryptography Algorithms )
Information Security Cryptography ( L03- Old Cryptography Algorithms )Anas Rock
 
5 Cryptography Part1
5 Cryptography Part15 Cryptography Part1
5 Cryptography Part1Alfred Ouyang
 
Copyright (presentation)
Copyright (presentation)Copyright (presentation)
Copyright (presentation)Gagan Varshney
 
Image encryption and decryption
Image encryption and decryptionImage encryption and decryption
Image encryption and decryptionAashish R
 
Cryptography.ppt
Cryptography.pptCryptography.ppt
Cryptography.pptUday Meena
 

Viewers also liked (13)

basic encryption and decryption
 basic encryption and decryption basic encryption and decryption
basic encryption and decryption
 
Information Security Cryptography ( L03- Old Cryptography Algorithms )
Information Security Cryptography ( L03- Old Cryptography Algorithms )Information Security Cryptography ( L03- Old Cryptography Algorithms )
Information Security Cryptography ( L03- Old Cryptography Algorithms )
 
Md5
Md5Md5
Md5
 
5 Cryptography Part1
5 Cryptography Part15 Cryptography Part1
5 Cryptography Part1
 
Copyright in india
Copyright in indiaCopyright in india
Copyright in india
 
Encryption
EncryptionEncryption
Encryption
 
Copyright (presentation)
Copyright (presentation)Copyright (presentation)
Copyright (presentation)
 
Image encryption and decryption
Image encryption and decryptionImage encryption and decryption
Image encryption and decryption
 
cryptography
cryptographycryptography
cryptography
 
Cryptography
CryptographyCryptography
Cryptography
 
Cryptography.ppt
Cryptography.pptCryptography.ppt
Cryptography.ppt
 
Copyright Act 1957
Copyright Act 1957Copyright Act 1957
Copyright Act 1957
 
Cryptography
CryptographyCryptography
Cryptography
 

Similar to Encryption/Decryption Algorithm for Devanagri Script(Affine Cipher)

Presentation on Cryptography_Based on IEEE_Paper
Presentation on Cryptography_Based on IEEE_PaperPresentation on Cryptography_Based on IEEE_Paper
Presentation on Cryptography_Based on IEEE_PaperNithin Cv
 
Generate an Encryption Key by using Biometric Cryptosystems to secure transfe...
Generate an Encryption Key by using Biometric Cryptosystems to secure transfe...Generate an Encryption Key by using Biometric Cryptosystems to secure transfe...
Generate an Encryption Key by using Biometric Cryptosystems to secure transfe...IOSR Journals
 
White Paper on Cryptography
White Paper on Cryptography White Paper on Cryptography
White Paper on Cryptography Durgesh Malviya
 
An Advance Approach of Image Encryption using AES, Genetic Algorithm and RSA ...
An Advance Approach of Image Encryption using AES, Genetic Algorithm and RSA ...An Advance Approach of Image Encryption using AES, Genetic Algorithm and RSA ...
An Advance Approach of Image Encryption using AES, Genetic Algorithm and RSA ...IJEACS
 
Vtu network security(10 ec832) unit 2 notes..
Vtu network security(10 ec832) unit 2 notes..Vtu network security(10 ec832) unit 2 notes..
Vtu network security(10 ec832) unit 2 notes..Jayanth Dwijesh H P
 
Analysis of Cryptographic Algorithms
Analysis of Cryptographic AlgorithmsAnalysis of Cryptographic Algorithms
Analysis of Cryptographic Algorithmsijsrd.com
 
Survey on asymmetric key cryptography algorithms
Survey on asymmetric key cryptography algorithmsSurvey on asymmetric key cryptography algorithms
Survey on asymmetric key cryptography algorithmsEditor Jacotech
 
Ch12 Encryption
Ch12 EncryptionCh12 Encryption
Ch12 Encryptionphanleson
 
A survey on Fully Homomorphic Encryption
A survey on Fully Homomorphic EncryptionA survey on Fully Homomorphic Encryption
A survey on Fully Homomorphic Encryptioniosrjce
 
Combined Implementation of Robust Cryptosystem for Non-invertible Matrices ba...
Combined Implementation of Robust Cryptosystem for Non-invertible Matrices ba...Combined Implementation of Robust Cryptosystem for Non-invertible Matrices ba...
Combined Implementation of Robust Cryptosystem for Non-invertible Matrices ba...IDES Editor
 
Jaimin chp-8 - network security-new -use this - 2011 batch
Jaimin   chp-8 - network security-new -use this -  2011 batchJaimin   chp-8 - network security-new -use this -  2011 batch
Jaimin chp-8 - network security-new -use this - 2011 batchJaimin Jani
 

Similar to Encryption/Decryption Algorithm for Devanagri Script(Affine Cipher) (20)

D017433134
D017433134D017433134
D017433134
 
Presentation on Cryptography_Based on IEEE_Paper
Presentation on Cryptography_Based on IEEE_PaperPresentation on Cryptography_Based on IEEE_Paper
Presentation on Cryptography_Based on IEEE_Paper
 
Nwc rsa
Nwc rsaNwc rsa
Nwc rsa
 
Ch34508510
Ch34508510Ch34508510
Ch34508510
 
Generate an Encryption Key by using Biometric Cryptosystems to secure transfe...
Generate an Encryption Key by using Biometric Cryptosystems to secure transfe...Generate an Encryption Key by using Biometric Cryptosystems to secure transfe...
Generate an Encryption Key by using Biometric Cryptosystems to secure transfe...
 
White Paper on Cryptography
White Paper on Cryptography White Paper on Cryptography
White Paper on Cryptography
 
Unit 3(1)
Unit 3(1)Unit 3(1)
Unit 3(1)
 
An Advance Approach of Image Encryption using AES, Genetic Algorithm and RSA ...
An Advance Approach of Image Encryption using AES, Genetic Algorithm and RSA ...An Advance Approach of Image Encryption using AES, Genetic Algorithm and RSA ...
An Advance Approach of Image Encryption using AES, Genetic Algorithm and RSA ...
 
Vtu network security(10 ec832) unit 2 notes..
Vtu network security(10 ec832) unit 2 notes..Vtu network security(10 ec832) unit 2 notes..
Vtu network security(10 ec832) unit 2 notes..
 
Kleptography
KleptographyKleptography
Kleptography
 
Analysis of Cryptographic Algorithms
Analysis of Cryptographic AlgorithmsAnalysis of Cryptographic Algorithms
Analysis of Cryptographic Algorithms
 
Introduction to cryptography
Introduction to cryptographyIntroduction to cryptography
Introduction to cryptography
 
Unit 3(1)
Unit 3(1)Unit 3(1)
Unit 3(1)
 
Survey on asymmetric key cryptography algorithms
Survey on asymmetric key cryptography algorithmsSurvey on asymmetric key cryptography algorithms
Survey on asymmetric key cryptography algorithms
 
Ch12 Encryption
Ch12 EncryptionCh12 Encryption
Ch12 Encryption
 
A survey on Fully Homomorphic Encryption
A survey on Fully Homomorphic EncryptionA survey on Fully Homomorphic Encryption
A survey on Fully Homomorphic Encryption
 
B017631014
B017631014B017631014
B017631014
 
Chapter 15 - Security
Chapter 15 - SecurityChapter 15 - Security
Chapter 15 - Security
 
Combined Implementation of Robust Cryptosystem for Non-invertible Matrices ba...
Combined Implementation of Robust Cryptosystem for Non-invertible Matrices ba...Combined Implementation of Robust Cryptosystem for Non-invertible Matrices ba...
Combined Implementation of Robust Cryptosystem for Non-invertible Matrices ba...
 
Jaimin chp-8 - network security-new -use this - 2011 batch
Jaimin   chp-8 - network security-new -use this -  2011 batchJaimin   chp-8 - network security-new -use this -  2011 batch
Jaimin chp-8 - network security-new -use this - 2011 batch
 

Recently uploaded

Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
cybersecurity notes for mca students for learning
cybersecurity notes for mca students for learningcybersecurity notes for mca students for learning
cybersecurity notes for mca students for learningVitsRangannavar
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - InfographicHr365.us smith
 
buds n tech IT solutions
buds n  tech IT                solutionsbuds n  tech IT                solutions
buds n tech IT solutionsmonugehlot87
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Andreas Granig
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmSujith Sukumaran
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样umasea
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfPower Karaoke
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
What are the features of Vehicle Tracking System?
What are the features of Vehicle Tracking System?What are the features of Vehicle Tracking System?
What are the features of Vehicle Tracking System?Watsoo Telematics
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...aditisharan08
 

Recently uploaded (20)

Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
cybersecurity notes for mca students for learning
cybersecurity notes for mca students for learningcybersecurity notes for mca students for learning
cybersecurity notes for mca students for learning
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - Infographic
 
buds n tech IT solutions
buds n  tech IT                solutionsbuds n  tech IT                solutions
buds n tech IT solutions
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalm
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdf
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
What are the features of Vehicle Tracking System?
What are the features of Vehicle Tracking System?What are the features of Vehicle Tracking System?
What are the features of Vehicle Tracking System?
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...
 

Encryption/Decryption Algorithm for Devanagri Script(Affine Cipher)

  • 1. ENCRYPTION-DECRYPTION of Devanagri Script Using Affine Cipher Team : Astha Goel Harshit Bhatia Mohit Singhal Prachi Gupta Swati Nagpal Deen Dayal Upadhaya College
  • 2. Objective To design and implement an Encryption/Decryption scheme based on affine cipher for plain text in Devanagri(Unicode) communicating message in Hindi. Also, to develop a solver which solves the crypt when the encryption parameters(key) are not known.
  • 3. Introduction CRYPTOGRAPHY Cryptography, derived from Greek words krptos- secret and graphy- writing.  It is the science of using mathematics to hide information.  With the help of Cryptography we can store sensitive information, or transmit it over insecure networks (such as the internet) so that it can only be read by the intended recipient.
  • 4. Encryption Encryption is the process of converting readable data (called the plaintext) into a form which hides its content, called the ciphertext. Decryption Decryption is the reverse process, with a ciphertext converted back into the corresponding plaintext.
  • 5. NOTE: Cryptography should not be confused with encryption. The name encryption itself defines the basic difference. EN-CRYPT: “en” means to make and “crypt or crypto” means hidden or secret. Hence, Encryption is a fundamental tool for protection of information while Cryptography is the method of transforming the representation of information for secured transmission of information.
  • 6. Ciphers  A cipher is a mathematical function used in the encryption and decryption processes. Most ciphers use a secret key when encrypting, and different keys will typically encrypt a given plaintext into different ciphertexts.  The key is usually only known by the person who encrypts the data, and the intended recipient.The secrecy of the key ensures that even if an eavesdropper were to intercept the transmitted data, they would be unable to decrypt it.
  • 7. In general the security of encrypted data is dependent on two factors: 1. The strength of the cipher. 2.The secrecy of the key.
  • 9. Affine Cipher The affine cipher is a type of monoalphabetic substitution cipher, wherein each letter in an alphabet is mapped to its numeric equivalent, encrypted using a simple mathematical function, and converted back to a letter. Each letter is enciphered with the function , E(x)=(ax+b) (mod m) where modulus m is the size of the alphabet and a and b are the key of the cipher. The value a must be chosen such that a and m are coprime. Also, 0 ≤ a < m, and 0 ≤ b < m
  • 10. The decryption function is: D(x) = a-1(x-b) mod{m} Where a-1 is the modular multiplicative inverse of a modulo m, i.e. it satisfies the equation: 1=aa-1 mod{m} Special Cases: The Caesar Cipher is the Affine cipher when since the encrypting function simply reduces to a linear shift ie. when a=1. The Decimation Cipher is the Affine cipher when the encryption function reduces to (ax)MOD m as the value of b=0.
  • 11. Algorithms Encryption :  The value of the appropriate key (ie. Fulfilling the condition of the affine cipher), and the plaintext in devanagri is asked from the user.  The characters from plaintext are mapped according to the encryption function.The mapped characters are then printed in the encrypted file using FileUtils class (provided by Apache). Decryption :  The values of a & b for the decryption function, and the encrypted file are asked from the user.  The pre-image of the characters is hence found and printed in the decrypted file using FileUtils class( as done in Encryption).
  • 12. Algorithms Key Calculation : Take any two random characters (x1,x2) from plaintext and the corresponding mapped characters(y1,y2) from ciphertext. CASE- 1: SOLVING THE SYSTEM OF LINEAR EQUATIONS (x1, x2 has both odd and even unicodes ) I. Form the equations in terms of a & b by substituting the values of x & y in the encryption function. II. We have 2 variables and 2 equations. Solving the equations, we get the values of a & b.
  • 13. CASE - 2 BRUTE FORCE (when both x1 and x2 have even OR odd unicodes only) I. For all possible values of a( ie. All the co-primes of m less than the value of m), we check for all the values of b, satisfying the encryption function. II. Then this encryption function is checked for the rest of the file text. If it matches with the rest of the file, the values for a & b are returned. III. Otherwise the value of a & b are discarded and the steps I and II are repeated again and again till the time a consistent value of key(that matches the key of the rest of the file) is not found. Note: In this case, more than 1 unique solution is possible.
  • 14. Time-Complexity  Encryption: O(n)  Decryption: O(n)  Key Calculation: * Best Case: O(n)/O(1)cz it is not not dependent on the file size now *Worst Case: O(m2n) where m = 128, n = no. of characters in original file
  • 15. Space-Complexity  Encryption: O(1)  Decryption: O(1)  Key Calculation: O(n) where n = no. of characters in original file
  • 16. SystemRequirements SOFTWARE REQUIREMENTS  Java Development Kit 1.6 (jdk 1.6) or more  Java Runtime Environment  Platform (IDE) (for running source code): NetBeans IDE 7.0.1 MEMORY REQUIREMENTS  Software: 500 KB  Implementation Software and Platform: 1 GB
  • 17. Conclusion  The key of the affine cipher can be uniquely found with just 2 characters from the plaintext and the corresponding mapped characters from the ciphertext provided the characters have odd and even unicodes.  But if unicodes of both the characters are even or odd(which is somewhat a rare case), we need to compare the different combinations of key with the rest of the text to obtain single unique key for the entire text.
  • 18. References Websites:  http://en.wikipedia.org/wiki/Affine_cipher  http://www.johndcook.com/blog/2008/12/10/solving -linear-congruences/  http://www.math.sunysb.edu/~scott/Book331/Affine _enciphering.html  http://www.engineersgarage.com/articles/what-is- cryptography-encryption?page=1  http://www.javaranch.com  http://cryptointro.wordpress.com