SlideShare a Scribd company logo
1 of 24
A Fast Implementation of RSA
using GNU MP Library
[Student Paper]
Rajorshi Biswas, Shibdas Bandyopadhyay
Anirban Banerjee
Indian Institute of Information Technology Calcutta
rajorshi_biswas@rediffmail.com
shibdas@rediffmail.com
anir_iiit@yahoo.co.uk
Synopsis
 RSA is the most popular Public Key
Encryption Technique in use today.
 Large numbers are needed for encryption,
hence the need for handling those numbers
efficiently.
 GNU MP is a library designed from scratch
to handle numbers of arbitrary precision.
So, we have used it for implementing RSA.
Keywords
Cryotography, RSA, PKI, GMP
Introduction
 Data protection is becoming more and
more important as the data communication
increases exponentially.
 One way is to encrypt the data stream with
one key which is also used for decryption
(Private key approach). The entire
communication can be decrypted if the key
is known.
Introduction…
 Improvement over this system is Public Key
Infrastructure where one key ( Public Key) is used
to encrypt the data while another key (Private Key)
is used to decrypt it. So, private key is never
exposed.
 RSA is most widely used public key system. RSA
(named after its authors Rivest, Shamir and
Adleman) relies on the factorization problem that
indicates it is quite difficult in today’s aspect to find
two prime numbers whose product is a given large
number.
Introduction…
 As we increase the given number the
possibility for factoring the number
decreases.
 We have used GNU MP arbitrary
precision library to implement RSA
and done a performance analysis by
varying the number of characters
processed together.
RSA Algorithm
 Generate two large distinct primes p
and q randomly
 Calculate n = pq and x = (p-1)(q-1)
 Select a random integer e (1<e<x)
such that gcd(e,x) = 1
 Calculate the unique d such that ed =
1(mod x)
 Public key pair : (e,n), Private key
pair : (d,n)
Implementation
 We have implemented the RSA
cryptosystem in two forms : a console
mode implementation, as well as a user
friendly GUI implementation.
 The console application uses a 1024 bit
modulus RSA implementation, which is
adequate for non-critical applications. By a
simple modification of the source code,
higher bit-strengths may be easily
achieved, with a slight performance hit.
Large numbers & GMP Library
 Any practical implementation of the RSA
cryptosystem would involve working with large
integers (in our case, of 1024 bits or more in
size).
 The GMP library aims to provide the fastest
possible arithmetic for applications that need a
higher precision than the ones directly
supported under C/C++ by using highly
optimized assembly code. Further the GMP
library is a cross-platform library, implying that
our application should work across platforms
with minimal modifications.
Application Overview
 The program is meant for use on a per user
basis where each user's home directory stores
files containing the private and public keys for
the particular user. The application stores the
private and public keys for a user in the files
$HOME/.rsaprivate and $HOME/.rsapublic
respectively.
 The application will generate the keys if they
are not present using random number and
current time as seed.
RSA Key Generation
 The application maintains a constant named
'BITSTRENGTH' which is the size of the RSA
modulus (n) in bits. Two random arrays p and q
are generated.
 At the end of this process, we have strings
containing binary representations of the
numbers p and q, but they are not prime yet.
To achieve that, two gmp integers are first
initialized with the contents of these strings
and mpz_nextprime() is called which changes p
and to the next possible primes.
RSA Key Generation…
 Now that we have the two 512-bit primes p
and q, calculating the values of n (=pq) and x
(=(p-1)*(q-1)) is a simple matter of invoking
mpz_mul() with the proper arguments.
 We then determined ‘e’ such that gcd(e,x)=1
starting from e=65537. Now there exists a
procedure in the gmp library with the prototype
int mpz_invert(mpz_t ROP, mpz_t OP1, mpz_t
OP2) which computes the multiplicative inverse
of OP1 modulo OP2 and puts the result in
ROP. ). In this way, we obtain the value of ‘d’.
RSA Encryption
 The entire file to encrypt is processed as a
group of strings each containing the specified
number of characters (except possibly the last
such string). Each character in such a string is
converted to ASCII code, and the entire
resulting numeric string is our message m.
 Encrypting it is achieved by computing m ^ e
mod n. There is a gmp routine specifically for
such a computation having the prototype void
mpz_powm (mpz_t ROP, mpz_t BASE, mpz_t
EXP, mpz_t MOD) which sets ROP to (BASE
raised to EXP) modulo MOD.
RSA Decryption
 The operation of this routine is really quite
straightforward. From the file to decrypt (the
path to which is input from the user),the
function processes each encrypted integer. It
does so by computing the value of c ^ d mod n
by invoking gmp_powm(m,c,d,n) and stores
the decrypted part in m.
 Here m however contains the integer
representation of the message where each 3
integer sequence signifies the ASCII code of a
particular character. An inverse mapping to the
relevant character is carried out.
Time Analysis
Time Analysis
0
100
200
300
1 25 50 75 100
No. of characters encrypted together
Encryption Time Decryption Time
Overall Analysis
 We have noticed the speed improvements in
key generation and encryption/decryption while
using keys of lower strength.
 Encryption and decryption times decrease
considerably when number of characters
encrypted together increases.
 So, a balance is to be made considering both.
We found out 1024 bit RSA with 100 characters
encrypted together is very efficient in terms of
speed and security.
GUI Implementation
 The GUI application was developed using
