SlideShare a Scribd company logo
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
Ad

More Related Content

What's hot (20)

Network Security and Cryptography
Network Security and CryptographyNetwork Security and Cryptography
Network Security and Cryptography
Adam Reagan
 
Data encryption
Data encryptionData encryption
Data encryption
Deepam Goyal
 
Encryption presentation final
Encryption presentation finalEncryption presentation final
Encryption presentation final
adrigee12
 
Hybrid encryption ppt
Hybrid encryption pptHybrid encryption ppt
Hybrid encryption ppt
prashantdahake
 
Cryptography
CryptographyCryptography
Cryptography
Rutuja Solkar
 
Intro to modern cryptography
Intro to modern cryptographyIntro to modern cryptography
Intro to modern cryptography
zahid-mian
 
Cryptography.ppt
Cryptography.pptCryptography.ppt
Cryptography.ppt
kusum sharma
 
Cryptography and network security
Cryptography and network securityCryptography and network security
Cryptography and network security
patisa
 
Introduction to Cryptography
Introduction to CryptographyIntroduction to Cryptography
Introduction to Cryptography
Seema Goel
 
Cryptography and applications
Cryptography and applicationsCryptography and applications
Cryptography and applications
thai
 
Cryptography
CryptographyCryptography
Cryptography
Sagar Janagonda
 
Cryptography
CryptographyCryptography
Cryptography
herrberk
 
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 cryptography
Vaibhav Khanna
 
cryptography ppt free download
cryptography ppt free downloadcryptography ppt free download
cryptography ppt free download
Twinkal Harsora
 
Cryptography and network security
Cryptography and network securityCryptography and network security
Cryptography and network security
Nagendra 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 Go
Eleanor McHugh
 
Cryptography
CryptographyCryptography
Cryptography
Shivanand Arur
 
Itt project
Itt projectItt project
Itt project
Harish Kumar
 
Cryptography
CryptographyCryptography
Cryptography
gueste4c97e
 
Network Security and Cryptography
Network Security and CryptographyNetwork Security and Cryptography
Network Security and Cryptography
Adam Reagan
 
Encryption presentation final
Encryption presentation finalEncryption presentation final
Encryption presentation final
adrigee12
 
Intro to modern cryptography
Intro to modern cryptographyIntro to modern cryptography
Intro to modern cryptography
zahid-mian
 
Cryptography and network security
Cryptography and network securityCryptography and network security
Cryptography and network security
patisa
 
Introduction to Cryptography
Introduction to CryptographyIntroduction to Cryptography
Introduction to Cryptography
Seema Goel
 
Cryptography and applications
Cryptography and applicationsCryptography and applications
Cryptography and applications
thai
 
Cryptography
CryptographyCryptography
Cryptography
herrberk
 
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 cryptography
Vaibhav Khanna
 
cryptography ppt free download
cryptography ppt free downloadcryptography ppt free download
cryptography ppt free download
Twinkal Harsora
 
Cryptography and network security
Cryptography and network securityCryptography and network security
Cryptography and network security
Nagendra 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 Go
Eleanor McHugh
 

Viewers also liked (13)

basic encryption and decryption
 basic encryption and decryption basic encryption and decryption
basic encryption and decryption
Rashmi 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
 
Md5
Md5Md5
Md5
bkaa09303
 
5 Cryptography Part1
5 Cryptography Part15 Cryptography Part1
5 Cryptography Part1
Alfred Ouyang
 
Copyright in india
Copyright in indiaCopyright in india
Copyright in india
Veeral Bhateja
 
Encryption
EncryptionEncryption
Encryption
Nitin Parbhakar
 
Copyright (presentation)
Copyright (presentation)Copyright (presentation)
Copyright (presentation)
Gagan Varshney
 
Image encryption and decryption
Image encryption and decryptionImage encryption and decryption
Image encryption and decryption
Aashish R
 
cryptography
cryptographycryptography
cryptography
Abhijeet Singh
 
Cryptography
CryptographyCryptography
Cryptography
Darshini Parikh
 
Cryptography.ppt
Cryptography.pptCryptography.ppt
Cryptography.ppt
Uday Meena
 
Copyright Act 1957
Copyright Act 1957Copyright Act 1957
Copyright Act 1957
Dr.Suresh Isave
 
Cryptography
CryptographyCryptography
Cryptography
Sidharth Mohapatra
 
basic encryption and decryption
 basic encryption and decryption basic encryption and decryption
basic encryption and decryption
Rashmi 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 Part1
Alfred 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 decryption
Aashish R
 
Cryptography.ppt
Cryptography.pptCryptography.ppt
Cryptography.ppt
Uday Meena
 
Ad

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

D017433134
D017433134D017433134
D017433134
IOSR Journals
 
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
Nithin Cv
 
