Cryptographic Algorithm
Cryptographic Algorithm
I confirm that I understand my coursework needs to be submitted online via Google Classroom under the
relevant module page before the deadline for my assignment to be accepted and marked. I am fully
aware that late submissions will be treated as non-submission and a mark of zero will be awarded.
Table of Contents
Table of Contents .......................................................................................................................... i
Abstract ......................................................................................................................................... iv
1.1 Confidentiality:................................................................................................................ 2
1.2 Integrity:........................................................................................................................... 2
3. RSA ........................................................................................................................................ 6
3.1 Background..................................................................................................................... 6
3.1.2 Encryption................................................................................................................ 7
4.1 Flowchart....................................................................................................................... 13
7. Conclusion ........................................................................................................................... 20
8. References .......................................................................................................................... 21
Table of Figures
Figure 1: CIA Triad ....................................................................................................................... 1
Figure 2: Cryptographic Process ............................................................................................... 3
Figure 3: Hieroglyph – The Oldest Cryptographic Technique............................................... 4
Figure 4: RSA cryptosystem ....................................................................................................... 6
Figure 5: ASCII Table for alphabet characters ........................................................................ 9
Figure 6: IIRSA encryption algorithm ...................................................................................... 13
Figure 7: IIRSA decryption algorithm ...................................................................................... 14
Abstract
Security techniques such as RSA are significant for communications because they
provide secure data transmissions to enterprises, organizations, and individuals all over
the world who require to communicate with each other for their everyday job. Friends
among different organizations, who may be from different societies or even countries
need to communicate with each other on a regular basis. To ensure security during
transmission, the data should essentially be encrypted. As a result, the current research
article leads to a unique security method for a cryptographic algorithm. This research
explores the value of cryptography and emphasizes on the evolution of RSA, and raises
the algorithm's difficulty to enhance security in operations where it may be used.
CC5004NI Security in Computing
SUJEN SHRESTHA 1
CC5004NI Security in Computing
1.1 Confidentiality:
The efforts of an organization to keep data secret or private are referred to as
confidentiality. To achieve this, access to information must be restricted in order to avoid
the unintentional or accidental release of data. Making sure that those who don't have
necessary authorization can't access assets th at are important to the organization is an
important part of protecting confidentiality. An effective system, on the other hand,
guarantees that those who needs access have the required permissions. For example,
all the data of the customers collected by a bank is only shared to the respective
customers and it is not disclosed to anyone else.
1.2 Integrity:
Integrity refers to ensuring that the data is accurate and unmodified. Only original,
accurate, and dependable data maintains the integrity of the data. For example, when a
person withdraws Rs. 5000 from an ATM the balance deducted from his account is
Rs.5000. This means that no tampering has occurred in the process and the transaction
is accurate.
1.3 Availability:
Even if data is kept secure and its integrity is preserved, it is generally meaningless unless
it is accessible to individuals within the business as well as the clients they serve. This
implies that systems, networks, and applications must all work properly and at the
appropriate times. Individuals who have access to certain data must also be able to
access it when they need it, and acquiring the data should not take an excessive amount
of time. For example, an ATM machine provides 24-hour service to its customers, it
means that the service is accessible to the customer whenever it is required.
SUJEN SHRESTHA 2
CC5004NI Security in Computing
2. Introduction to Cryptography
Cryptography is derived from the Greek words “Kryptos” and “Graphein’”. “Kryptos”
means hidden and “Graphein” means writing. Therefore, cryptography is the process of
securing the information using various algorithms so that it can only be understood by the
writer and the intended reader. It can also be understood as converting the plain text
(readable form) into cipher text (unreadable form) and vice-versa. It is the art of building
an encryption system which facilitates the communication of secret data through an
insecure path. Cryptography is important in the field of information security because it
enables the information of the user to be concealed from everyone except the sender and
the receiver. It also helps to achieve several goals of InfoSec like maintaining
confidentiality, integrity and ensuring authenticity (Zakariyah, 2021).
SUJEN SHRESTHA 3
CC5004NI Security in Computing
Decryption: It is the process of reverting the cipher text into the original plain text. A
specific key generated during the encryption is required to decipher the cipher text to plain
text.
Algorithm: It is a finite sequence of well-defined instructions, typically used to solve a
class of specific problems or to perform a computation .
(Tutorialspoint, 2015)
In the 15th century, improved coding techniques like as "Vigenère Coding" were
developed, which allowed changing letters in a message to a variety of different positions
rather than moving them the same number of times. Cryptography progressed from ad
hoc techniques to encryption to the more sophisticated art and science of information
security only in the 19th century (Tutorialspoint, 2015).
SUJEN SHRESTHA 4
CC5004NI Security in Computing
In the present day, among all cryptographic systems, Symmetric and Asymmetric key
encryption are the most commonly used techniques.
SUJEN SHRESTHA 5
CC5004NI Security in Computing
3. RSA
3.1 Background
The RSA algorithm was developed in 1978 by Ronald Rivest, Adi Shamir, and Leonard
Adleman as a public key encryption algorithm. It is the most extensively used key
cryptographic system. The RSA algorithm was the first to be appropriate for encryption
and decryption; it involved modular multiplication and exponentiation. For some 'n', the
RSA algorithm is a cipher block in which the plaintext and cipher text are integers between
0 and n-1. This method is one of the finest asymmetric key cryptosystems for exchange
keys, digital signatures, and data encryption blocks that uses prime integers. Asymmetric
cryptography, also known as public key cryptography, employs two distinct keys for
encryption and decryption. One key is public, while the other is kept private. The keys are
generated by performing a mathematical calculation on two large prime numbers. The
public key is sent to everyone in the system but the private key is kept secret in RSA. The
RSA cryptosystem's security is based on the mathematical difficulty of factoring large
prime numbers. The attacker cannot obtain the factor prime of n and hence the private
key by using information from the public key, which contains n (multiplication of prime
numbers). As a result, the RSA algorithm is highly secure (Hatem, et al., 2019).
SUJEN SHRESTHA 6
CC5004NI Security in Computing
There are three steps in the RSA algorithm: key generation, encryption, and decryption.
Each of them is elaborated below.
3.1.2 Encryption
The following are the processes for encrypting a message to obtain the cipher-text:
1. Obtain the recipient’s Public Key – (n, e).
2. Denote Plain Text message as a positive integer M.
3. Compute the cipher text as C = Me mod n.
3.1.3 Decryption
The following are the processes for decrypting cipher-text in order to obtain the original
message:
1. Acquire the recipient’s Private Key – (n, d).
2. Calculate the plain text as M = C d mod n.
SUJEN SHRESTHA 7
CC5004NI Security in Computing
SUJEN SHRESTHA 8
CC5004NI Security in Computing
SUJEN SHRESTHA 9
CC5004NI Security in Computing
Since, this algorithm requires isolating and inverting the values, it is named as IIRSA.
Because of the addition of these extra steps, the algorithm is now one of its kind. The
original RSA is a well-known algorithm so many hackers know how it works and can
decrypt the cipher text if they have the required time and computational technology. This
modification makes this algorithm unique so it cannot be cracked without knowing the
additional steps that have been added into it. Thus, it makes this algorithm more secure
than the original RSA. The various aspects regarding the complete process of encryption
and decryption are elaborated below.
The ASCII values for the alphabet characters can be obtained from the figure above.
Assuming the message is “DOG”.
First, convert the plain text letters into their respective ASCII values.
D O G
68 79 71
Now, isolate the letters, convert into binary and get the inverted decimal value.
D = 68
Where, 6 = 0110 [Binary] 8 = 1000 [Binary]
↓ ↓
1001 [Inverted] 0111 [Inverted]
↓ ↓
9 [Decimal] 7 [Decimal]
The new value of D is 97.
SUJEN SHRESTHA 10
CC5004NI Security in Computing
O = 79
Where, 7 = 0111 [Binary] 9 = 1001 [Binary]
↓ ↓
1000 [Inverted] 0110 [Inverted]
↓ ↓
8 [Decimal] 6 [Decimal]
The new value of O is 86.
G = 71
Where, 7 = 0111 [Binary] 8 = 1000 [Binary]
↓ ↓
1000 [Inverted] 0111 [Inverted]
↓ ↓
8 [Decimal] 7 [Decimal]
The new value of G is 87.
Let's say the prime numbers P and Q are 31 and 41, respectively.
n = p * q = 1271 [i.e., 31 * 41]
Ø (n) = (p - 1) * (q - 1) = 1200 [i.e. (31 – 1) * (41 - 1)]
e = 7, since GCD (7, 1200) = 1 < 7 < 1271
d = 343, since e * d mod Ø (n) = 1
So, the public key = (1271, 7)
The private key = (1271, 343)
Encryption Decryption
Plain text ‘D’ = 97 M = C ^ d mod n
C = M ^ e mod n M = 977 ^ 343 mod 1271
C = 97 ^ 7 mod 1271 M = 97 (Original message)
C = 977 (Cipher text)
SUJEN SHRESTHA 11
CC5004NI Security in Computing
Encryption Decryption
Plain text ‘O’ = 86 M = C ^ d mod n
C = M ^ e mod n M = 189 ^ 343 mod 1271
C = 86 ^ 7 mod 1271 M = 86 (Original message)
C = 189 (Cipher text)
Encryption Decryption
Plain text ‘G’ = 87 M = C ^ d mod n
C = M ^ e mod n M = 676 ^ 343 mod 1271
C = 87 ^ 7 mod 1271 M = 87 (Original message)
C = 676 (Cipher text)
SUJEN SHRESTHA 12
CC5004NI Security in Computing
4.1 Flowchart
SUJEN SHRESTHA 13
CC5004NI Security in Computing
SUJEN SHRESTHA 14
CC5004NI Security in Computing
SUJEN SHRESTHA 15
CC5004NI Security in Computing
5. Test Cases
Test 01
Considering the plain text is “G”,
G = 71 [i.e., G = 71 in ASCII value]
Isolating the ASCII values getting the binary values for each,
7 = 0111, 1 = 0001
Inverting the obtained binary values and converting the inverted value into decimal.
1000 = 8, 1110 = 14
Here, G = 814 which is the new value for the plain text.
Let's say the prime numbers P and Q are 43 and 19, respectively.
n = 43 *19 = 817
Ø (n) = (43 - 1) * (19 - 1) = 756
Public Key = (817, 5)
Private Key = (817, 605)
Now,
Encryption Decryption
Plain Text ‘G’ = 814 M = C ^ d mod n
C = M ^ e mod n M = 574 ^ 605 mod 817
C = 814 ^ 5 mod 817 M = 814 (Original message)
C = 574 (Cipher text)
Test 02
Considering the plain text is “R”,
R = 82 [i.e., G = 82 in ASCII value]
Isolating the ASCII values getting the binary values for each,
8 = 1000, 2 = 0010
Inverting the obtained binary values and converting the inverted value into decimal.
0111 = 7, 1101 = 13
Here, G = 713 which is the new value for the plain text.
SUJEN SHRESTHA 16
CC5004NI Security in Computing
Encryption Decryption
Plain Text ‘R’ = 713 M = C ^ d mod n
C = M ^ e mod n M = 497 ^ 605 mod 817
C = 713 ^ 5 mod 817 M = 814 (Original message)
C = 497 (Cipher text)
Test 03
Considering the plain text is “A”,
A = 65 [i.e., A = 65 in ASCII value]
Isolating the ASCII values getting the binary values for each,
6 = 0110, 5 = 0101
Inverting the obtained binary values and converting the inverted value into decimal.
1001 = 9, 1010 = 10
Here, G = 910 which is the new value for the plain text.
Encryption Decryption
Plain Text ‘A’ = 910 M = C ^ d mod n
C = M ^ e mod n M = 424 ^ 605 mod 817
C = 910 ^ 5 mod 817 M = 910 (Original message)
C = 424 (Cipher text)
Test 04
Considering the plain text is “P”,
P = 80 [i.e., P = 80 in ASCII value]
Isolating the ASCII values getting the binary values for each,
8 = 1000, 0 = 0000
Inverting the obtained binary values and converting the inverted value into decimal.
0111 = 7, 1111 = 15
Here, P = 715 which is the new value for the plain text.
SUJEN SHRESTHA 17
CC5004NI Security in Computing
Encryption Decryption
Plain Text ‘P’ = 715 M = C ^ d mod n
C = M ^ e mod n M = 65 ^ 605 mod 817
C = 715 ^ 5 mod 817 M = 715 (Original message)
C = 65 (Cipher text)
Test 05
Considering the plain text is “E”,
E = 80 [i.e., E = 80 in ASCII value]
Isolating the ASCII values getting the binary values for each,
6 = 0110, 9 = 1001
Inverting the obtained binary values and converting the inverted value into decimal.
1001 = 9, 0110 = 6
Here, E = 96 which is the new value for the plain text.
Encryption Decryption
Plain Text ‘P’ = 96 M = C ^ d mod n
C = M ^ e mod n M = 799 ^ 605 mod 817
C = 96 ^ 5 mod 817 M = 96 (Original message)
C = 799 (Cipher text)
SUJEN SHRESTHA 18
CC5004NI Security in Computing
SUJEN SHRESTHA 19
CC5004NI Security in Computing
7. Conclusion
The various concepts of information security have been discussed in this document. The
fundamental aspects which must be maintained in order to ensure information security
are confidentiality, integrity and availability. In order for these goals to be met, various
actions need to be implemented. Cryptography is one method through which these goals
of information security like confidentiality and integrity can be met. The history and
evolution of the cryptographic systems has been discussed in this document from its
origin to the present structure which entails various modifications and variations that have
been made to the cryptosystems over the years. Of the many cryptographic techniques,
the RSA algorithm has been selected to be modified in this document. The foundation of
RSA, its pros and cons and its various processes like key generation, encryption and
decryption has been discussed. The changes made to the RSA algorithm along with the
flowchart for encryption and decryption and the working steps of algorithm have been
elaborated in detail. Moreover, the modified algorithm h as been tested and critically
evaluated for its strengths and weaknesses and the application areas in which it might be
implemented.
SUJEN SHRESTHA 20
CC5004NI Security in Computing
8. References
Albugmi, A., Walters, R. J., Alassafi, M. O. & Wills, G., 2016. Data Security in Cloud
Computing. Fifth International Conferance on Future Generation Communication
Technologies (FGCT), Volume 1, pp. 55-59.
Bodur, H. & Kara, R., 2015. Secure SMS Encryption Using RSA Encryption Algorithm
on Android. 3rd International Symposium on Innovative Technologies in Engineering
and Science, Volume 1, p. 10.
Bonde, S. Y. & Bhadade, U. S., 2017. IMPLEMENTATION OF RSA ALGORITHM AND
MODIFIED RSA ALGORITHM METHODS:A REVIEW. International Journal of
Advanced Technologyg in Engineering and Science, 5(5), pp. 176-181.
GeeksforGeeks, 2020. Difference Between Symmetric and Asymmetric Key Encryption.
[Online]
Available at: https://www.geeksforgeeks.org/difference-between-symmetric-and-
asymmetric-key-encryption/
[Accessed 6 Jan 2021].
GeeksforGeeks, 2021. RSA Full Form. [Online]
Available at: https://www.geeksforgeeks.org/rsa-full-form/
[Accessed 7 January 2021].
Hatem, M., Rasha, A., Hatem, A. E. & Reda, H., 2019. Modified RSA Algorithm Using
Two Public Key and Chinese Remainder Theorem. I.J. of Electronics and Information
Engineering, 10(1), pp. 51-64.
Tutorialspoint, 2015. Cryptography Just For Beginners. 1st ed. Hyderabad: Tutorials
Point (I) Pvt. Ltd. .
Whitman, M. E. & Mattord, H. J., 2018. Principles of Information Securrity. 6th ed.
Boston: Cenage Learning.
Zakariyah, W. O., 2021. Cryptography, Ilorin: Department of Telecommunication
Science, University of Ilorin.
SUJEN SHRESTHA 21