KDE/Qt libraries on Red Hat Linux 8.0. We used
KDevelop 2.1 as our integrated development
environment.
 Our application consists of three C++ classes,
of which the class named RSA is the most
important. It provides slots (signal handlers)
for encrypting files, decrypting files, mailing the
encrypted file to another user, loading the
values of the RSA keys from the key-files,
saving encrypted/decrypted files and so on.
Screenshots
 This is the main
dialog of the
RSA GUI.
Screenshots…
 This is the window
showing the keys
generated by the
application.
Screenshots…
 This is the screen
showed for
encryption.
Screenshots…
 User can also mail
the encrypted file.
Screenshots…
 User can decrypt
the encrypted file
using his private
key.
Conclusion
 In this paper an efficient implementation of RSA
is shown by using various functions of the GMP
library. Feasibility analysis is done by comparing
the time taken for encryption and decryption. It
shows that when we increase the number of bits
of information to be encrypted together the total
time including encryption and decryption steadily
decreases. It must always be kept in mind that
the integer representation of the message to be
encrypted should lie within the range specified by
the modulus (that is, m lies in the range [0,n-
1]), which poses a limitation on the maximum
number of characters that can be encrypted at a
single time.
References
 [1] Paul Syversion and Illiano Cervesato, The logic of authentication protocols,
FOSAD’00, Bertinoro, Italy, 2000.
 [2] Dario Catalano, Rosario Gennaro and Shai Halevi, Computing inverse over a
shared secret modulus, IBM T. J. Watson Research center, NY, USA, 1999.
 [3] Don coppersmith, Markus Jakobsson, Almost optimal hash sequence traversal,
RSA Laboratories, NY, 2001.
 [4] Elichiro Fujisaki, Tatsuaki Okamoto, David Pointcheval and Jacques Stern, RSA-
OAEP is secure under the RSA assumption, Journal of Cryptology, 2002.
 [5] Daniel M. Gordon, A survey of fast exponentiation methods, Journal of
algorithms, 27, 1998, 126-146.
 [6] Adrian Perrig, Robet Szewczyk, Victor Wen, David Culler and J.D. Tygar,
SPINS: Security protocols for sensor networks, Mobile Computing and Networking,
Rome, Italy, 2001.
 [7] David Pointcheval and Jacques Stern, Security proofs for signature schemes,
EUROCRYPT ’96, Zaragoza, Spain, 1996.
 [8] Giuseppe Ateniese, Michael Steiner, and Gene Tsudik, New multiparty
authentication services and key agreement protocols, IEEE Journal of Selected Areas
in Communication, 18(4), 2000.
 [9] Cetin Kaya Koc, High speed RSA implementation, RSA Laboratories, CA, 1994.
 [10] Anand Krishnamurthy, Yiyan Tang, Cathy Xu and Yuke Wang, An efficient
implementation of multi-prime RSA on DSP processor, University of Texas,
Texas, USA,2002.
 [11] Handbook of Applied Cryptography, A. Menezes, P. Van Oorschot, S. Vanstone,
CRC Press, 1996 ( www.cacr.math.uwaterloo.ca/hac )

More Related Content

What's hot

A Comparative Study between RSA and MD5 algorithms
A Comparative Study between RSA and MD5 algorithms A Comparative Study between RSA and MD5 algorithms
A Comparative Study between RSA and MD5 algorithms Er Piyush Gupta IN ⊞⌘
 
Digital Signature Recognition using RSA Algorithm
Digital Signature Recognition using RSA AlgorithmDigital Signature Recognition using RSA Algorithm
Digital Signature Recognition using RSA AlgorithmVinayak Raja
 
Advanced Encryption Standard (AES) Implementaion using Java
Advanced Encryption Standard (AES) Implementaion using JavaAdvanced Encryption Standard (AES) Implementaion using Java
Advanced Encryption Standard (AES) Implementaion using JavaSunil Kumar R
 
Survey of Hybrid Encryption Algorithm for Mobile Communication
Survey of Hybrid Encryption Algorithm for Mobile CommunicationSurvey of Hybrid Encryption Algorithm for Mobile Communication
Survey of Hybrid Encryption Algorithm for Mobile Communicationijsrd.com
 
An Enhanced Encryption Technique using BCD and Bit Complementation
An Enhanced Encryption Technique using BCD and Bit ComplementationAn Enhanced Encryption Technique using BCD and Bit Complementation
An Enhanced Encryption Technique using BCD and Bit ComplementationIRJET Journal
 
Network Security and Cryptography
Network Security and CryptographyNetwork Security and Cryptography
Network Security and CryptographyAdam Reagan
 
Hash Function & Analysis
Hash Function & AnalysisHash Function & Analysis
Hash Function & AnalysisPawandeep Kaur
 

What's hot (16)

Ch34508510
Ch34508510Ch34508510
Ch34508510
 
A Comparative Study between RSA and MD5 algorithms
A Comparative Study between RSA and MD5 algorithms A Comparative Study between RSA and MD5 algorithms
A Comparative Study between RSA and MD5 algorithms
 
encrption.PDF
encrption.PDFencrption.PDF
encrption.PDF
 
Digital Signature Recognition using RSA Algorithm
Digital Signature Recognition using RSA AlgorithmDigital Signature Recognition using RSA Algorithm
Digital Signature Recognition using RSA Algorithm
 