Nwc rsa
Nwc rsaNwc rsa
Nwc rsa
anupamnm
 
Ch34508510
Ch34508510Ch34508510
Ch34508510
IJERA Editor
 
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
 
Unit 3(1)
Unit 3(1)Unit 3(1)
Unit 3(1)
Vinod Kumar Gorrepati
 
encryption and decryption ,and its types
encryption and decryption ,and its typesencryption and decryption ,and its types
encryption and decryption ,and its types
josereena1
 
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
 
Kleptography
KleptographyKleptography
Kleptography
Erfan Mallick
 
Analysis of Cryptographic Algorithms
Analysis of Cryptographic AlgorithmsAnalysis of Cryptographic Algorithms
Analysis of Cryptographic Algorithms
ijsrd.com
 
Introduction to cryptography
Introduction to cryptographyIntroduction to cryptography
Introduction to cryptography
Suresh Thammishetty
 
Unit 3(1)
Unit 3(1)Unit 3(1)
Unit 3(1)
Vinod Kumar Gorrepati
 
Survey on asymmetric key cryptography algorithms
Survey on asymmetric key cryptography algorithmsSurvey on asymmetric key cryptography algorithms
Survey on asymmetric key cryptography algorithms
Editor Jacotech
 
Ch12 Encryption
Ch12 EncryptionCh12 Encryption
Ch12 Encryption
phanleson
 
B017631014
B017631014B017631014
B017631014
IOSR Journals
 
A survey on Fully Homomorphic Encryption
A survey on Fully Homomorphic EncryptionA survey on Fully Homomorphic Encryption
A survey on Fully Homomorphic Encryption
iosrjce
 
RSA-Algorithm-in-Modular-Arithmetic11 (1) (1).pptx
RSA-Algorithm-in-Modular-Arithmetic11 (1) (1).pptxRSA-Algorithm-in-Modular-Arithmetic11 (1) (1).pptx
RSA-Algorithm-in-Modular-Arithmetic11 (1) (1).pptx
SiddhanthAlape
 
Chapter 15 - Security
Chapter 15 - SecurityChapter 15 - Security
Chapter 15 - Security
Wayne Jones Jnr
 
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
Nithin 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
 
encryption and decryption ,and its types
encryption and decryption ,and its typesencryption and decryption ,and its types
encryption and decryption ,and its types
josereena1
 
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 Algorithms
ijsrd.com
 
Survey on asymmetric key cryptography algorithms
Survey on asymmetric key cryptography algorithmsSurvey on asymmetric key cryptography algorithms
Survey on asymmetric key cryptography algorithms
Editor Jacotech
 
Ch12 Encryption
Ch12 EncryptionCh12 Encryption
Ch12 Encryption
phanleson
 
A survey on Fully Homomorphic Encryption
A survey on Fully Homomorphic EncryptionA survey on Fully Homomorphic Encryption
A survey on Fully Homomorphic Encryption
iosrjce
 
RSA-Algorithm-in-Modular-Arithmetic11 (1) (1).pptx
RSA-Algorithm-in-Modular-Arithmetic11 (1) (1).pptxRSA-Algorithm-in-Modular-Arithmetic11 (1) (1).pptx
RSA-Algorithm-in-Modular-Arithmetic11 (1) (1).pptx
SiddhanthAlape
 
Ad

Recently uploaded (20)

Best HR and Payroll Software in Bangladesh - accordHRM
Best HR and Payroll Software in Bangladesh - accordHRMBest HR and Payroll Software in Bangladesh - accordHRM
Best HR and Payroll Software in Bangladesh - accordHRM
accordHRM
 
AI in Business Software: Smarter Systems or Hidden Risks?
AI in Business Software: Smarter Systems or Hidden Risks?AI in Business Software: Smarter Systems or Hidden Risks?
AI in Business Software: Smarter Systems or Hidden Risks?
Amara Nielson
 
Adobe InDesign Crack FREE Download 2025 link
Adobe InDesign Crack FREE Download 2025 linkAdobe InDesign Crack FREE Download 2025 link
Adobe InDesign Crack FREE Download 2025 link
mahmadzubair09
 
Robotic Process Automation (RPA) Software Development Services.pptx
Robotic Process Automation (RPA) Software Development Services.pptxRobotic Process Automation (RPA) Software Development Services.pptx
Robotic Process Automation (RPA) Software Development Services.pptx
julia smits
 
The-Future-is-Hybrid-Exploring-Azure’s-Role-in-Multi-Cloud-Strategies.pptx
The-Future-is-Hybrid-Exploring-Azure’s-Role-in-Multi-Cloud-Strategies.pptxThe-Future-is-Hybrid-Exploring-Azure’s-Role-in-Multi-Cloud-Strategies.pptx
The-Future-is-Hybrid-Exploring-Azure’s-Role-in-Multi-Cloud-Strategies.pptx
james brownuae
 
