This project aims to evaluate and analyze the RSA algorithm as a security policy. The objective is to analyze conventional security policies, evaluate RSA, and perform performance analysis and measurement. The methodology uses random padding schemes as an outer layer of protection for the core RSA policy to make it unbreakable. It also aims to minimize computational complexity of RSA. The project implements RSA encryption and decryption in C++ and C# with a graphical user interface. It analyzes performance in Matlab and models the project using UML.
1. Project Summary
Title: Evaluation and performance analysis of RSA
algorithm as security policy
Objective
This work contains following parts of objective:
ï¶ Analyze the conventional security policies.
ï¶ Evaluate the RSA algorithm as security policy.
ï¶ Consider the performance analysis and measurement.
Honorable Supervisor,
Dr. M. Mahbubur Rahman,
Professor,
Department of Information & Communication Engineering,
Islamic University, Kushtia.
Submitted by,
S.M. Nazmus Salehin,
smrubel04ice@gmail.com
Cell: 008801198056349
2. Abstract
Human beings, most significant and evoluted in universe, are being systematized on
digital cross platform. Already we have developed tools and technologies to
confirm the conversation pathway between conventional or manual system to actual
or automated system. So all of resources in conventional world should have to be
migrated to be on digital module or digital identification (DID). Rather, the security
policy is needed to ensure the authentication, integrity and confidentiality of
information as well as digital resources.
Thus, reliable and complete security consideration is to be dealt and no doubt. But
question here is the expected level of completeness and reliability.
Conventional security protocols must have some form of vulnerabilities that result
in a violation of confidentiality. To minimize such vulnerabilities, here in this thesis
work, we utilize the robustness of RSA (Rivest, Samir and Adleman) algorithm that
is approximately unbreakable.
Firstly we conduct an analysis on conventional security policy of various
communication reference models and existing RSA works. After that we
approximate our proposed RSA security policy and finally we consider the
performance criterion and measurements.
3. Methodology
There are two key points to be dealt on and focused over this work:
1. We would use Random Padding Scheme (RPS) as outer layer
protection of core RSA policy to make it ever unbreakable.
2. We would minimize the computational complexity of RSA policy
through the use of an Algorithm.
In this thesis work, basically we would optimize following resource pools as stages:
Analysis
Design
Implementation
Validation
4. To develop this resource, we follow the waterfall (iteration) software development
model as shown in fig ().
In analysis and design, we use three strategies to simulate the activity:
ï· Structured or functional
ï· Modular decomposition
ï· Object Oriented Programming (OOP)
Requirements
Feasibility Study
Analysis
Design
Implementation
Validation
Maintenance
5. Languages
Here in this project, we use four languages of interest:
C++
C++ is the base language of this project. We first implement here the command
line or DOS interface that is attested with exemplary I/O file. Below we insert some
work shots:
ï· We performs two basic operations as shown below:
ï· For example we choose option 1 and input message with RPS length 5.
After that have to input two primes:
6. ï· If any problem in input: no doubt , we would try this work be strongly fault
tolerant as shown above.
ï· Select encryption keys: A list of keys are shown programmatically to facilitate
user .
7. ï· Encryption done and shown here cipher stream to be sent over media.
ï· Decryption process: Possible Decryption is shown.
8. ï· Now Decryption is done .
This version of work just released for only research purpose . Our commercial
version now also available with C# interface.
C#
We implement the Graphical User Interface (GUI) through the use of C#.NET for
example in fig (1) and (2).
9. Mat Lab
Mat lab is used to simulate performance analysis
UML 2.2
Unified Modeling Language (UML) is used to model the project activity.
Tools
We use here RSA (Rivest, Samir, Adlman) algorithm as basic security tool, therefore two
portion in qwork:
ï· Encryption
ï· Decryption
10. Design
RSA encryption algorithm
1. Input message.
2. Encode using integers.
3. Select two primes p and q.
4. Calculate n=p*q, phi=(p-1)*(q-1).
5. Select encryption key e as
ïŒ Relatively prime to phi.
ïŒ Between ranges 1<e<phi
6. Calculate c = me
(mod n).
Start
Input message M
Encode M
Input p and q
Calculate: n=p*q, phi=(p-1)*(q-1)
Input e
Phi and e
relatively
prime?
Calculate:
c = me
(mod n).
End
11. RSA decryption algorithm
1. Select decryption key d as
ïŒ Range 1<d<phi
ïŒ d*e % phi=1.
2. Calculate m = cd
(mod n).
A worked example
Here is an example of RSA encryption and decryption. The parameters used here are artificially
small, but one can also use OpenSSL to generate and examine a real keypair.
1. Choose two distinct prime numbers, such as
p = 61 and q = 53.
Start
Input d
d*e%phi=1?
Calculate:
. m = cd
(mod n).
End
12. 2. Compute n = pq giving
n = 61(53) = 3233.
3. Compute the totient of the product as Ï(n) = (p â 1)(q â 1) giving
Ï(3233) = (61 â 1)(53 â 1) = 3120.
4. Choose any number 1 < e < 3120 that is coprime to 3120. Choosing a prime number for e
leaves you only to check that e is not a divisor of 3120.
Let e = 17.
5. Compute d, the modular multiplicative inverse of e(mod Ï(n)) yielding
d = 2753.
The public key is (n = 3233, e = 17). For a padded plaintext message m, the encryption function
is m17
(mod 3233).
The private key is (n = 3233, d = 2753). For an encrypted ciphertext c, the decryption function
is c2753
(mod 3233).
For instance, in order to encrypt m = 65, we calculate
c = 6517
(mod 3233) = 2790.
To decrypt c = 2790, we calculate
m = 27902753
(mod 3233) = 65.
Both of these calculations can be computed efficiently using the square-and-multiply algorithm
for modular exponentiation. In real life situations the primes selected would be much larger; in
our example it would be relatively trivial to factor n, 3233, obtained from the freely available
public key back to the primes p and q. Given e, also from the public key, we could then
compute d and so acquire the private key.
14. Finite State Machine (FSM) Diagram
OOP Analysis
In this analysis we have two general classes:
Start
Option
Selection
Decryption
End
Encryption
15. Example in C++ illustration
class encryption
{
public:
long n, phi;
long p,q,e;
long l, m, cipher[500],ascii[500], ptrn[100];
void input(void);
void encode(void);
void generation(void);
int test(void);
void processor(void);
void display(void); friend void exchangemsg(encryption &,decryption &);
friend void exchangecodeptrn(encryption &,decryption &);
friend void exchangekey(encryption &,decryption &);
};
Attributes:
Methods:
Encryption Class
Attributes:
Methods:
Decryption Class
16. class decryption
{
public:
long n, phi;
long e,d;
long l, m, ptrn[100], cipher[500];
void generation(void);
void processor(void);
void decode(void);
void display(void);
friend void exchangemsg(encryption &,decryption &);
friend void exchangemsg(encryption &,decryption &);
friend void exchangemsg(encryption &,decryption &);
};
Future Work
In future we would try to design the methodology of security cross platform as
general derivation for world.