Advanced Encryption Standard (AES) Implementaion using Java
Advanced Encryption Standard (AES) Implementaion using JavaAdvanced Encryption Standard (AES) Implementaion using Java
Advanced Encryption Standard (AES) Implementaion using Java
 
Survey of Hybrid Encryption Algorithm for Mobile Communication
Survey of Hybrid Encryption Algorithm for Mobile CommunicationSurvey of Hybrid Encryption Algorithm for Mobile Communication
Survey of Hybrid Encryption Algorithm for Mobile Communication
 
Ijetcas14 355
Ijetcas14 355Ijetcas14 355
Ijetcas14 355
 
Pgp smime
Pgp smimePgp smime
Pgp smime
 
Is case study
Is   case studyIs   case study
Is case study
 
An Enhanced Encryption Technique using BCD and Bit Complementation
An Enhanced Encryption Technique using BCD and Bit ComplementationAn Enhanced Encryption Technique using BCD and Bit Complementation
An Enhanced Encryption Technique using BCD and Bit Complementation
 
Hash crypto
Hash cryptoHash crypto
Hash crypto
 
Hybrid AES DES
Hybrid AES DESHybrid AES DES
Hybrid AES DES
 
6.hash mac
6.hash mac6.hash mac
6.hash mac
 
Network Security and Cryptography
Network Security and CryptographyNetwork Security and Cryptography
Network Security and Cryptography
 
Hybrid encryption
Hybrid encryption Hybrid encryption
Hybrid encryption
 
Hash Function & Analysis
Hash Function & AnalysisHash Function & Analysis
Hash Function & Analysis
 

Viewers also liked (18)

It strategy cfc company -hungtq v1.0
It strategy cfc company -hungtq v1.0It strategy cfc company -hungtq v1.0
It strategy cfc company -hungtq v1.0
 
Loyax Consolidated Loyalty Platform General Presentation
Loyax Consolidated Loyalty Platform General PresentationLoyax Consolidated Loyalty Platform General Presentation
Loyax Consolidated Loyalty Platform General Presentation
 
Hpb
HpbHpb
Hpb
 
Live A Life That Matters
Live A Life That MattersLive A Life That Matters
Live A Life That Matters
 
Vulnerability of PWID
Vulnerability of PWIDVulnerability of PWID
Vulnerability of PWID
 
Bm assaigm jan 2014
Bm assaigm jan 2014Bm assaigm jan 2014
Bm assaigm jan 2014
 
Loyax shopping centers
Loyax shopping centersLoyax shopping centers
Loyax shopping centers
 
Paragraphwriitngchinhqui 120517213551-phpapp01
Paragraphwriitngchinhqui 120517213551-phpapp01Paragraphwriitngchinhqui 120517213551-phpapp01
Paragraphwriitngchinhqui 120517213551-phpapp01
 
Ipa sem 2 kls 7 (religia)
Ipa sem 2 kls 7 (religia)Ipa sem 2 kls 7 (religia)
Ipa sem 2 kls 7 (religia)
 
Sistem ekskresi
Sistem ekskresiSistem ekskresi
Sistem ekskresi
 
Latihan mid semester gasal kelas viii
Latihan mid semester gasal kelas viiiLatihan mid semester gasal kelas viii
Latihan mid semester gasal kelas viii
 
Wi max and military applications
Wi max and military applicationsWi max and military applications
Wi max and military applications
 
Paragraphwriitngchinhqui 120517213551-phpapp01
Paragraphwriitngchinhqui 120517213551-phpapp01Paragraphwriitngchinhqui 120517213551-phpapp01
Paragraphwriitngchinhqui 120517213551-phpapp01
 
Issues of Wireless Sensor Networks
Issues of Wireless Sensor NetworksIssues of Wireless Sensor Networks
Issues of Wireless Sensor Networks
 
Giao an tin chi
Giao an tin chiGiao an tin chi
Giao an tin chi
 
Evaluasi cahaya dan alat optik kelas 8
Evaluasi cahaya dan alat optik kelas 8Evaluasi cahaya dan alat optik kelas 8
Evaluasi cahaya dan alat optik kelas 8
 
Materi fisika ix listrik
Materi fisika ix listrikMateri fisika ix listrik
Materi fisika ix listrik
 
Metro rail in india
Metro rail in indiaMetro rail in india
Metro rail in india
 

Similar to Nwc rsa

State of the art parallel approaches for
State of the art parallel approaches forState of the art parallel approaches for
State of the art parallel approaches forijcsa
 
Chaotic Rivest-Shamir-Adlerman Algorithm with Data Encryption Standard Schedu...
Chaotic Rivest-Shamir-Adlerman Algorithm with Data Encryption Standard Schedu...Chaotic Rivest-Shamir-Adlerman Algorithm with Data Encryption Standard Schedu...
Chaotic Rivest-Shamir-Adlerman Algorithm with Data Encryption Standard Schedu...journalBEEI
 
Improving Network Security by Modifying RSA Algorithm
Improving Network Security by Modifying RSA AlgorithmImproving Network Security by Modifying RSA Algorithm
Improving Network Security by Modifying RSA Algorithmpaperpublications3
 
Analysis of Cryptographic Algorithms
Analysis of Cryptographic AlgorithmsAnalysis of Cryptographic Algorithms
Analysis of Cryptographic Algorithmsijsrd.com
 