Digital Twins Software Service in Belfast
Digital Twins Software Service in BelfastDigital Twins Software Service in Belfast
Digital Twins Software Service in Belfast
julia smits
 
Autodesk Inventor Crack (2025) Latest
Autodesk Inventor    Crack (2025) LatestAutodesk Inventor    Crack (2025) Latest
Autodesk Inventor Crack (2025) Latest
Google
 
Passive House Canada Conference 2025 Presentation [Final]_v4.ppt
Passive House Canada Conference 2025 Presentation [Final]_v4.pptPassive House Canada Conference 2025 Presentation [Final]_v4.ppt
Passive House Canada Conference 2025 Presentation [Final]_v4.ppt
IES VE
 
From Vibe Coding to Vibe Testing - Complete PowerPoint Presentation
From Vibe Coding to Vibe Testing - Complete PowerPoint PresentationFrom Vibe Coding to Vibe Testing - Complete PowerPoint Presentation
From Vibe Coding to Vibe Testing - Complete PowerPoint Presentation
Shay Ginsbourg
 
Solar-wind hybrid engery a system sustainable power
Solar-wind  hybrid engery a system sustainable powerSolar-wind  hybrid engery a system sustainable power
Solar-wind hybrid engery a system sustainable power
bhoomigowda12345
 
Wilcom Embroidery Studio Crack 2025 For Windows
Wilcom Embroidery Studio Crack 2025 For WindowsWilcom Embroidery Studio Crack 2025 For Windows
Wilcom Embroidery Studio Crack 2025 For Windows
Google
 
Mastering Selenium WebDriver: A Comprehensive Tutorial with Real-World Examples
Mastering Selenium WebDriver: A Comprehensive Tutorial with Real-World ExamplesMastering Selenium WebDriver: A Comprehensive Tutorial with Real-World Examples
Mastering Selenium WebDriver: A Comprehensive Tutorial with Real-World Examples
jamescantor38
 
Tools of the Trade: Linux and SQL - Google Certificate
Tools of the Trade: Linux and SQL - Google CertificateTools of the Trade: Linux and SQL - Google Certificate
Tools of the Trade: Linux and SQL - Google Certificate
VICTOR MAESTRE RAMIREZ
 
sequencediagrams.pptx software Engineering
sequencediagrams.pptx software Engineeringsequencediagrams.pptx software Engineering
sequencediagrams.pptx software Engineering
aashrithakondapalli8
 
Orion Context Broker introduction 20250509
Orion Context Broker introduction 20250509Orion Context Broker introduction 20250509
Orion Context Broker introduction 20250509
Fermin Galan
 
A Comprehensive Guide to CRM Software Benefits for Every Business Stage
A Comprehensive Guide to CRM Software Benefits for Every Business StageA Comprehensive Guide to CRM Software Benefits for Every Business Stage
A Comprehensive Guide to CRM Software Benefits for Every Business Stage
SynapseIndia
 
Wilcom Embroidery Studio Crack Free Latest 2025
Wilcom Embroidery Studio Crack Free Latest 2025Wilcom Embroidery Studio Crack Free Latest 2025
Wilcom Embroidery Studio Crack Free Latest 2025
Web Designer
 
Download MathType Crack Version 2025???
Download MathType Crack  Version 2025???Download MathType Crack  Version 2025???
Download MathType Crack Version 2025???
Google
 
Meet the New Kid in the Sandbox - Integrating Visualization with Prometheus
Meet the New Kid in the Sandbox - Integrating Visualization with PrometheusMeet the New Kid in the Sandbox - Integrating Visualization with Prometheus
Meet the New Kid in the Sandbox - Integrating Visualization with Prometheus
Eric D. Schabell
 
Top 12 Most Useful AngularJS Development Tools to Use in 2025
Top 12 Most Useful AngularJS Development Tools to Use in 2025Top 12 Most Useful AngularJS Development Tools to Use in 2025
Top 12 Most Useful AngularJS Development Tools to Use in 2025
GrapesTech Solutions
 
Best HR and Payroll Software in Bangladesh - accordHRM
Best HR and Payroll Software in Bangladesh - accordHRMBest HR and Payroll Software in Bangladesh - accordHRM
Best HR and Payroll Software in Bangladesh - accordHRM
accordHRM
 
AI in Business Software: Smarter Systems or Hidden Risks?
AI in Business Software: Smarter Systems or Hidden Risks?AI in Business Software: Smarter Systems or Hidden Risks?
AI in Business Software: Smarter Systems or Hidden Risks?
Amara Nielson
 
Adobe InDesign Crack FREE Download 2025 link
Adobe InDesign Crack FREE Download 2025 linkAdobe InDesign Crack FREE Download 2025 link
Adobe InDesign Crack FREE Download 2025 link
mahmadzubair09
 
