REPORT
REPORT
REPORT
On
Bachelor of Technology
In
Computer Science and Engineering
Submitted By
Deepanshu Tyagi
Enrollment no. A51405217002
Vikas Jangra
Enrollment No. A51405217001
Under the guidance of
Declaration
This is to certify that the thesis entitled “Blockchain Assisted Network Security
Algorithm” is a bona fide record of the independent project/research work done by us, under
the supervision of Dr. Vikas Thada and submitted to Amity University, Haryana in partial
fulfilment for the award of the Degree of Bachelor of Technology in Computer Science
and Engineering. We certify the content of the thesis are authentic, original and free from
plagiarism.
Certificate
This is to certify that the thesis entitled “Blockchain Assisted Network Security
Algorithm” is a bona fide record of the independent project/research work done by
Deepanshu Tyagi & Vikas Jangra bearing enrollment number A51405217002 and
A51405217001, respectively, under my supervision.
To the best of my knowledge and believe work done by the candidates is original and has not
been submitted for award of any other degree.
Head
Acknowledgement is not a mere obligation but the epitome of humility and the ineptness to all
those who have helped in the completion of this project. We are thankful to Dr. Vikas Thada,
Department of Computer Science and Technology, Amity School of Engineering and Technology
for his constant guidance and encouragement provided in this endeavor. We also thank our
parents for their continued support, understanding and patience without whose support and
understanding this endeavor would never be fruitful. We also thank all our friends for helping us
out in completing this project and helping me in solving various problems encountered during the
progress of this project.
A51405217002 A51405217001
ABSTRACT
Making payments over the Internet is a norm of today's world. The conveniences offered by a
swift transaction in a few clicks of a computer mouse are availed of by a many. As the
technology advances, more and more people are attracted towards internet for sharing their
information. A good number of these people uses internet for making payments. With
discounts that comes along with making digital payments the number of people using digital
payments mode is expected to increase in the near future. Although making payments
digitally is easy, it is also very important to keep these transactions fast and secure. For this
matter, in this work, methods have been suggested to make digital transactions more secure
and difficult to breach. Some of these transactions involve sending critical payments card
data over unsecured and often compromised networks.
Ensuring this data does not fall into the wrong hands is the domain of network systems
engineers. However, an additional layer of security can be created by encrypting the data we
send. Although many such systems are already a commonplace in our world, sometimes data
compromises do occur. In this article, such an encryption technique is discussed, employing a
combination of existing algorithms as well as a few new techniques, including, a modified,
location dependent usage of the RSA algorithm, blockchain based data transmission, the AES
encryption technique, as well as simpler techniques; affine and multiple-layer Cross
Language Ciphering
LIST OF FIGURES
1 A mapping example 3
10 Output Screen 24
14 Output Screen 26
Chapter Number Title of Chapter Page Number
Introduction 1
1.1 Introduction 1
1 1.2 Cryptography and Blockchain 1
1.3 Character Encoding 2
1.4 Objective 3
Literature Review 4
2
Literature Review 4
Methodology 7
3.1 Hardware Requirement 7
3.2 Software Requirement 7
3.2.1 Eclipse IDE 7
3 3.2.2 Java 8 8
3.2.3 Apache Tomcat 8
3.3 Technology Used 10
3.3.1 Cryptography 10
3.3.2 Blockchain 12
Design of Project 14
4.1 Details of the cryptography concept used: 14
4.1.1 RSA Algorithm 14
4
4.1.2 AES Algorithm 17
4.2 Flowchart 19
4.3 Implementation Process 20
Results 23
5
Screen Shots of Project 23
Conclusion and Future Work 27
6 6.1 Conclusion 27
6.2 Future Work 27
References 28
Table of Contents
CHAPTER 1
1.1. INTRODUCTION
Convenient, secure, and instant transfer of funds has been made a reality thanks to
advent of electronic payment methods such as credit cards, debit cards, smart
cards, e-wallets, net banking, etc. People have made payment cards a preferred
option for money payments, whether on-the-go or at home shopping over the
Internet. Globally, the net figure of transactions made using payments cards are
increasing dramatically. Due to the rise of the Asia-Pacific region in particular,
the revenue of the global electronic banking sector is expected to grow by 2
trillion dollars over the next 5 years. More and more people in the developing
world are abandoning cash in favor of more modern and convenient methods,
thanks in part to the advancements made in mobile computing and networking
technologies making them more powerful, accessible and affordable. However,
this also means more people getting duped when the encryption systems in force
behind these technologies are compromised.
The input credit card details; the card number, the expiration dates and the card
security codes are encoded one-on-one and onto predetermined characters of the
English alphabet by affine cipher. The corresponding numeric character reference
in Hypertext Markup Language (HTML) for each of the characters is obtained as
per the American Standard Code for Information Interchange (ASCII) table. Here,
a novel ciphering technique is used; the Cross Language Cipher Technique, which
further converts each of the HTML strings for the English Language The input
card details; the card number, the expiration date and the security codes are
encoded one-on-one and onto predetermined characters of the English alphabet by
simple numeric to alphabet substitution cipher. The corresponding markup
numeric character reference (NCR) with a decimal base for each of the characters
is obtained. Here, a new cipher technique is used; the Cross Language Cipher
Technique, which further converts the NCR strings representing characters from
the English Language into those corresponding to characters of other languages,
based on simple transliteration. This is a unique yet simple cipher technique that
adds another layer of complexity. Further, the Cross Language Cipher can be
implemented repeatedly as well as randomly over characters of multiple
languages; able to encompass the entire Universal Character Set (UCS) of the
Unicode standard.
In the model used as an example, the technique converts the NCRs into those
corresponding to the Hindi Language in the UCS, which themselves are mapped
onto the NCRs of the phonetically similar alphabets of the Russian Language.
This marks the end of the encoding technique employed in the model, the result of
which is a string of NCRs with decimal bases.
1.4. Objective
Convenient, and instant transfer of funds have been made possible thanks to the advent of
electronic payment methods such as credit cards, net-banking, debit cards, e-wallets, etc. As
the number of people using these payment methods go up, there is a need to make these
transactions ultra-secure. There occurs a number of fraud cases every day because of the
reason that the communication channel unreliable and is prone to various cyber-attacks. So,
to make these transactions secure use of new technologies like blockchain, cryptography is to
be considered. In this work a robust encryption technique is discussed that employs a
combination of existing security algorithms along with the concepts of blockchain.
CHAPTER 2
Literature Review
In [15], author(s) have introduced the specialized parts of Blockchain and Internet
of Things. This work presents diagram, history, design, types, qualities, working,
application and difficulties of Blockchain and Internet of Things.
In [18], author(s) have talked about the Blockchain technology and its connected
progressions. Further, uses of Blockchain innovation have been recorded,
primarily concentrating on the application in the field of banking. Author(s) have
examined in detail the working, benefits, issues and difficulties in usage of record
based Blockchain innovation in banking frameworks administrations.
In [19], author(s) have talked about the advancement of bitcoin, it's points of
interest, qualities and need. Further, author(s) clarify the significance of
Blockchain in the accompanying areas - internet of things, banking, digital security
and financial organizations.
Blockchain includes a great deal of security efforts. In [20], author(s) specifies the
significance of Blockchain in supply chain mechanism. Author(s) have proposed a
Blockchain architecture and also portray in detail the dangers related with the in-
supply chain mechanism and afterward depict how Blockchain innovation can be
used to resolve this issue. The proposed arrangements can be stretched out to
different organizations as well.
METHODOLOGY
The Eclipse platform which provides the foundation for the Eclipse IDE is composed of
plug-ins and is designed to be extensible using additional plug-ins. Developed using Java,
the Eclipse platform can be used to develop rich client applications, integrated development
environments and other tools. Eclipse can be used as an IDE for any programming language
for which a plug-in is available.
The Java Development Tools (JDT) project provides a plug-in that allows Eclipse to be used
as a Java IDE, PyDev is a plugin that allows Eclipse to be used as a Python IDE, C/C++
Development Tools (CDT) is a plug-in that allows Eclipse to be used for developing
application using C/C++, the Eclipse Scala plug-in allows Eclipse to be used an IDE to
develop Scala applications and PHP eclipse is a plug-in to eclipse that provides complete
development tool for PHP.
The initial codebase originated from IBM VisualAge.[7] The Eclipse software development
kit (SDK), which includes the Java development tools, is meant for Java developers. Users
can extend its abilities by installing plug-ins written for the Eclipse Platform, such as
development toolkits for other programming languages, and can write and contribute their
own plug-in modules. Since the introduction of the OSGi implementation (Equinox) in
version 3 of Eclipse, plug-ins can be plugged-stopped dynamically and are termed (OSGI)
bundles.
Eclipse software development kit (SDK) is free and open-source software, released under the
terms of the Eclipse Public License, although it is incompatible with the GNU General Public
License. It was one of the first IDEs to run under GNU Classpath and it runs without
problems under IcedTea.
Java is a set of computer software and specifications developed by James Gosling at Sun
Microsystems, which was later acquired by the Oracle Corporation, that provides a system
for developing application software and deploying it in a cross-platform computing
environment. Java is used in a wide variety of computing platforms from embedded
devices and mobile phones to enterprise servers and supercomputers. Java applets, which are
less common than standalone Java applications, were commonly run in
secure, sandboxed environments to provide many features of native applications through
being embedded in HTML pages.
Writing in the Java programming language is the primary way to produce code that will be
deployed as byte code in a Java virtual machine (JVM); byte code compilers are also
available for other languages, including Ada, JavaScript, Python, and Ruby. In addition,
several languages have been designed to run natively on the JVM, including Clojure, Groovy,
and Scala. Java syntax borrows heavily from C and C++, but object-oriented features are
modelled after Smalltalk and Objective-C.[11] Java eschews certain low-level constructs such
as pointers and has a very simple memory model where objects are allocated on the
heap (while some implementations e.g. all currently supported by Oracle, may use escape
analysis optimization to allocate on the stack instead) and all variables of object types
are references. Memory management is handled through integrated automatic garbage
collection performed by the JVM.
3.2.3 APACHE TOMCAT
Started in 1999 and developed as an open-source project by the Apache Software Foundation
(ASF), Apache Tomcat is a Java Servlet container, or web container, that provides the
extended functionality to interact with Java Servlets, while also implementing several
technical specifications of the Java platform: JavaServer Pages (JSP), Java Expression
Language (Java EL) and WebSocket.
But what is a Java Servlet? This is software that enables a web server to handle dynamic
Java-based web content using the HTTP protocol. JSP is a similar technology that allows
developers to create dynamic content using HTML or XML documents. In terms of their
ability to enable dynamic content, Java Servlets and JSP are broadly comparable to PHP or
ASP.NET, just based on the Java programming language.
By bringing all these Java-based technologies together, Tomcat offers a “pure Java” web
server environment for running applications built on the Java programming language.
HISTORY
Davidson had initially hoped that the project would become open-sourced and, since many
open-source projects had O'Reilly books associated with them featuring an animal on the
cover, he wanted to name the project after an animal. He came up with Tomcat since he
reasoned the animal represented something that could fend for itself. Although the tomcat
was already in use for another O'Reilly title,[12] his wish to see an animal cover eventually
came true when O'Reilly published their Tomcat book with a snow leopard on the cover in
2003.
3.3 Technology Used
3.3.1 CRYPTOGRAPHY
Types of Cryptography:
A. Symmetric Key Cryptography: it is an encryption framework where the
sender and the recipient of the data utilize a single key for both the
encryption and decryption of the data or message. These systems are
quicker and less complex but the main issue is that sender and receiver
need to exchange the key used in a very reliable and secure manner
because if the key gets in hand of an intruder, he or she can easily read or
even send messages to the receiver. Some notable examples of symmetric
key cryptographic systems are AES and DES.
B. Hash Functions: in hash functions no key is used for either encryption or
decryption, here for given plaintext message a hash value using a hash
function is calculated and this makes it impossible for contents of the
plaintext to be recovered. Hash functions actually are mathematical
functions, these are designed keeping in mind the problems of collision.
C. Asymmetric Key Cryptography: Under this framework a pair of keys is
utilised for encryption and decryption of the messages. One of the keys is
called as public key and other one is called as private key. Public key is
visible to everyone while private key resides with the receiver. The
message is encrypted with the use of public key and is decrypted with the
use of the private key. Even though public key is visible to everyone only
the intended receiver can see the actual contents of the message because
he alone has the access to the private key.
Fig. 2. Types of Cryptographic techniques
3.3.2 BLOCKCHAIN
Irreversible
Immutability
Some of the common applications of Blockchain are [28][29][30][31][32]:
Crypto currency like bitcoin
Blockchain-Internet of things
Financial services
Supply chain
Cyber security
Personal identification
Smart appliances
Asset management: settlement and trade processing
CHAPTER 4
DESIGN OF PROJECT
The most common Public Key Algorithm is RSA [1], named after its inventors
Rivest, Shamir and Adleman. RSA is basically an asymmetric decryption
algorithm. It is asymmetric in the sense that here the public key is distributed all
through the network and the private key which is used for decryption is kept
secret and is not shared to everyone.
The above calculation can be done quickly using the concept of Modular Exponentiation.
DECRYPTION
Decryption in RSA can be done as follows:
Thus by doing the above computation the original message “ m” sent by the
sender is obtained at the receiver’s end.
The string is encrypted with a unique form of the RSA encryption algorithm. The
geographic coordinates in the decimal degrees format of the device running the
encryption are used as a reference to obtain the pair of co-prime numbers required
for the algorithm; the greatest prime number smaller than or equal to 𝑥, where 𝑥 is
the figure obtained from when the decimal point is removed from the coordinate.
Doing this for the latitude and the longitude will produce two prime numbers, 𝑝
and 𝑞, i.e., the primes required for the algorithm. In the possible but unlikely
scenario that p and q are equal, the greatest prime preceding 𝑝 is used. The
number of digits used from the coordinate value are only limited by the accuracy
of the location services of the device and can be increased for improved security
by returning a larger prime number.
The result of the last step is a long character string. Another layer of security is
added by implementing blockchain on this string before its final transmission. The
string obtained from the previous step is divided into blocks of a predetermined
number of characters. A block consists of the current hash value, which is the
output of the AES encryption algorithm applied over the following strings: hash
of the previous block, current section of the encrypted string, device timestamp in
milliseconds, as well as a delimiter providing the information for the maximum
length of a section of the encrypted string used in one block. Hence, an encrypted
'block chain' is thus obtained the hash values of which can be plainly transmitted
over unsecure communication channels.
AES is a block cipher that uses a symmetric key. The data is divided in to blocks
of 128 bits for the encryption process. The size of the key used depends on the
number of rounds. If the number of rounds is 10 key size is 128 bits, if rounds are
12 key size is 192 bits and is the rounds are 14 key size is 256 bits. Here each
round uses a different key and the number of keys that are generated are 1 more
than the number of rounds and here the extra key belongs to the pre round
transformation.
7.1 Sub Bytes: Substitution box is applied on the input and is split in
bytes.
7.2 Shift Rows: Rows are now shifted to the left
7.4 AddRoundKey
8. Cipher text is generated in this step.
9. Steps 1 to 4 are performed in reverse order to perform decryption to
get
back the plaintext and also the keys are applied in reverse order.
4.2. Flow Chart
Fig. 6. Basic Flow of the application
4. The input credit card details; the card number, the expiration dates and the
card security codes are encoded one-on-one and onto predetermined
characters of the English alphabet by affine cipher. The corresponding
numeric character reference in Hypertext Markup Language (HTML) for
each of the characters is obtained as per the American Standard Code for
Information Interchange (ASCII) table. Here, a novel ciphering technique
is used; the Cross Language Cipher Technique, which further converts
each of the HTML strings for the English Language characters into those
corresponding to characters of other languages. This is a unique yet
simple cipher technique that adds a layer of added security and
complexity. Further, the Cross Language Cipher can be implemented
repeatedly as well as randomly over characters of multiple languages;
possibly encompassing the entire set of the Unicode standard. In this
particular model used as an example, the technique converts the HTML
numeric character reference into that corresponding to the characters of
the Hindi Language in the UTF-8 standard, which itself is mapped onto
the HTML numeric reference of the phonetically similar alphabets of the
French Language. This marks the end of the unique encoding technique
employed in the model, the result of which is a string of characters in the
HTML numeric reference in the decimal format.
5. This string is now encrypted with a unique form of the RSA encryption
algorithm. The coordinates of the physical location of the device running
the encryption are used as a reference to obtain the prerequisite prime
numbers for the encryption; the greatest prime numbers smaller than or
equal to a given number of digits of the figure denoting each of the
coordinate with the decimal point removed. The number of digits used
from the coordinate value are only limited by the accuracy of the location
services of the device and can be increased for improved security by
returning a larger prime number.
6. The result of the last step is a long character string. Another layer of
security is added by implementing blockchain on this string before its
final transmission. The string obtained from the previous step is divided
into blocks of a predetermined number of characters.
7. A block consists of the current hash value, which is the output of the AES
encryption algorithm applied over the the following strings:
a. hash of the previous block,
b. current section of the encrypted string,
c. device timestamp in milliseconds, as well as a delimiter
providing the information for the maximum length of a section
of the encrypted string used in one block.
Hence, an encrypted 'block chain' is thus obtained the hash values of
which can be plainly transmitted over unsecure communication channels.
Fig. 7. Basic Flowchart of the Implementation
CHAPTER 5
Results:
Screenshots of Working Project
In this work user’s geo location like latitude and longitude were used to get the
prime numbers p and q required in RSA algorithm, for further increase in security
of the encryption technique efforts can be done to get prime numbers that have a
larger length than the ones used currently. Moreover, databases connection to the
application using JDBC can also be done in future for the storage of card details.
This will help in authentication of hundreds of cards at any point of time.
REFERENCES
1. Rivest, R.; Shamir, A.; Adleman, L. (February 1978). "A Method for Obtaining
Digital Signatures and Public-Key Cryptosystems" (PDF). Communications of
the ACM. 21 (2): 120–126.
2. https://en.wikipedia.org/wiki/RSA_(cryptosystem)
3. https://www.di-mgt.com.au/rsa_alg.html
4. www.tutorialspoint.com/cryptography_with_python/
cryptography_with_python_understan ding_rsa_algorithm.htm
5. https://en.wikipedia.org/wiki/Advanced_Encryption_Standard
6. https://www.tutorialspoint.com/cryptography/advanced_encryption_standard.htm
7. https://en.wikipedia.org/wiki/Cryptography
8. https://www.geeksforgeeks.org/cryptography-and-its-types/
9. Esposito, Christian, Alfredo De Santis, Genny Tortora, Henry Chang, and Kim-
Kwang Raymond Choo. "Blockchain: A panacea for healthcare cloud-based
data security and privacy?." IEEE Cloud Computing 5, no. 1 (2018): 31-37.
10. Chatterjee, Rishav, and Rajdeep Chatterjee. "An Overview of the Emerging
Technology: Blockchain." In 2017 3rd International Conference on
Computational Intelligence and Networks (CINE), pp. 126-127. IEEE, 2017.
11. Halaburda, Hanna. "Economic and Business Dimensions: Blockchain
revolution without the blockchain." (2018).
12. Azaria, Asaph, Ariel Ekblaw, Thiago Vieira, and Andrew Lippman.
"Medrec: Using blockchain for medical data access and permission
management." In 2016 2nd International Conference on Open and Big Data
(OBD), pp. 25-30. IEEE, 2016.
13. Cachin, Christian. "Architecture of the hyperledger blockchain fabric." In
Workshop on distributed cryptocurrencies and consensus ledgers, vol. 310.
2016.
14. Nofer, Michael, Peter Gomber, Oliver Hinz, and Dirk Schiereck.
"Blockchain." Business & Information Systems Engineering 59, no. 3 (2017):
183-187.
15. Atlam, Hany F., and Gary B. Wills. "Technical aspects of blockchain and IoT."
(2018).
16. Pass, Rafael, and Elaine Shi. "Fruitchains: A fair blockchain." Proceedings
of the ACM Symposium on Principles of Distributed Computing. ACM, 2017.
17. Michael, JW, Alan Cohn, and Jared R. Butcher. "Blockchain Technology." The
Journal(2018).
18. Peters, Gareth W., and Efstathios Panayi. "Understanding modern banking
ledgers through blockchain technologies: Future of transaction processing and
smart contracts on the internet of money." Banking beyond banks and money.
Springer, Cham, 2016. 239-278.
19. Guo, Ye, and Chen Liang. "Blockchain application and outlook in the banking
industry." Financial Innovation 2, no. 1 (2016): 24.
20. Min, Hokey. "Blockchain technology for enhancing supply chain resilience."
Business Horizons 62, no. 1 (2019): 35-45.
21. Seebacher, Stefan, and Ronny Schüritz. "Blockchain technology as an
enabler of service systems: A structured literature review." In International
Conference on Exploring Ser-vices Science, pp. 12-23. Springer, Cham, 2017.
22. Korpela, Kari, Jukka Hallikas, and Tomi Dahlberg. "Digital supply chain
transformation toward blockchain integration." proceedings of the 50th Hawaii
international conference on system sciences. 2017.
23. Beck, Roman, Michel Avital, Matti Rossi, and Jason Bennett Thatcher.
"Blockchain tech- nology in business and information systems research."
(2017): 381-384.
24. Dorri, Ali, Salil S. Kanhere, Raja Jurdak, and Praveen Gauravaram.
"Blockchain for IoT security and privacy: The case study of a smart home." In
2017 IEEE International Conference on Pervasive Computing and
Communications Workshops (PerCom Workshops), pp. 618-623. IEEE, 2017.
25. https://medium.com/techracers/4-key-features-of-blockchain-5a4aff025d38
26. https://www.finyear.com/Eight-Key-Features-of-Blockchain-and-Distributed-
Ledgers- Explained_a35486.amp.html
27. https://data-flair.training/blogs/features-of-blockchain/amp/
28. https://blockgeeks.com/guides/blockchain-applications/
29. https://blockgeeks.com/guides/blockchain-applications-real-world/
30. https://www.fool.com/amp/investing/2018/04/11/20-real-world-
uses-for- blockchaintechnology.aspx
31. https://medium.com/technology-nineleaps/blockchain-simplified-part-2-
a42161e08762
32. https://execed.economist.com/blog/industry-trends/5-applications-
blockchain-your- business