A Modified Technique For Performing Data Encryption & Data Decryption
A Modified Technique For Performing Data Encryption & Data DecryptionA Modified Technique For Performing Data Encryption & Data Decryption
A Modified Technique For Performing Data Encryption & Data DecryptionIJERA Editor
 
A Survey on Generation and Evolution of Various Cryptographic Techniques
A Survey on Generation and Evolution of Various Cryptographic TechniquesA Survey on Generation and Evolution of Various Cryptographic Techniques
A Survey on Generation and Evolution of Various Cryptographic TechniquesIRJET Journal
 
Analysis of rsa algorithm using gpu
Analysis of rsa algorithm using gpuAnalysis of rsa algorithm using gpu
Analysis of rsa algorithm using gpuIJNSA Journal
 
ANALYSIS OF RSA ALGORITHM USING GPU PROGRAMMING
ANALYSIS OF RSA ALGORITHM USING GPU PROGRAMMINGANALYSIS OF RSA ALGORITHM USING GPU PROGRAMMING
ANALYSIS OF RSA ALGORITHM USING GPU PROGRAMMINGIJNSA Journal
 
A NETWORK SECURITY APPROACH USING RSA.
A NETWORK SECURITY APPROACH USING RSA.A NETWORK SECURITY APPROACH USING RSA.
A NETWORK SECURITY APPROACH USING RSA.Tuhin_Das
 
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
 
Dnssec tutorial-crypto-defs
Dnssec tutorial-crypto-defsDnssec tutorial-crypto-defs
Dnssec tutorial-crypto-defsAFRINIC
 
ENHANCED SECURE ALGORITHM FOR MESSAGE COMMUNICATION
ENHANCED SECURE ALGORITHM FOR MESSAGE COMMUNICATIONENHANCED SECURE ALGORITHM FOR MESSAGE COMMUNICATION
ENHANCED SECURE ALGORITHM FOR MESSAGE COMMUNICATIONIJNSA Journal
 
DESIGN AND IMPLEMENTATION OF DATA ENCRYPTION SOFTWARE
DESIGN AND IMPLEMENTATION OF DATA ENCRYPTION SOFTWAREDESIGN AND IMPLEMENTATION OF DATA ENCRYPTION SOFTWARE
DESIGN AND IMPLEMENTATION OF DATA ENCRYPTION SOFTWAREAyanda Demilade
 
A cloud security approach for data at rest
A cloud security approach for data at restA cloud security approach for data at rest
A cloud security approach for data at restijccsa
 
A Cloud Security Approach for Data at Rest Using FPE
A Cloud Security Approach for Data at Rest Using FPE A Cloud Security Approach for Data at Rest Using FPE
A Cloud Security Approach for Data at Rest Using FPE neirew J
 
An Approach on Data Security with the Combination of Symmetric and Asymmetric...
An Approach on Data Security with the Combination of Symmetric and Asymmetric...An Approach on Data Security with the Combination of Symmetric and Asymmetric...
An Approach on Data Security with the Combination of Symmetric and Asymmetric...AnirbanBhowmik8
 

Similar to Nwc rsa (20)

State of the art parallel approaches for
State of the art parallel approaches forState of the art parallel approaches for
State of the art parallel approaches for
 
A New Design of Algorithm for Enhancing Security in Bluetooth Communication w...
A New Design of Algorithm for Enhancing Security in Bluetooth Communication w...A New Design of Algorithm for Enhancing Security in Bluetooth Communication w...
A New Design of Algorithm for Enhancing Security in Bluetooth Communication w...
 
Chaotic Rivest-Shamir-Adlerman Algorithm with Data Encryption Standard Schedu...
Chaotic Rivest-Shamir-Adlerman Algorithm with Data Encryption Standard Schedu...Chaotic Rivest-Shamir-Adlerman Algorithm with Data Encryption Standard Schedu...
Chaotic Rivest-Shamir-Adlerman Algorithm with Data Encryption Standard Schedu...
 
Improving Network Security by Modifying RSA Algorithm
Improving Network Security by Modifying RSA AlgorithmImproving Network Security by Modifying RSA Algorithm
Improving Network Security by Modifying RSA Algorithm
 
Analysis of Cryptographic Algorithms
Analysis of Cryptographic AlgorithmsAnalysis of Cryptographic Algorithms
Analysis of Cryptographic Algorithms
 
A Modified Technique For Performing Data Encryption & Data Decryption
A Modified Technique For Performing Data Encryption & Data DecryptionA Modified Technique For Performing Data Encryption & Data Decryption
A Modified Technique For Performing Data Encryption & Data Decryption
 
H42054550
H42054550H42054550
H42054550
 
A Survey on Generation and Evolution of Various Cryptographic Techniques
A Survey on Generation and Evolution of Various Cryptographic TechniquesA Survey on Generation and Evolution of Various Cryptographic Techniques
A Survey on Generation and Evolution of Various Cryptographic Techniques
 
Analysis of rsa algorithm using gpu
Analysis of rsa algorithm using gpuAnalysis of rsa algorithm using gpu
Analysis of rsa algorithm using gpu
 
ANALYSIS OF RSA ALGORITHM USING GPU PROGRAMMING
ANALYSIS OF RSA ALGORITHM USING GPU PROGRAMMINGANALYSIS OF RSA ALGORITHM USING GPU PROGRAMMING
ANALYSIS OF RSA ALGORITHM USING GPU PROGRAMMING
 