Robotic Process Automation (RPA) Software Development Services.pptx
Robotic Process Automation (RPA) Software Development Services.pptxRobotic Process Automation (RPA) Software Development Services.pptx
Robotic Process Automation (RPA) Software Development Services.pptx
julia smits
 
The-Future-is-Hybrid-Exploring-Azure’s-Role-in-Multi-Cloud-Strategies.pptx
The-Future-is-Hybrid-Exploring-Azure’s-Role-in-Multi-Cloud-Strategies.pptxThe-Future-is-Hybrid-Exploring-Azure’s-Role-in-Multi-Cloud-Strategies.pptx
The-Future-is-Hybrid-Exploring-Azure’s-Role-in-Multi-Cloud-Strategies.pptx
james brownuae
 
Digital Twins Software Service in Belfast
Digital Twins Software Service in BelfastDigital Twins Software Service in Belfast
Digital Twins Software Service in Belfast
julia smits
 
Autodesk Inventor Crack (2025) Latest
Autodesk Inventor    Crack (2025) LatestAutodesk Inventor    Crack (2025) Latest
Autodesk Inventor Crack (2025) Latest
Google
 
Passive House Canada Conference 2025 Presentation [Final]_v4.ppt
Passive House Canada Conference 2025 Presentation [Final]_v4.pptPassive House Canada Conference 2025 Presentation [Final]_v4.ppt
Passive House Canada Conference 2025 Presentation [Final]_v4.ppt
IES VE
 
From Vibe Coding to Vibe Testing - Complete PowerPoint Presentation
From Vibe Coding to Vibe Testing - Complete PowerPoint PresentationFrom Vibe Coding to Vibe Testing - Complete PowerPoint Presentation
From Vibe Coding to Vibe Testing - Complete PowerPoint Presentation
Shay Ginsbourg
 
Solar-wind hybrid engery a system sustainable power
Solar-wind  hybrid engery a system sustainable powerSolar-wind  hybrid engery a system sustainable power
Solar-wind hybrid engery a system sustainable power
bhoomigowda12345
 
Wilcom Embroidery Studio Crack 2025 For Windows
Wilcom Embroidery Studio Crack 2025 For WindowsWilcom Embroidery Studio Crack 2025 For Windows
Wilcom Embroidery Studio Crack 2025 For Windows
Google
 
Mastering Selenium WebDriver: A Comprehensive Tutorial with Real-World Examples
Mastering Selenium WebDriver: A Comprehensive Tutorial with Real-World ExamplesMastering Selenium WebDriver: A Comprehensive Tutorial with Real-World Examples
Mastering Selenium WebDriver: A Comprehensive Tutorial with Real-World Examples
jamescantor38
 
Tools of the Trade: Linux and SQL - Google Certificate
Tools of the Trade: Linux and SQL - Google CertificateTools of the Trade: Linux and SQL - Google Certificate
Tools of the Trade: Linux and SQL - Google Certificate
VICTOR MAESTRE RAMIREZ
 
sequencediagrams.pptx software Engineering
sequencediagrams.pptx software Engineeringsequencediagrams.pptx software Engineering
sequencediagrams.pptx software Engineering
aashrithakondapalli8
 
Orion Context Broker introduction 20250509
Orion Context Broker introduction 20250509Orion Context Broker introduction 20250509
Orion Context Broker introduction 20250509
Fermin Galan
 
A Comprehensive Guide to CRM Software Benefits for Every Business Stage
A Comprehensive Guide to CRM Software Benefits for Every Business StageA Comprehensive Guide to CRM Software Benefits for Every Business Stage
A Comprehensive Guide to CRM Software Benefits for Every Business Stage
SynapseIndia
 
Wilcom Embroidery Studio Crack Free Latest 2025
Wilcom Embroidery Studio Crack Free Latest 2025Wilcom Embroidery Studio Crack Free Latest 2025
Wilcom Embroidery Studio Crack Free Latest 2025
Web Designer
 
Download MathType Crack Version 2025???
Download MathType Crack  Version 2025???Download MathType Crack  Version 2025???
Download MathType Crack Version 2025???
Google
 
Meet the New Kid in the Sandbox - Integrating Visualization with Prometheus
Meet the New Kid in the Sandbox - Integrating Visualization with PrometheusMeet the New Kid in the Sandbox - Integrating Visualization with Prometheus
Meet the New Kid in the Sandbox - Integrating Visualization with Prometheus
Eric D. Schabell
 
Top 12 Most Useful AngularJS Development Tools to Use in 2025
Top 12 Most Useful AngularJS Development Tools to Use in 2025Top 12 Most Useful AngularJS Development Tools to Use in 2025
Top 12 Most Useful AngularJS Development Tools to Use in 2025
GrapesTech Solutions
 

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