A NETWORK SECURITY APPROACH USING RSA.
A NETWORK SECURITY APPROACH USING RSA.A NETWORK SECURITY APPROACH USING RSA.
A NETWORK SECURITY APPROACH USING RSA.
 
Moein
MoeinMoein
Moein
 
Data security using rsa
Data security using rsaData security using rsa
Data security using rsa
 
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...
 
Dnssec tutorial-crypto-defs
Dnssec tutorial-crypto-defsDnssec tutorial-crypto-defs
Dnssec tutorial-crypto-defs
 
ENHANCED SECURE ALGORITHM FOR MESSAGE COMMUNICATION
ENHANCED SECURE ALGORITHM FOR MESSAGE COMMUNICATIONENHANCED SECURE ALGORITHM FOR MESSAGE COMMUNICATION
ENHANCED SECURE ALGORITHM FOR MESSAGE COMMUNICATION
 
DESIGN AND IMPLEMENTATION OF DATA ENCRYPTION SOFTWARE
DESIGN AND IMPLEMENTATION OF DATA ENCRYPTION SOFTWAREDESIGN AND IMPLEMENTATION OF DATA ENCRYPTION SOFTWARE
DESIGN AND IMPLEMENTATION OF DATA ENCRYPTION SOFTWARE
 
A cloud security approach for data at rest
A cloud security approach for data at restA cloud security approach for data at rest
A cloud security approach for data at rest
 
A Cloud Security Approach for Data at Rest Using FPE
A Cloud Security Approach for Data at Rest Using FPE A Cloud Security Approach for Data at Rest Using FPE
A Cloud Security Approach for Data at Rest Using FPE
 
An Approach on Data Security with the Combination of Symmetric and Asymmetric...
An Approach on Data Security with the Combination of Symmetric and Asymmetric...An Approach on Data Security with the Combination of Symmetric and Asymmetric...
An Approach on Data Security with the Combination of Symmetric and Asymmetric...
 

Recently uploaded

Call Girls Bidadi Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Bidadi Just Call 👗 7737669865 👗 Top Class Call Girl Service BangaloreCall Girls Bidadi Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Bidadi Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangaloreamitlee9823
 
Nandini Layout Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangal...
Nandini Layout Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangal...Nandini Layout Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangal...
Nandini Layout Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangal...amitlee9823
 
Call Girls Jayanagar Just Call 👗 9155563397 👗 Top Class Call Girl Service Ban...
Call Girls Jayanagar Just Call 👗 9155563397 👗 Top Class Call Girl Service Ban...Call Girls Jayanagar Just Call 👗 9155563397 👗 Top Class Call Girl Service Ban...
Call Girls Jayanagar Just Call 👗 9155563397 👗 Top Class Call Girl Service Ban...only4webmaster01
 
Resumes, Cover Letters, and Applying Online
Resumes, Cover Letters, and Applying OnlineResumes, Cover Letters, and Applying Online
Resumes, Cover Letters, and Applying OnlineBruce Bennett
 
Miletti Gabriela_Vision Plan for artist Jahzel.pdf
Miletti Gabriela_Vision Plan for artist Jahzel.pdfMiletti Gabriela_Vision Plan for artist Jahzel.pdf
Miletti Gabriela_Vision Plan for artist Jahzel.pdfGabrielaMiletti
 
Guide to a Winning Interview May 2024 for MCWN
Guide to a Winning Interview May 2024 for MCWNGuide to a Winning Interview May 2024 for MCWN
Guide to a Winning Interview May 2024 for MCWNBruce Bennett
 
Call Girls In Devanahalli ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Devanahalli ☎ 7737669865 🥵 Book Your One night StandCall Girls In Devanahalli ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Devanahalli ☎ 7737669865 🥵 Book Your One night Standamitlee9823
 
➥🔝 7737669865 🔝▻ Tumkur Call-girls in Women Seeking Men 🔝Tumkur🔝 Escorts S...
➥🔝 7737669865 🔝▻ Tumkur Call-girls in Women Seeking Men  🔝Tumkur🔝   Escorts S...➥🔝 7737669865 🔝▻ Tumkur Call-girls in Women Seeking Men  🔝Tumkur🔝   Escorts S...
➥🔝 7737669865 🔝▻ Tumkur Call-girls in Women Seeking Men 🔝Tumkur🔝 Escorts S...amitlee9823
 
Brand Analysis for reggaeton artist Jahzel.
Brand Analysis for reggaeton artist Jahzel.Brand Analysis for reggaeton artist Jahzel.
Brand Analysis for reggaeton artist Jahzel.GabrielaMiletti
 
Call Girls In Sarjapur Road ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Sarjapur Road ☎ 7737669865 🥵 Book Your One night StandCall Girls In Sarjapur Road ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Sarjapur Road ☎ 7737669865 🥵 Book Your One night Standamitlee9823
 
Call Girls Btm Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Btm Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...Call Girls Btm Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Btm Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...amitlee9823
 
Call Girls Bidadi ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Call Girls Bidadi ☎ 7737669865☎ Book Your One night Stand (Bangalore)Call Girls Bidadi ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Call Girls Bidadi ☎ 7737669865☎ Book Your One night Stand (Bangalore)amitlee9823
 
Internship Report].pdf iiwmoosmsosmshkssmk
Internship Report].pdf iiwmoosmsosmshkssmkInternship Report].pdf iiwmoosmsosmshkssmk
Internship Report].pdf iiwmoosmsosmshkssmkSujalTamhane
 
➥🔝 7737669865 🔝▻ Nandyal Call-girls in Women Seeking Men 🔝Nandyal🔝 Escorts...
➥🔝 7737669865 🔝▻ Nandyal Call-girls in Women Seeking Men  🔝Nandyal🔝   Escorts...➥🔝 7737669865 🔝▻ Nandyal Call-girls in Women Seeking Men  🔝Nandyal🔝   Escorts...
➥🔝 7737669865 🔝▻ Nandyal Call-girls in Women Seeking Men 🔝Nandyal🔝 Escorts...amitlee9823
 
Personal Brand Exploration ppt.- Ronnie Jones
Personal Brand  Exploration ppt.- Ronnie JonesPersonal Brand  Exploration ppt.- Ronnie Jones
Personal Brand Exploration ppt.- Ronnie Jonesjonesyde302
 
Nagavara Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore Es...
Nagavara Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore Es...Nagavara Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore Es...
Nagavara Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore Es...amitlee9823
 
reStartEvents 5:9 DC metro & Beyond V-Career Fair Employer Directory.pdf
reStartEvents 5:9 DC metro & Beyond V-Career Fair Employer Directory.pdfreStartEvents 5:9 DC metro & Beyond V-Career Fair Employer Directory.pdf
reStartEvents 5:9 DC metro & Beyond V-Career Fair Employer Directory.pdfKen Fuller
 
Dubai Call Girls Kiki O525547819 Call Girls Dubai Koko
Dubai Call Girls Kiki O525547819 Call Girls Dubai KokoDubai Call Girls Kiki O525547819 Call Girls Dubai Koko
Dubai Call Girls Kiki O525547819 Call Girls Dubai Kokokojalkojal131
 
Call Girls Alandi Road Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Alandi Road Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Alandi Road Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Alandi Road Call Me 7737669865 Budget Friendly No Advance Bookingroncy bisnoi
 
Joshua Minker Brand Exploration Sports Broadcaster .pptx
Joshua Minker Brand Exploration Sports Broadcaster .pptxJoshua Minker Brand Exploration Sports Broadcaster .pptx
Joshua Minker Brand Exploration Sports Broadcaster .pptxsportsworldproductio
 

Recently uploaded (20)

Call Girls Bidadi Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Bidadi Just Call 👗 7737669865 👗 Top Class Call Girl Service BangaloreCall Girls Bidadi Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Bidadi Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
 
Nandini Layout Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangal...
Nandini Layout Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangal...Nandini Layout Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangal...
Nandini Layout Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangal...
 
Call Girls Jayanagar Just Call 👗 9155563397 👗 Top Class Call Girl Service Ban...
Call Girls Jayanagar Just Call 👗 9155563397 👗 Top Class Call Girl Service Ban...Call Girls Jayanagar Just Call 👗 9155563397 👗 Top Class Call Girl Service Ban...
Call Girls Jayanagar Just Call 👗 9155563397 👗 Top Class Call Girl Service Ban...
 
Resumes, Cover Letters, and Applying Online
Resumes, Cover Letters, and Applying OnlineResumes, Cover Letters, and Applying Online
Resumes, Cover Letters, and Applying Online
 
Miletti Gabriela_Vision Plan for artist Jahzel.pdf
Miletti Gabriela_Vision Plan for artist Jahzel.pdfMiletti Gabriela_Vision Plan for artist Jahzel.pdf
Miletti Gabriela_Vision Plan for artist Jahzel.pdf
 
Guide to a Winning Interview May 2024 for MCWN
Guide to a Winning Interview May 2024 for MCWNGuide to a Winning Interview May 2024 for MCWN
Guide to a Winning Interview May 2024 for MCWN
 
Call Girls In Devanahalli ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Devanahalli ☎ 7737669865 🥵 Book Your One night StandCall Girls In Devanahalli ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Devanahalli ☎ 7737669865 🥵 Book Your One night Stand
 
➥🔝 7737669865 🔝▻ Tumkur Call-girls in Women Seeking Men 🔝Tumkur🔝 Escorts S...
➥🔝 7737669865 🔝▻ Tumkur Call-girls in Women Seeking Men  🔝Tumkur🔝   Escorts S...➥🔝 7737669865 🔝▻ Tumkur Call-girls in Women Seeking Men  🔝Tumkur🔝   Escorts S...
➥🔝 7737669865 🔝▻ Tumkur Call-girls in Women Seeking Men 🔝Tumkur🔝 Escorts S...
 
Brand Analysis for reggaeton artist Jahzel.
Brand Analysis for reggaeton artist Jahzel.Brand Analysis for reggaeton artist Jahzel.
Brand Analysis for reggaeton artist Jahzel.
 
Call Girls In Sarjapur Road ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Sarjapur Road ☎ 7737669865 🥵 Book Your One night StandCall Girls In Sarjapur Road ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Sarjapur Road ☎ 7737669865 🥵 Book Your One night Stand
 
Call Girls Btm Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Btm Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...Call Girls Btm Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Btm Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
 
Call Girls Bidadi ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Call Girls Bidadi ☎ 7737669865☎ Book Your One night Stand (Bangalore)Call Girls Bidadi ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Call Girls Bidadi ☎ 7737669865☎ Book Your One night Stand (Bangalore)
 
Internship Report].pdf iiwmoosmsosmshkssmk
Internship Report].pdf iiwmoosmsosmshkssmkInternship Report].pdf iiwmoosmsosmshkssmk
Internship Report].pdf iiwmoosmsosmshkssmk
 
➥🔝 7737669865 🔝▻ Nandyal Call-girls in Women Seeking Men 🔝Nandyal🔝 Escorts...
➥🔝 7737669865 🔝▻ Nandyal Call-girls in Women Seeking Men  🔝Nandyal🔝   Escorts...➥🔝 7737669865 🔝▻ Nandyal Call-girls in Women Seeking Men  🔝Nandyal🔝   Escorts...
➥🔝 7737669865 🔝▻ Nandyal Call-girls in Women Seeking Men 🔝Nandyal🔝 Escorts...
 
Personal Brand Exploration ppt.- Ronnie Jones
Personal Brand  Exploration ppt.- Ronnie JonesPersonal Brand  Exploration ppt.- Ronnie Jones
Personal Brand Exploration ppt.- Ronnie Jones
 
Nagavara Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore Es...
Nagavara Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore Es...Nagavara Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore Es...
Nagavara Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore Es...
 
reStartEvents 5:9 DC metro & Beyond V-Career Fair Employer Directory.pdf
reStartEvents 5:9 DC metro & Beyond V-Career Fair Employer Directory.pdfreStartEvents 5:9 DC metro & Beyond V-Career Fair Employer Directory.pdf
reStartEvents 5:9 DC metro & Beyond V-Career Fair Employer Directory.pdf
 
Dubai Call Girls Kiki O525547819 Call Girls Dubai Koko
Dubai Call Girls Kiki O525547819 Call Girls Dubai KokoDubai Call Girls Kiki O525547819 Call Girls Dubai Koko
Dubai Call Girls Kiki O525547819 Call Girls Dubai Koko
 
Call Girls Alandi Road Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Alandi Road Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Alandi Road Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Alandi Road Call Me 7737669865 Budget Friendly No Advance Booking
 
Joshua Minker Brand Exploration Sports Broadcaster .pptx
Joshua Minker Brand Exploration Sports Broadcaster .pptxJoshua Minker Brand Exploration Sports Broadcaster .pptx
Joshua Minker Brand Exploration Sports Broadcaster .pptx
 

Nwc rsa

  • 1. A Fast Implementation of RSA using GNU MP Library [Student Paper] Rajorshi Biswas, Shibdas Bandyopadhyay Anirban Banerjee Indian Institute of Information Technology Calcutta rajorshi_biswas@rediffmail.com shibdas@rediffmail.com anir_iiit@yahoo.co.uk
  • 2. Synopsis  RSA is the most popular Public Key Encryption Technique in use today.  Large numbers are needed for encryption, hence the need for handling those numbers efficiently.  GNU MP is a library designed from scratch to handle numbers of arbitrary precision. So, we have used it for implementing RSA.
  • 4. Introduction  Data protection is becoming more and more important as the data communication increases exponentially.  One way is to encrypt the data stream with one key which is also used for decryption (Private key approach). The entire communication can be decrypted if the key is known.
  • 5. Introduction…  Improvement over this system is Public Key Infrastructure where one key ( Public Key) is used to encrypt the data while another key (Private Key) is used to decrypt it. So, private key is never exposed.  RSA is most widely used public key system. RSA (named after its authors Rivest, Shamir and Adleman) relies on the factorization problem that indicates it is quite difficult in today’s aspect to find two prime numbers whose product is a given large number.
  • 6. Introduction…  As we increase the given number the possibility for factoring the number decreases.  We have used GNU MP arbitrary precision library to implement RSA and done a performance analysis by varying the number of characters processed together.
  • 7. RSA Algorithm  Generate two large distinct primes p and q randomly  Calculate n = pq and x = (p-1)(q-1)  Select a random integer e (1<e<x) such that gcd(e,x) = 1  Calculate the unique d such that ed = 1(mod x)  Public key pair : (e,n), Private key pair : (d,n)
  • 8. Implementation  We have implemented the RSA cryptosystem in two forms : a console mode implementation, as well as a user friendly GUI implementation.  The console application uses a 1024 bit modulus RSA implementation, which is adequate for non-critical applications. By a simple modification of the source code, higher bit-strengths may be easily achieved, with a slight performance hit.
  • 9. Large numbers & GMP Library  Any practical implementation of the RSA cryptosystem would involve working with large integers (in our case, of 1024 bits or more in size).  The GMP library aims to provide the fastest possible arithmetic for applications that need a higher precision than the ones directly supported under C/C++ by using highly optimized assembly code. Further the GMP library is a cross-platform library, implying that our application should work across platforms with minimal modifications.
  • 10. Application Overview  The program is meant for use on a per user basis where each user's home directory stores files containing the private and public keys for the particular user. The application stores the private and public keys for a user in the files $HOME/.rsaprivate and $HOME/.rsapublic respectively.  The application will generate the keys if they are not present using random number and current time as seed.
  • 11. RSA Key Generation  The application maintains a constant named 'BITSTRENGTH' which is the size of the RSA modulus (n) in bits. Two random arrays p and q are generated.  At the end of this process, we have strings containing binary representations of the numbers p and q, but they are not prime yet. To achieve that, two gmp integers are first initialized with the contents of these strings and mpz_nextprime() is called which changes p and to the next possible primes.
  • 12. RSA Key Generation…  Now that we have the two 512-bit primes p and q, calculating the values of n (=pq) and x (=(p-1)*(q-1)) is a simple matter of invoking mpz_mul() with the proper arguments.  We then determined ‘e’ such that gcd(e,x)=1 starting from e=65537. Now there exists a procedure in the gmp library with the prototype int mpz_invert(mpz_t ROP, mpz_t OP1, mpz_t OP2) which computes the multiplicative inverse of OP1 modulo OP2 and puts the result in ROP. ). In this way, we obtain the value of ‘d’.
  • 13. RSA Encryption  The entire file to encrypt is processed as a group of strings each containing the specified number of characters (except possibly the last such string). Each character in such a string is converted to ASCII code, and the entire resulting numeric string is our message m.  Encrypting it is achieved by computing m ^ e mod n. There is a gmp routine specifically for such a computation having the prototype void mpz_powm (mpz_t ROP, mpz_t BASE, mpz_t EXP, mpz_t MOD) which sets ROP to (BASE raised to EXP) modulo MOD.
  • 14. RSA Decryption  The operation of this routine is really quite straightforward. From the file to decrypt (the path to which is input from the user),the function processes each encrypted integer. It does so by computing the value of c ^ d mod n by invoking gmp_powm(m,c,d,n) and stores the decrypted part in m.  Here m however contains the integer representation of the message where each 3 integer sequence signifies the ASCII code of a particular character. An inverse mapping to the relevant character is carried out.
  • 15. Time Analysis Time Analysis 0 100 200 300 1 25 50 75 100 No. of characters encrypted together Encryption Time Decryption Time
  • 16. Overall Analysis  We have noticed the speed improvements in key generation and encryption/decryption while using keys of lower strength.  Encryption and decryption times decrease considerably when number of characters encrypted together increases.  So, a balance is to be made considering both. We found out 1024 bit RSA with 100 characters encrypted together is very efficient in terms of speed and security.
  • 17. GUI Implementation  The GUI application was developed using KDE/Qt libraries on Red Hat Linux 8.0. We used KDevelop 2.1 as our integrated development environment.  Our application consists of three C++ classes, of which the class named RSA is the most important. It provides slots (signal handlers) for encrypting files, decrypting files, mailing the encrypted file to another user, loading the values of the RSA keys from the key-files, saving encrypted/decrypted files and so on.
  • 18. Screenshots  This is the main dialog of the RSA GUI.
  • 19. Screenshots…  This is the window showing the keys generated by the application.
  • 20. Screenshots…  This is the screen showed for encryption.
  • 21. Screenshots…  User can also mail the encrypted file.
  • 22. Screenshots…  User can decrypt the encrypted file using his private key.
  • 23. Conclusion  In this paper an efficient implementation of RSA is shown by using various functions of the GMP library. Feasibility analysis is done by comparing the time taken for encryption and decryption. It shows that when we increase the number of bits of information to be encrypted together the total time including encryption and decryption steadily decreases. It must always be kept in mind that the integer representation of the message to be encrypted should lie within the range specified by the modulus (that is, m lies in the range [0,n- 1]), which poses a limitation on the maximum number of characters that can be encrypted at a single time.
  • 24. References  [1] Paul Syversion and Illiano Cervesato, The logic of authentication protocols, FOSAD’00, Bertinoro, Italy, 2000.  [2] Dario Catalano, Rosario Gennaro and Shai Halevi, Computing inverse over a shared secret modulus, IBM T. J. Watson Research center, NY, USA, 1999.  [3] Don coppersmith, Markus Jakobsson, Almost optimal hash sequence traversal, RSA Laboratories, NY, 2001.  [4] Elichiro Fujisaki, Tatsuaki Okamoto, David Pointcheval and Jacques Stern, RSA- OAEP is secure under the RSA assumption, Journal of Cryptology, 2002.  [5] Daniel M. Gordon, A survey of fast exponentiation methods, Journal of algorithms, 27, 1998, 126-146.  [6] Adrian Perrig, Robet Szewczyk, Victor Wen, David Culler and J.D. Tygar, SPINS: Security protocols for sensor networks, Mobile Computing and Networking, Rome, Italy, 2001.  [7] David Pointcheval and Jacques Stern, Security proofs for signature schemes, EUROCRYPT ’96, Zaragoza, Spain, 1996.  [8] Giuseppe Ateniese, Michael Steiner, and Gene Tsudik, New multiparty authentication services and key agreement protocols, IEEE Journal of Selected Areas in Communication, 18(4), 2000.  [9] Cetin Kaya Koc, High speed RSA implementation, RSA Laboratories, CA, 1994.  [10] Anand Krishnamurthy, Yiyan Tang, Cathy Xu and Yuke Wang, An efficient implementation of multi-prime RSA on DSP processor, University of Texas, Texas, USA,2002.  [11] Handbook of Applied Cryptography, A. Menezes, P. Van Oorschot, S. Vanstone, CRC Press, 1996 ( www.cacr.math.uwaterloo.ca/hac )