Pramod Combined

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 67

VISVESVARAYA TECHNOLOGICAL UNIVERSITY BELAGAVI

590018, KARNATAKA.

Final Year Project Report Phase -2


on

“IMPLEMENTATIONOF SECURE DATA STORAGE IN BLOCKCHAIN


WITH NEAR-FIELD COMMUNICATION AUTHENTICATION”

Submitted in the partial fulfillment of the requirements for the award of Degree
B.E., In Computer Science & Engineering

PROJECT ASSOCIATE

PRAMOD C P 4BD17CS083

PROJECT GUIDES
Dr. Nirmala C R Ph.D., Dr. Ashoka K Ph.D.,
Professor & Head, Associate Professor,
Department of CS&E, Department of CS&E,
B.I.E.T, Davangere B.I.E.T, Davanagere

Department of Computer Science and Engineering.


Bapuji Institute of Engineering & Technology
Davanagere- 577004
2020-2021
Bapuji Institute of Engineering and Technology
Davanagere -577004

Department of Computer Science and Engineering

CERTIFICATE

This is to certify that PRAMOD C P bearing USN 4BD17CS083 of Computer Science and
Engineering department has satisfactorily submitted the Phase-II Project Report entitled
“IMPLEMENTATION OF SECURE DATA STORAGE IN BLOCKCHAIN WITH NEAR-FIELD
COMMUNICATION AUTHENTICATION” in the partial fulfillment of the requirements for the award of
Degree of Bachelor of Engineering (B.E) in Computer Science & Engineering under the VTU during the
academic year 2020-2021.

Dr. Ashoka K Dr. Roopa G.M Ph.D.


Project Guide Project Coordinator
Department of CS&E Department of CS&E
B.I.E.T Davanagere B.I.E.T Davanagere

Dr. Nirmala C.R Ph.D. Dr. H.B Aravind Ph.D.


Prof. & Head, Department of CS&E Principal, B.I.E.T
B.I.E.T Davanagere Davanagere

Date:
Place: Davanagere
Bapuji Educational Association (Regd.)
Bapuji Institute of Engineering and Technology, Davangere-577004
Department of Computer Science and Engineering

Vision and Mission of the Department

VISION
To be a center of excellence in imparting state-of-the-art technology in the field of Computer Science
and Engineering education enabling the students to become professionally sound and ethically strong.

MISSION
M1 Adapting best teaching and learning techniques that cultivates Questioning and
Reasoning culture among the students.
M2 Creating collaborative learning environment that ignites the critical thinking in
students and leading to the innovation.
M3 Establishing Industry Institute relationship to bridge the skill gap and make them
industry ready and relevant.
M4 Mentoring students to be socially responsible by inculcating ethical and moral values.

PROGRAM EDUCATIONAL OBJECTIVES (PEOs)


The graduates will be able to:

PEO1 To apply the skills acquired in the field of computer science and engineering in
solving the societal and industrial problems with technology intervention.
PEO2 To continue their career in industry, academia and to pursue higher studies and
research.
PEO3 To become successful entrepreneurs, innovators and job creators to design and develop
software products and services to meet the societal, technical and business challenges.

PEO4 To work in diversified environment by acquiring leadership qualities with strong


Communication skills along with professional and ethical values.
PROGRAM SPECIFIC OUTCOMES (PSOs)

PSO1 Analyze and develop solutions for problems that are complex in nature but applying the
knowledge acquired from the core subjects of this program.

PSO2 To develop secure, Scalable, Resilient and distributed applications for industry and
societal requirements.

PSO3 To learn and apply the concepts and construct of emerging technologies like Artificial
Intelligence, Machine learning, Deep learning, Big Data Analytics, IOT, Cloud
Computing etc. for any real time problems.
ACKNOWLEDGEMENT

Salutations to our beloved and highly esteemed institute, “BAPUJI INSTITUTE OF ENGINEERING
AND TECHNOLOGY” for having well qualified staff and labs furnished with necessary equipments.

I express my sincere thanks to our guide Dr. Ashoka K for giving me constant encouragement, support
and valuable guidance throughout the course of the project without whose stable guidance this project would
not have been achieved.

I express my sincere thanks to our coordinator Dr. Roopa G.M for giving me constant encouragement,
support and valuable guidance throughout the course of the project without whose stable guidance this project
would not have been achieved.

I express whole hearted gratitude to Dr. Nirmala C R who is our respectable H.O.D of Computer
Science & Engineering Department. I wish to acknowledge her help who made my task easy by providing with
her valuable help and encouragement.

I also express my whole hearted gratitude to our principal, Dr. H.B Aravind for his moral support and
encouragement.

I would like to extend my gratitude to all staff of Department of Computer Science and Engineering
for the help and support rendered to us. I have benefited a lot from the feedback, suggestions given by them. I
would like to extend my gratitude to all my family members and friends especially for their advice and moral
support.

PRAMOD C P 4BD17CS083
ABSTRACT

Blockchain secures a variety of IoT circumstance, when information or system validation information is
placed on a blockchain, personal data might be spilled through the affirmation of working system. This paper
observes a Zero-Knowledge proof for an awesome meter framework to illustrate the effectiveness of uncovered
information as an instance. This research work has pondered a way to enhance the obscurity of blockchain for
safety insurance. In addition to that, device Near-field communication (NFC) generation is used as a mobile
platform application. The fundamental idea of this research is to provide a secure service to a consumer through
mobile application using the near field communication card and Zero knowledge authentication system.
CONTENTS

TOPICS PAGE NO.

Chapter 1: INTRODUCTION 01
1.1 Existing System

Chapter 2: LITERATURE SURVEY 02-05


2.1 Summary of Literature Survey
2.2 Problem Statement
2.3 Proposed Solution
2.4 Objectives

Chapter 3: SOFTWARE REQUIREMENTS SPECIFICATION 06-09


3.1 Functional Requirements
3.2 Non-Functional Requirements
3.3 Hardware Requirements
3.4 Software Requirements

Chapter 4: SYSTEM DESIGN 10-18


4.1 System Architecture
4.2 Use Case Design
4.3 Data Flow Diagram
4.4 Sequence Diagram
4.5 NFC Technology & NFC sensing through android app
4.6 Module Description

Chapter 5: IMPLEMENTATION 19-42


5.1 Installation Steps
5.1.1 Java programming Language and Java Virtual Machine
5.2 Java Platform and following Features
5.3 Java SDK, ODBC, JDBC
5.4 MySQL and Servlets
5.5 Java Server Pages (JSP)
5.6 Android Architecture
5.7 Module Implementation
Chapter 6: TESTING 43-49
6.1 Software Testing Introduction
6.2 Explanation for SDLC & STLC
6.3 Phases of Software Development
6.4 Types of Testing
6.4.1 White Boxing Testing
6.4.2 Block Boxing Testing
6.4.3 Grey Box Testing
6.5 Levels of Testing
6.5.1 Unit Testing
6.5.2 Integrating Testing
6.5.3 System Testing
6.5.4 Functional Testing etc.

Chapter 7: SNAPSHOTS 50-54

CONCLUSION

FUTURE WORK

BIBLIOGRAPHY
LIST OF FIGURES

SL. NO. FIGURE NO. NAME PAGE NO.


01 4.1 System Architecture 10

02 4.2 Use Case Diagrams 11-12

03 4.3.1 Level 0 Data Flow Diagram 13

04 4.3.2 Level 1 and 2 Data Flow Diagram 14

05 4.4 Sequence Diagram 15

06 4.5 Class Diagram 16

07 5.1 Java Platform 21

08 5.2 Java SDK 23

09 5.7 Servlets Interface 28

10 5.10 JSP Model 29

11 5.13 Android System Architecture 34


Implementation Of Secure Data Storage In Block Chain with Near-Field Communication Authentication

CHAPTER 1

INTRODUCTION

The IoT is the abbreviation of the Internet of Things, which enables objects to share
and control data between objects because things are connected to the Internet. It is possible to
commit malicious attacks, such as data tampering, or privacy infringement, while sharing data
on objects over the Internet.
This project introduced a block chain to prevent security threats such as data
counterfeiting, which could occur using Mobile Financials. Zero-Knowledge proof, a block
chain anonymity enhancement technology and NFC, was introduced to prevent security threats
such as personal information infringement through block inquiry. It was proposed to use smart
contracts to prevent Mobile Financial wallet data forgery and personal information
infringement we suggest.

1.1 Existing System

Block chains with anonymity include Monero, Dash, ZCASH and so on. An
anonymous block chain is a block chain that makes it impossible to trace an account and
transaction contents, such as an account, etc., in order to prevent personal information
infringement. They implemented an anonymous block chain using different security
technologies. Monroe applied a technology to prevent tracing of existing bit coins with digital
assets using Cryptonote protocol. It used a special encryption technique called Ring Signatures,
One-time keys. It is very difficult for a third party to confirm the contents of a transaction
because the key is mixed in a certain group and a private key is required to confirm the
transaction.

Dept. of CS&E, B.I.E.T., Davanagere Page 1


Implementation Of Secure Data Storage In Block Chain with Near-Field Communication Authentication

CHAPTER 2

LITERATURE SURVEY

2.1 Summary of Literature Survey


1. A Survey on Smart Grid Potential Applications and Communication Requirements.
Information and communication technologies (ICT) represent a fundamental element in the
growth and performance of smart grids. A sophisticated, reliable and fast communication
infrastructure is, in fact, necessary for the connection among the huge amount of distributed
elements, such as generators, substations, energy storage systems and users, enabling a real
time ex-change of data and information necessary for the management of the system and for
ensuring improvements in terms of efficiency, reliability, flexibility and investment return for
all those involved in a smart grid: producers, operators and customers. This project overviews
the issues related to the smart grid architecture from the perspective of potential applications
and the communications requirements needed for ensuring performance, flexible operation,
reliability and economics.

2. Development of a Smart Power Meter for AMI Based on ZigBee Communication. Many
governments deploy ubiquitous IT project, which aims to combine the latest wireless network
and wide-band technologies etc. to accomplish a ubiquitous wireless communication network.
The ubiquitous wireless communication network can be utilized for the Advanced Metering
Infrastructure (AMI). Therefore, this project tries to use the new wireless communication
technologies to design and implement a ZigBee-based smart power meter. An outage recording
system is also designed and embedded into the smart meter. The microcontroller of Microchip
dsPIC30F series is used to develop the proposed smart power meter. A ZigBee system is then
deigned and integrated into the proposed power meter, and used to transmit the detailed power
consumption data and outage event data to rear-end processing system. The proposed smart
power meter cannot only be used for power consumption data collection but also for outage
event data recording. The proposed system has great potential to be used to build the area-
based AMI. Experimental results demonstrate the validity of the proposed system. Besides, the
application. ZigBee communication in power area may, expectedly, lead to make a definite
contribution to ubiquitous IT project.

Dept. of CS&E, B.I.E.T., Davanagere Page 2


Implementation Of Secure Data Storage In Block Chain with Near-Field Communication Authentication

3. Ethereum and the sec: why most distributed autonomous organizations are subject to the
registration requirements of the securities act of 1933 and a proposal for new regulation. In a
world full of new technology, the risk of fraud is constantly increasing. In the securities
industry, this risk existed long before the use of technology. Congress enacted the Securities
Act of 1933 to combat the risk of fraud and misrepresentation in the sale of securities. By
requiring full disclosure, investors have the opportunity to make informed decisions prior to
investing. However, Distributed Autonomous Organizations (“DAOs”), through the use of
blockchains and smart-contracts, engage in the sale of securities without fully disclosing the
risks or complying with the registration requirements of the Securities Act of 1933. Compliance
with the burdensome requirements of registration, however, would destroy this new technology
and method of conducting business. To avoid this set-back, Congress must amend the
registration requirements to provide an exemption for DAOs. This exemption, although
reducing current registration burdens, must still require DAOs to disclose certain information,
thereby ensuring investors are informed prior to investing. Furthermore, due to the unique
nature of the blockchain, smart contract, and DAOs, Congress must impose a fiduciary duty on
the creators of DAOs to ensure compliance with the disclosure requirements. Further, Congress
should consider the allowance of burden-shifting following the initial crowd sale.

4. The Use of Block Chain Technology in Different Application Domains. In this project, the
exciting possibilities that block chain technology offers in regards to decentralized trust-free
systems are investigated. More specifically this includes research of how block chain
technology can advantageously be utilized in different domains, from finance to more general
societal applications. On the basis of a small trust-based coffee shop, a proof of concept system
has been developed as a base point for an evaluation of the strengths and weaknesses of the
block chain technology. Clearly both are present, but they are much dependent on which cases
the technology is applied to. In the example of a coffee shop, the low maintenance, built in
security and ease of implementation are factors that speak for the utilization. On the other hand
the inconvenience of currency conversion and transaction time are drawbacks. On a more
general scale the security and trust-freeness of the technology is definitely features that allow
for it to be applied in a broad spectrum of applications. However, scalability, costs and
fluctuating currencies are hindrances. It is argued that block chain technology has the potential
to restore trust in the banking sector by introducing a level of transparency. The technology is
still young and suffers from teething troubles, but it is argued that as it matures it will have a
great impact in many areas of application.

Dept. of CS&E, B.I.E.T., Davanagere Page 3


Implementation Of Secure Data Storage In Block Chain with Near-Field Communication Authentication

5. Crypto-Assets Unencrypted with the recent surge in crypto-activity, a natural question arises
as to what exactly a “cryptocurrency” is and how to value and assess these digital assets. In
this project, we provide an overview of the history and technology underlying cryptocurrencies.
We also present information on the volume, size, and volatility of this emerging asset class,
which we compare to major fiat currencies and commodities. Finally, we provide a framework
for valuing crypto-assets, discuss the still-evolving regulatory environment for this asset class,
and discuss the mechanics of investing in cryptocurrencies.

2.2 Problem Statement


Internet of Things enables objects to share and control data between objects because
things are connected to the Internet. It is possible to commit malicious attacks, such as data
tampering, or privacy infringement, while sharing data on objects over the Internet.

2.3 Proposed Solution


As a proposed system environment, admin can control web server and Mobile Financial Wallet
App (MFWA) has to be installed in user’s android mobile phone. User transaction details which
he did mobile financial wallet app are send to webserver and it is stored in blockchain. User
can login mobile financial wallet app with the help of zero knowledge authentication using
NFC (Near Field Communication). To enter into MFWA, User has to provide his ID and tap
the NFC card on mobile. MFWA which can read hash code from NFC and send it to the web
server. Based on user ID, fetch the hash code (1) and compare to already stored hash code (2),
its correct means go to financial homepage. After login in mobile financial app user can see
wallet details transactions. In the mobile app user can give input transaction details and it will
send that to the web server.

Advantage of Proposed System

Using the zero knowledge proof authentication protocol, the public key is stored in the block
chain without storing the original data in the block chain, and the original data is stored in the
server database. When the proof is completed through the zero knowledge proof process
together with the public key stored in the block chain, the data is called so that the data can be
prevented from being modulated. It also protects your privacy because you do not put your
original data directly in the block chain.

Dept. of CS&E, B.I.E.T., Davanagere Page 4


Implementation Of Secure Data Storage In Block Chain with Near-Field Communication Authentication

2.4 Objectives
 To provide a secure service to a consumer through mobile application using the near
field communication card and Zero knowledge authentication system.
 To use the Zero Knowledge Proof protocol as the important building block of an
application to achieve privacy for the users, and enhance security of the system.
 To use NFC to add an extra layer of security in order to prevent data tampering.

Dept. of CS&E, B.I.E.T., Davanagere Page 5


Implementation Of Secure Data Storage In Block Chain with Near-Field Communication Authentication

CHAPTER 3

SOFTWARE REQUIREMENTS SPECIFICATION

A Software Requirements Specification (SRS) is a description of a software system to


be developed. It lays out function and non-functional requirements and may include set of use
cases that describe user interactions that the software must provide.

The System Requirements Specification is a formal statement of the application’s


functional and operational requirements. It serves as a contract between the developer and the
customer for whom the system is being developed.

3.1 Functional requirement

 The system should be web-based Application which has to be developed using


advanced Java technology with Tomcat web server and MySQL database server.
 This system has two applications one is mobile financial app. And another is web server
application which manages block chain process.
 This system has two Actors-Admin and End user.
 Admin is a main user who can able to login into his home page using authorized user
ID and password.
 Admin has to set block chain storage details and user information in web server
application.
 Admin has to set block chain storage details and user information in web server
application.
 There is another responsibility of admin he has to write credentials into user NFC card
using separate android app.
 The NFC card has to reach corresponding user safely.
 Once user receives NFC card then only he can able to login into mobile financial app.
 While user trying login he has to provide his user id and tap NFC card on NFC sensor
in the mobile.
 NFC sensor read the credentials from NFC card and gives to zero knowledge
authentication protocol.

Dept. of CS&E, B.I.E.T., Davanagere Page 6


Implementation Of Secure Data Storage In Block Chain with Near-Field Communication Authentication

 It is responsible of zero knowledge authentication system to validate the credential from


NFC card and the credential stored in block chain for the particular user same or not.
 Based on the test result it will take decision whether to allow the user into the home
page or not.
 Once user logged in into mobile app he can able to create transactions related to
financial details.
 All the financial transaction are converted into blocks and store in block chain server.

3.2 Non-functional requirement

Usability

Simple is the key here. The system must be simple that people like to use it, but not so
complex that people avoid using it. The user must be familiar with the user interfaces and
should not have problems in migrating to a new system with a new environment. The menus,
buttons and dialog boxes should be named in a manner that they provide clear understanding
of the functionality. Several users are going to use the system simultaneously, so the usability
of the system should not get affected with respect to individual users.

Reliability

The system should be trustworthy and reliable in providing the functionalities. Once a
user has made some changes, the changes must be made visible by the system. The changes
made by the Programmer should be visible both to the Project leader as well as the Test
engineer.

Performance

The system is going to be used by many employees simultaneously. Since the system
will be hosted on a single web server with a single database server in the background,
performance becomes a major concern. The system should not succumb when many users
would be using it simultaneously. It should allow fast accessibility to all of its users. For
example, if two test engineers are simultaneously trying to report the presence of a bug, then
there should not be any inconsistency while doing so.

Dept. of CS&E, B.I.E.T., Davanagere Page 7


Implementation Of Secure Data Storage In Block Chain with Near-Field Communication Authentication

Scalability

The system should be scalable enough to add new functionalities at a later stage. There should
be a common channel, which can accommodate the new functionalities.

Maintainability

The system monitoring and maintenance should be simple and objective in its approach. There
should not be too many jobs running on different machines such that it gets difficult to monitor
whether the jobs are running without errors.

Portability

The system should be easily portable to another system. This is required when the web server,
which s hosting the system gets stuck due to some problems, which requires the system to be
taken to another system.

Reusability

The system should be divided into such modules that it could be used as a part of another
system without requiring much of work.

Flexibility

The system should be flexible enough to allow modifications at any point of time.

Dept. of CS&E, B.I.E.T., Davanagere Page 8


Implementation Of Secure Data Storage In Block Chain with Near-Field Communication Authentication

3.3 Hardware Requirements


System : Pentium IV 2.4 GHz.

Hard Disk : 500 GB.

Ram : 4 GB

3.4 Software Requirements


Operating system : Windows XP / 7,8

Coding Language : Java (Jdk 1.7)

Web Technology : Servlet, JSP

Web Server : Tomcat 6.0

IDE : Eclipse Galileo

Database : My-SQL 5.0

UGI for DB : SQLyog

JDBC Connection : Type 4

Dept. of CS&E, B.I.E.T., Davanagere Page 9


Implementation Of Secure Data Storage In Block Chain with Near-Field Communication Authentication

CHAPTER 4
STSYEM DESIGN

4.1 System design


System Architecture design-identifies the overall hypermedia structure for the Web App.
Architecture design is tied to the goals establish for a Web App, the content to be presented,
the users who will visit, and the navigation philosophy that has been established. Content
architecture, focuses on the manner in which content objects and structured for presentation
and navigation. Web App architecture, addresses the manner in which the application is
structure to manage user interaction, handle internal processing tasks, effect navigation, and
present content. Web App architecture is defined within the context of the development
environment in which the application is to be implemented.

Fig 4.1 System Architecture

4.2 Use case diagrams


A use case is a set of scenarios that describing an interaction between a source and a
destination. A use case diagram displays the relationship among actors and use cases. The two
main components of a use case diagram are use cases and actors. shows the use case diagram.

Dept. of CS&E, B.I.E.T., Davanagere Page 10


Implementation Of Secure Data Storage In Block Chain with Near-Field Communication Authentication

4.2.1 Use case diagram Admin

Fig 4.2.1 Use Case Diagram Admin

4.2.2 Use case diagram Booth Admin (Web App)

Fig 4.2.2 Use Case Diagram Admin (Web App)

Dept. of CS&E, B.I.E.T., Davanagere Page 11


Implementation Of Secure Data Storage In Block Chain with Near-Field Communication Authentication

4.2.3 Use case diagram User (Android App)

Fig 4.2.3 Use Case Diagram User (Android App)

4.3 Data flow diagram

1. A data flow diagram (DFD) is graphic representation of the "flow" of data through an
information system. A data flow diagram can also be used for the visualization of data
processing (structured design). It is common practice for a designer to draw a context
level DFD first which shows the interaction between the system and outside entities.
DFD’s show the flow of data from external entities into the system, how the data moves
from one process to another, as well as its logical storage. There are only four symbols:
2. Squares representing external entities, which are sources and destinations of
information entering and leaving the system.
3. Rounded rectangles representing processes, in other methodologies, may be called
'Activities', 'Actions', 'Procedures', 'Subsystems' etc. which take data as input, do
processing to it, and output it.

Dept. of CS&E, B.I.E.T., Davanagere Page 12


Implementation Of Secure Data Storage In Block Chain with Near-Field Communication Authentication

4. Arrows representing the data flows, which can either, be electronic data or physical
items. It is impossible for data to flow from data store to data store except via a process,
and external entities are not allowed to access data stores directly.
5. The flat three-sided rectangle is representing data stores should both receive
information for storing and provide it for further processing.

4.3.1 Level 0 data flow diagram

Fig 4.3.1 Level 0 Data Flow diagram

Dept. of CS&E, B.I.E.T., Davanagere Page 13


Implementation Of Secure Data Storage In Block Chain with Near-Field Communication Authentication

4.3.2 Level1 data flow diagram

Fig 4.3.2 Level 1 Data Flow Diagram

4.3.3 Level2 data flow diagram

Fig 4.3.3 Level2 Data Flow Diagram

Dept. of CS&E, B.I.E.T., Davanagere Page 14


Implementation Of Secure Data Storage In Block Chain with Near-Field Communication Authentication

4.4 Sequence Diagram

A sequence diagram simply depicts interaction between objects in a sequential order i.e. the
order in which these interactions take place. We can also use the terms event diagrams or event
scenarios to refer to a sequence diagram. Sequence diagrams describe how and in what order
the objects in a system function.

Fig 4.4 Sequence Diagram

Dept. of CS&E, B.I.E.T., Davanagere Page 15


Implementation Of Secure Data Storage In Block Chain with Near-Field Communication Authentication

4.5 Class Diagram

In software engineering, a class diagram in the Unified Modeling Language (UML) is a type
of static structure diagram that describes the structure of a system by showing the
system's classes, their attributes, operations (or methods), and the relationships among objects.

Fig 4.5 Class Diagram

Dept. of CS&E, B.I.E.T., Davanagere Page 16


Implementation Of Secure Data Storage In Block Chain with Near-Field Communication Authentication

4.6 NFC Technology & NFC sensing through android app

 NFC Writing Algorithm (Tag):

NFC builds upon Radio-frequency identification (RFID) systems by allowing two-way


communication between endpoints, where earlier systems such as contactless smart cards were
one-way only .Since unpowered NFC tags can also be read by NFC devices, it is also capable
of replacing earlier one-way applications. In this module the User details like NFC Card no.,
Vehicle No, Date of Registration, Vehicle Type, Vehicle Model and Card Expiry Date will be
encrypted using Encryption key and dumped into the NFc tag, before dumping into the card
first data is Declare an Intent Filter to announce to the system that it’s enabled to work on
NFC. Have a method that Android will call when NFC is detected. Create a method to build a
NDEF message. Create a method to write the NDEF (NFC Data Exchange Format) message.

 NFC Reading Algorithm (Tag):

When the vehicle owner taps the card to android toll application, first encrypted data is
converted into original data with key and reading NDEF data from an NFC tag with language
convention English.

Blockchain Technology:

A block chain, originally block chain, is a growing list of records, called blocks, which are
linked using cryptography. Each block contains a cryptographic hash of the previous
block, a timestamp, and transaction data (generally represented as a merkle tree root hash).

Dept. of CS&E, B.I.E.T., Davanagere Page 17


Implementation Of Secure Data Storage In Block Chain with Near-Field Communication Authentication

4.7 Modules Description

Modules

 Admin Module

Admin has to login using id and password. After login admin can add users and display the
user details, admin can modify also. While adding user we admin is making hash code of that
user.

 NFC Writing Process

This admin android application is to write user information in to NFC tag.

 NFC Reading Process

In this user module user has to login using user id, if authentication is correct it has to navigate
to the home page, after that user can store their personal details.

 ZERO Knowledge Authentication

In this section when user is storing their personal details that time it will create metadata and it
will store in to database, based on that metadata only we can find the user personal details.

 Creating Block-chain

In this module user personal data will be store in to cloud as encrypted format, when user want
to download that data it has to decrypt and it will display to the user.

Dept. of CS&E, B.I.E.T., Davanagere Page 18


Implementation Of Secure Data Storage In Block Chain with Near-Field Communication Authentication

CHAPTER 5
IMPLEMENTATION

The implementation phase involves more than just writing code. Code also needs to be tested
and debugged as well as compiled and built into a complete executable product. We usually
need to utilize configuration management in order to keep track of different version of code.
This is the stage of the project where the theoretical design is turned into a working system. If
the implementation is not carefully planned and controlled, it can cause chaos and confusions.
It is always a good idea to keep in mind that some characteristics that should be found in a
good implementation like Readability- our code is written in MVC Architecture ,JAVA to
achieve the objective of the project that is to introduce a novel scheme of mechanism design
for balancing the resource consumptions .

Our implementation stage requires the following tasks:

 Careful planning

 Investigation of system and constraints

 Design of methods to achieve the changeover

 Evaluation of the changeover method

 Correct decisions regarding selection of the platform

 Appropriate selection of the language for application development

Java Technology Java technology is both a programming language and a platform.

THE JAVA PROGRAMMING LANGUAGE

The Java programming language is a high-level language that can be characterized by all of the
following buzzwords:

 Simple

 Architecture neutral

 Object oriented

Dept. of CS&E, B.I.E.T., Davanagere Page 19


Implementation Of Secure Data Storage In Block Chain with Near-Field Communication Authentication

 Portable

 Distributed

 High performance

 Interpreted

 Multithreaded

 Robust

 Dynamic

 Secure

With most programming languages, you either compile or interpret a program so that you can
run it on your computer. The Java programming language is unusual in that a program is both
compiled and interpreted. With the compiler, first you translate a program into an
intermediate language called Java byte codes —the platform-independent codes interpreted
by the interpreter on the Java platform. The interpreter parses and runs each Java byte code
instruction on the computer. Compilation happens just once; interpretation occurs each time
the program is executed.

You can think of Java byte codes as the machine code instructions for the Java Virtual Machine
(Java VM). Every Java interpreter, whether it’s a development tool or a Web browser that can
run applets, is an implementation of the Java VM. Java byte codes help make “write once, run
anywhere” possible. You can compile your program into byte codes on any platform that has
a Java compiler. The byte codes can then be run on any implementation of the Java VM. That
means that as long as a computer has a Java VM, the same program written in the Java
programming language can run on Windows 2000, a Solaris workstation, or on an iMac.

THE JAVA PLATFORM

A platform is the hardware or software environment in which a program runs. We’ve already
mentioned some of the most popular platforms like Windows 2000, Linux, Solaris, and
MacOS. Most platforms can be described as a combination of the operating system and
hardware. The Java platform differs from most other platforms in that it’s a software-only
platform that runs on top of other hardware-based platforms.

Dept. of CS&E, B.I.E.T., Davanagere Page 20


Implementation Of Secure Data Storage In Block Chain with Near-Field Communication Authentication

The Java platform has two components:

 The Java Virtual Machine (Java VM)

 The Java Application Programming Interface (Java API)

You’ve already been introduced to the Java VM. It’s the base for the Java platform and is
ported onto various hardware-based platforms. The Java API is a large collection of ready-
made software components that provide many useful capabilities, such as graphical user
interface (GUI) widgets. The Java API is grouped into libraries of related classes and interfaces;
these libraries are known as packages. The next section, What Can Java Technology Do?
Highlights what functionality some of the packages in the Java API provide.

The following figure depicts a program that’s running on the Java platform. As the figure
shows, the Java API and the virtual machine insulate the program from the hardware.

Fig 5.1 Java Platform

Native code is code that after you compile it, the compiled code runs on a specific hardware
platform. As a platform-independent environment, the Java platform can be a bit slower than
native code. However, smart compilers, well-tuned interpreters, and just-in-time byte code
compilers can bring performance close to that of native code without threatening portability.

The Importance of Java Technology for To Do This Project

The most common types of programs written in the Java programming language are applets
and applications. If you’ve surfed the Web, you’re probably already familiar with applets. An
applet is a program that adheres to certain conventions that allow it to run with in a Java-
enabled browser. However, the Java programming language is not just for writing cute,
entertaining applets for the Web. The general-purpose, high-level Java programming language
is also a powerful software platform. Using the generous API, you can write many types of
programs.

Dept. of CS&E, B.I.E.T., Davanagere Page 21


Implementation Of Secure Data Storage In Block Chain with Near-Field Communication Authentication

An application is a standalone program that runs directly on the Java platform. A special kind
of application known as a server serves and supports clients on a network. Examples of servers
are Web servers, proxy servers, mail servers, and print servers. Another specialized program is
a Servlets. A Servlets can almost be thought of as an applet that runs on the server side. Java
Servlets are a popular choice for building interactive web applications, replacing the use of
CGI scripts. Servlets are similar to applets in that they are runtime extensions of applications.
Instead of working in browsers, though, Servlets run within Java Web servers, configuring or
tailoring the server.

How does the API support all these kinds of programs? It does so with packages of software
components that provides a wide range of functionality. Every full implementation of the Java
platform gives you the following features:

 The Essentials: Objects, strings, threads, numbers, input and output, data structures,
system properties, date and time, and so on.

 Applets: The set of conventions used by applets.

 Networking: URLs, TCP (Transmission Control Protocol), UDP (User Data gram
Protocol) sockets, and IP (Internet Protocol) addresses.

 Internationalization: Help for writing programs that can be localized for users
worldwide. Programs can automatically adapt to specific locales and be displayed in
the appropriate language.

 Security: Both low level and high level, including electronic signatures, public and
private key management, access control, and certificates.

 Software components: Known as JavaBeans TM, can plug into existing component
architectures.

 Object serialization: Allows lightweight persistence and communication via Remote


Method Invocation (RMI).

 Java Database Connectivity (JDBC): Provides uniform access to a wide range of


relational databases.

Dept. of CS&E, B.I.E.T., Davanagere Page 22


Implementation Of Secure Data Storage In Block Chain with Near-Field Communication Authentication

 The Java platform also has APIs for 2D and 3D graphics, accessibility, servers,
collaboration, telephony, speech, animation, and more. The following figure depicts
what is included in the Java 2 SDK.

Fig 5.2 Java SDK

5.4 ODBC

Microsoft Open Database Connectivity (ODBC) is a standard programming interface for


application developers and database systems providers. Before ODBC became a de facto
standard for Windows programs to interface with database systems, programmers had to use
proprietary languages for each database they wanted to connect to. Now, ODBC has made the
choice of the database system almost irrelevant from a coding perspective, which is as it should
be. Application developers have much more important things to worry about than the syntax
that is needed to port their program from one database to another when business needs suddenly
change.

5.5 JDBC

In an effort to set an independent database standard API for Java; Sun Microsystems developed
Java Database Connectivity, or JDBC. JDBC offers a generic SQL database access mechanism
that provides a consistent interface to a variety of RDBMSs. This consistent interface is
achieved through the use of “plug-in” database connectivity modules, or drivers. If a database
vendor wishes to have JDBC support, he or she must provide the driver for each platform that
the database and Java run on.

Dept. of CS&E, B.I.E.T., Davanagere Page 23


Implementation Of Secure Data Storage In Block Chain with Near-Field Communication Authentication

SQL Level API

The designers felt that their main goal was to define a SQL interface for Java. Although not
the lowest database interface level possible, it is at a low enough level for higher-level tools
and APIs to be created. Conversely, it is at a high enough level for application programmers to
use it confidently. Attaining this goal allows for future tool vendors to “generate” JDBC code
and to hide many of JDBC’s complexities from the end user.

SQL Conformance

SQL syntax varies as you move from database vendor to database vendor. In an effort to
support a wide variety of vendors, JDBC will allow any query statement to be passed through
it to the underlying database driver. This allows the connectivity module to handle non-
standard functionality in a manner that is suitable for its users.

JDBC must be implemental on top of common database interfaces:

The JDBC SQL API must “sit” on top of other common SQL level APIs. This goal allows
JDBC to use existing ODBC level drivers by the use of a software interface. This interface
would translate JDBC calls to ODBC and vice versa.

Provide a Java interface that is consistent with the rest of the Java system

Because of Java’s acceptance in the user community thus far, the designers feel that they should
not stray from the current design of the core Java system.

JFree Chart

JFreeChart is a free 100% Java chart library that makes it easy for developers to display
professional quality charts in their applications. JFree Chart's extensive feature set includes: A
consistent and well-documented API, supporting a wide range of chart types; A flexible design
that is easy to extend, and targets both server-side and client-side applications; Support for
many output types, including Swing components, image files (including PNG and JPEG), and
vector graphics file formats (including PDF, EPS and SVG); JFree Chart is "open source" or,
more specifically, free software. It is distributed under the terms of the GNU Lesser General
Public License (LGPL), which permits use in proprietary applications.

Dept. of CS&E, B.I.E.T., Davanagere Page 24


Implementation Of Secure Data Storage In Block Chain with Near-Field Communication Authentication

1. Map Visualizations

2. Time Series Chart Interactivity

3. Dashboards

4. Property Editors

5.6 MySQL

MySQL is a relational database management system, which organizes data in the form of
tables. MySQL is one of many databases servers based on RDBMS model, which manages a
seer of data that attends three specific things-data structures, data integrity and data
manipulation. With MySQL cooperative server technology we can realize the benefits of open,
relational systems for all the applications. MySQL makes efficient use of all systems resources,
on all hardware architecture; to deliver unmatched performance, price performance and
scalability. Any DBMS to be called as RDBMS has to satisfy Dr. E.F.Codd’s rules.

FEATURES OF MYSQL

 Client/server architecture.

 Data independence.

 Ensuring data integrity and data security.

 Managing data concurrency.

 Parallel processing support for speed up data entry and online transaction processing
used for applications.

 DB procedures, functions and packages.

Dr. E.F.OCDD’s RULES

These rules are used for valuating a product to be called as relational database management
systems. Out of 12 rules, a RDBMS product should satisfy at least 8 rules +rule called rule 0
that must be satisfied.

Dept. of CS&E, B.I.E.T., Davanagere Page 25


Implementation Of Secure Data Storage In Block Chain with Near-Field Communication Authentication

RULE 0: FOUNDATION RULE:

For any system that is to be advertised as, or claimed to be relational DBMS. That system
should manage database with in self, without using an external language.

RULE 1: INFORMATION RULE

All information in relational database is represented at logical level in only one way as values
in tables.

RULE 2: GUARANTEED ACCESS:

Each and every data in a relational database is guaranteed to be logically accessibility by using
to a combination of table name, primary key value and column name

RULE 3: SYSTEMATIC TREATMENT OF NULL VALUES

Null values are supported for representing missing information and inapplicable information.
They must be handled in systematic way, independent of data types.

RULE 4: DYNAMIC ONLINE CATALOG BASED RELATION MODEL:

The database description is represented at the logical level in the same way as ordinary data so
that authorized users can apply the same relational language to its interrogation as they do to
the regular data.

RULE 5: COMPRHENSIVE DATA SUB LANGUAGE

A relational system may support several languages and various models of terminal use.
However there must be one language whose statement can express all of the following:

Data Definitions, View Definitions, Data Manipulations, Integrity, Constraints, Authorization


and transaction boundaries.

RULE 6: VIEW UPDATING

Any view that is theoretically that updatable if changes can be made to the tables that effect
the desired changes in the view.

Dept. of CS&E, B.I.E.T., Davanagere Page 26


Implementation Of Secure Data Storage In Block Chain with Near-Field Communication Authentication

RULE 7: HIGH LEVEL UPDATE, INSERT and DELETE

The capability of handling a base relational or derived relational as a single operand applies
not only retrieval of data also to its insertion, updating, and deletion.

RULE 8: PHYSICAL DATA INDEPENDENCE

Application program and terminal activities remain logically unimpaired whenever any
changes are made in either storage representation or access method.

RULE 9: LOGICAL DATA INDEPENDENCE

Application programs and terminal activities remain logically unimpaired whenever any
changes are made in either storage repres3entation or access methods.

RULE 10: INTEGRITY INDEPENDENCE:

Integrity constraints specific to particular database must be definable in the relational data
stored in the catalog, not in application program.

RULE 11: DISTRIBUTED INDEPENDENCE:

Whether or not a system support data base distribution, it must have a data sub-language that
can support distributed databases without changing the application program.

RULE 12: NON SUB-VERSION:

If a relational system has low level language, that low language cannot use to subversion or by
pass the integrity rules and constraints expressed in the higher level relational language.

MYSQL SUPPORTS THE FOLLOWING CODD’S RULES:

Rule 1: Information Rule (Representation of information)-YES.

Rule 2: Guaranteed Access-YES.

Rule 3: Systematic treatment of Null values-YES.

Rule 4: Dynamic on-line catalog-based Relational Model-YES.

Rule 5: Comprehensive data sub language-YES.

Rule 6: View Updating-PARTIAL.

Dept. of CS&E, B.I.E.T., Davanagere Page 27


Implementation Of Secure Data Storage In Block Chain with Near-Field Communication Authentication

Rule 7: High-level Update, Insert and Delete-YES.

Rule 8: Physical data Independence-PARTIAL.

Rule 9: Logical data Independence-PARTIAL.

Rule 10: Integrity Independence-PARTIAL.

Rule 11: Distributed Independence-YES.

Rule 12: Non-subversion-YES.

5.7 SERVLETS

Servlets provide a Java(TM)-based solution used to address the problems currently associated
with doing server-side programming, including inextensible scripting solutions, platform-
specific APIs, and incomplete interfaces.

Servlets are objects that conform to a specific interface that can be plugged into a Java-based
server. Servlets are to the server-side what applets are to the client-side -- object byte codes
that can be dynamically loaded off the net. They differ from applets in that they are faceless
objects (without graphics or a GUI component). They serve as platform-independent,
dynamically loadable, plug gable helper byte code objects on the server side that can be used
to dynamically extend server-side functionality.

The Servlets Interface

 The central abstraction in the Servlet API is the Servlet interface. All Servlets
implement this interface, either directly or, more commonly, by extending a class
that implements it such as HttpServlet.

Fig 5.8 Servlets Interface

Dept. of CS&E, B.I.E.T., Davanagere Page 28


Implementation Of Secure Data Storage In Block Chain with Near-Field Communication Authentication

 The Servlet interface declares, but does not implement, methods that manage the
servlet and its communications with clients. Servlet writers provide some or all of
these methods when developing a servlet.

5.10 Java Server Pages (JSP)

Java Server Pages technology lets you put snippets of servlet code directly into a text-based
document. A JSP page is a text-based document that contains two types of text: static template
data, which can be expressed in any text-based format such as HTML, WML, and XML, and
JSP elements, which determine how the page constructs dynamic content.

Java Server Page™ (JSP): An extensible Web technology that uses template data, custom
elements, scripting languages, and server-side Java objects to return dynamic content to a
client. Typically the template data is HTML or XML elements, and in many cases the client is
a Web browser.According to JSP model1 we can develop the application as,

Fig 5.10 JSP Model

According to above model the presentation logic has to be implemented in JSP page and the
business logic has to be implemented as part of Java bean This model help us in separating the
presentation and business logic. For large-scale projects instead of using model1 it is better to
use model2 (MVC). Struts framework is based on model 2.

Java Server Pages (JSP) lets you separate the dynamic part of your pages from the static HTML.
You simply write the regular HTML in the normal manner, using whatever Web-page-building
tools you normally use. You then enclose the code for the dynamic parts in special tags, most
of which start with "<%" and end with "%>". For example, here is a section of a JSP page that
results in something like "Thanks for ordering Core Web Programming

For URL of

http://host/OrderConfirmation.jsp?title=Core+Web+Programming:

Dept. of CS&E, B.I.E.T., Davanagere Page 29


Implementation Of Secure Data Storage In Block Chain with Near-Field Communication Authentication

Thanks for ordering

<I><%= request.getParameter("title") %></I>

You normally give your file a .jsp extension, and typically install it in any place you could
place a normal Web page. Although what you write often looks more like a regular HTML file
than a servlet, behind the scenes, the JSP page just gets converted to a normal servlet, with the
static HTML simply being printed to the output stream associated with the servlet's service
method. This is normally done the first time the page is requested, and developers can simply
request the page themselves when first installing it if they want to be sure that the first real user
doesn't get a momentary delay when the JSP page is translated to a servlet and the servlet is
compiled and loaded. Note also that many Web servers let you define aliases that so that a URL
that appears to reference an HTML file really points to a servlet or JSP page.

5.11 SQLYOG

SQLyog is a GUI tool for MariaDB and MySQL developed by Webyog, Inc. SQLyog works
on the Windows platform starting from Windows XP/Windows 2003 to Windows 8/Server
2008 R2.

The main features are:

 Schema and data synchronization

 SSH and HTTP tunneling

 Auto complete and SQL formatting

 Visual query builder

 Query profiler

 Data search

 Form view and FK lookup

 Schema optimizer and index analyzer

 Visual schema designer.

Dept. of CS&E, B.I.E.T., Davanagere Page 30


Implementation Of Secure Data Storage In Block Chain with Near-Field Communication Authentication

How does it work?

SQLyog is programmed and developed in C++ using Win32 API. No dependencies on runtimes
(.NET, Java etc.). It uses a local database to store internal data like grid settings. Consequently
these settings are persistent across sessions on a per-table basis.

Why use it?

 To save time writing queries with syntax checking

 To save time designing visually complex queries

MySQL Administrator

MySQL Administrator is a program for performing administrative operations, such as


configuring, monitoring and starting and stopping a MySQL server, managing users and
connections, performing backups, and a number of other administrative tasks. Most tasks can
be performed using a command-line client such as mysqladmin, or mysql, but MySQL
Administrator has the following advantages:

• Its graphical user interface makes it more intuitive.

• It provides a better overview of the settings that are crucial for the performance, reliability,
and security of your MySQL servers.

Server Information

Provides basic information about connection, server, and client.

• Connected to MySQL Server Instance Information about the parameters used to connect to
the MySQL server.

• USERNAME: Username used for the current connection to the MySQL server.

• HOSTNAME: The name of the machine hosting the MySQL server.

This is either identical to the name listed in NETWORK NAME, or it is localhost. The former
indicates that you are connecting to a server that either runs on a remote machine, or that you

Dept. of CS&E, B.I.E.T., Davanagere Page 31


Implementation Of Secure Data Storage In Block Chain with Near-Field Communication Authentication

have specified a host name different from localhost when connecting. The latter indicates that
the MySQL server runs on the same machine where MySQL Administrator runs.

• PORT: The port used for connecting to the MySQL server.

• Server Information about the MySQL server and its host.

• MYSQL VERSION: The version of the MySQL server.

• NETWORK NAME: The name of the machine hosting the MySQL server.

• IP: The IP number of the MySQL server host.

• Client Information

Information about MySQL Administrator and the host client.

• VERSION: The version of MySQL Administrator and the version number of the MySQL
client/server protocol.

• NETWORK NAME: The name of the host where MySQL Administrator runs.

• IP: The IP number of the MySQL Administrator host.

• OPERATING SYSTEM: Information about the operating system on which MySQL


Administrator runs.

• HARDWARE: Information about the hardware on which MySQL Administrator runs.

5.12 Android

Android is a software stack for mobile devices that includes an operating system, middleware
and key applications. The Android-SDK provides the tools and APIs necessary to begin
developing applications on the Android platform using the Java programming language.

On July 2005, Google announced the redemption of Android Inc. The Android team created
an operating system, named Android, based on the core of the operating system Linux. The
target of this operating system was the mobile phones market, where SymbianOS and Windows
Mobile dominated. The main benefit of Android is a rich library to enhance and ease

Dept. of CS&E, B.I.E.T., Davanagere Page 32


Implementation Of Secure Data Storage In Block Chain with Near-Field Communication Authentication

communication and networking. Java is offered to software developers as the main selection
for programming, enriched with software libraries developed by Google.

The first presentation of the Android platform was on November 5, 2007, along with the
establishment of Open Handset Alliance.

Android is a software stack for mobile devices that includes an operating system, middleware
and key applications. Google Inc. purchased the initial developer of the software, Android Inc.,
in 2005. Android's mobile operating system is based on the Linux kernel. Google and other
members of the Open Handset Alliance collaborated on Android's development and release.
The Android Open Source Project is tasked with the maintenance and further development of
Android. The Android operating system is the world's best-selling Smartphone platform. The
first truly open and comprehensive platform for mobile devices, all of the software to run a
mobile phone but without the proprietary obstacles that have hindered mobile innovation.

Why Android

Below are the reasons mentioned for choosing android.

 It is a simple, powerful SDK supporting GSM, EDGE, 3G networks, Wi-Fi, Bluetooth.

 It requires no licensing, distribution, or development fees.

 Development over many platform Linux, Mac OS, windows Excellent documentation

 Thriving developer community Java-based, easy to import 3rdparty Java library

 Funding (40+ G1 phones) Prize (amazon’s kindle) Job opportunity is tremendous

Dept. of CS&E, B.I.E.T., Davanagere Page 33


Implementation Of Secure Data Storage In Block Chain with Near-Field Communication Authentication

Android Architecture

Fig 5.13 System Architecture

Applications

Android will ship with a set of core applications including an email client, SMS program,
calendar, maps, browser, contacts, and others. All applications are written using the Java
programming language.

Application Framework

 By providing an open development platform, Android offers developers the ability to


build extremely rich and innovative applications. Developers are free to take advantage
of the device hardware, access location information, run background services, set
alarms, add notifications to the status bar, and much, much more.

 Developers have full access to the same framework APIs used by the core applications.
The application architecture is designed to simplify the reuse of components; any
application can publish its capabilities and any other application may then make use of
those capabilities (subject to security constraints enforced by the framework). This
same mechanism allows components to be replaced by the user.

Dept. of CS&E, B.I.E.T., Davanagere Page 34


Implementation Of Secure Data Storage In Block Chain with Near-Field Communication Authentication

Linux Kernel

Android relies on Linux version 2.6 for core system services such as security, memory
management, process management, network stack, and driver model. The kernel also acts as
an abstraction layer between the hardware and the rest of the software stack Android relies on
Linux version 2.6 for core system services such as security, memory management, process
management, network stack, and driver model. The kernel also acts as an abstraction layer
between the hardware and the rest of the software stack.

Android SDK 1.5

There are several new features and UI updates included in the 1.5 update:

 Ability to record and watch videos with the camcorder mode.

 Uploading videos to YouTube and pictures to Picasa directly from the phone.

 A new soft keyboard with an "Auto complete" feature.

 Bluetooth A2DP support which in turn broke Bluetooth connectivity with many popular
cars and headsets.

 Ability to automatically connect to a Bluetooth headset within a certain distance.

 New widgets and folders that can populate the Home screens.

Android Runtime

 Android includes a set of core libraries that provides most of the functionality available in
the Core libraries of the Java programming language.

 Every Android application runs in its own process, with its own instance of the Dalvik

 Virtual machine. Dalvik has been written so that a device can run multiple VMs efficiently.

 The Dalvik VM executes files in the Dalvik Executable (.dex) format which is optimized
for minimal memory footprint. The VM is register-based, and runs classes compiled by a
Java language compiler that have been transformed into the .decks format by the included
"dx" tool.

Dept. of CS&E, B.I.E.T., Davanagere Page 35


Implementation Of Secure Data Storage In Block Chain with Near-Field Communication Authentication

Fig 5.14 Android Architecture

Advantages and Disadvantages

There are a host of advantages that Google’s Android will derive from being open source
software. Some of the advantages include:

i. The ability for anyone to customize the Google Android platform will open up the
applications playing field to small and new players who lack the financial muscle to
negotiate with wireless carriers like AT&T and Orange. The consumer will benefit from
having a wide range of mobile applications to choose from since the monopoly will be
broken by Google Android.

ii. Although this will depend on the carrier, one will be able to customize a mobile phone
using Google Android platform like never before, right down to the screen. Features like
weather details, opening screen, live RSS feeds and even the icons on the opening screen
will be able to be customized.

iii. In addition, as a result of many mobile phones carrying Google Android, companies will
come up with such innovative products like the location– aware services that will provide
users with any information they might be in need of. This information could include
knowing the location of a nearby convenience store or filling station. In addition the
entertainment functionalities will be taken a notch higher by Google Android being able
to offer online real time multiplayer games.

Dept. of CS&E, B.I.E.T., Davanagere Page 36


Implementation Of Secure Data Storage In Block Chain with Near-Field Communication Authentication

5.15 Module Implementation

Admin

<%@page contentType="text/html" pageEncoding="UTF-8" import="java.sql.*"%>

<%@page import="java.sql.*"%>

<%@page import="com.data.*"%>

<%!

String user = "";

String pass = "";

boolean flag=true;

String info = "Opps,Something Went Wrong Try Again..";%><%

StringBuffer sb = new StringBuffer();

String user = request.getParameter("userId");

System.out.println("carddata======= "+user);

String pass = request.getParameter("password");

System.out.println("day======= "+pass);

flag = CommonDAO.Checkadmin(user,pass);

if(flag==true){

System.out.println("if"+flag);

sb.append(flag);}

else{

boolean flag=false;

System.out.println("else"+flag);

sb.append(flag);

Dept. of CS&E, B.I.E.T., Davanagere Page 37


Implementation Of Secure Data Storage In Block Chain with Near-Field Communication Authentication

}out.println(sb.toString());

%>

ADD Vehicle Details.

<%@page contentType="text/html" pageEncoding="UTF-8" import="java.sql.*"%>

<%@page import="java.sql.*"%>

<%@page import="com.data.*"%>

<%!

boolean flag=false;

String info = "Opps,Something Went Wrong Try Again..";%><%

if(request.getParameter("userId") != null){

StringBuffer sb = new StringBuffer();

//String userId = "1001";

String userId = request.getParameter("userId");

System.out.println("userId======= "+userId);

//String vehicleNo = "123545";

String vehicleNo = request.getParameter("vehicleNo");

System.out.println("vehicleNo======= "+vehicleNo);

//String vehicleDetails = "good";

String vehicleDetails = request.getParameter("vehicleDetails");

System.out.println("vehicleDetails======= "+vehicleDetails);

//String vehicleValue = "102354";

String vehicleValue = request.getParameter("vehicleValue");

System.out.println("vehicleValue======= "+vehicleValue);

Dept. of CS&E, B.I.E.T., Davanagere Page 38


Implementation Of Secure Data Storage In Block Chain with Near-Field Communication Authentication

//String policyNo = "123546";

String policyNo = request.getParameter("policyNo");

System.out.println("policyNo======= "+policyNo);

//String startDate = "19/01/2019";

String startDate = request.getParameter("startDate");

System.out.println("startDate======= "+startDate);

//String endDate = "19/01/2020";

String endDate = request.getParameter("endDate");

System.out.println("endDate======= "+endDate);

//String amount = "19900";

String amount = request.getParameter("amount");

System.out.println("amount======= "+amount);

//String company = "dhs";

String company = request.getParameter("company");

System.out.println("company======= "+company);

//String remark = "good";

String remark = request.getParameter("remark");

System.out.println("remark======= "+remark);

flag = UserDao.AddVehicle(userId, vehicleNo, vehicleDetails, vehicleValue,


policyNo, startDate, endDate, amount, company, remark);

out.println(flag);}

else{

out.println("No Value");}

Dept. of CS&E, B.I.E.T., Davanagere Page 39


Implementation Of Secure Data Storage In Block Chain with Near-Field Communication Authentication

%>

User check code

<%@page contentType="text/html" pageEncoding="UTF-8" import="java.sql.*"%>

<%@page import="java.sql.*"%>

<%@page import="com.data.*"%>

<%!

boolean flag=true;

String info = "Opps,Something Went Wrong Try Again..";%>

<%

if(request.getParameter("userId") != null){

StringBuffer sb = new StringBuffer();

String userid = request.getParameter("userId");

System.out.println("userid======= "+userid);

String hashCode = request.getParameter("hashCode");

System.out.println("hashCode======= "+hashCode);

flag = CommonDAO.CheckUser(userid, hashCode);

if(flag==true){

System.out.println("if"+flag);

sb.append(flag);}

boolean flag=false;

System.out.println("else"+flag);

Dept. of CS&E, B.I.E.T., Davanagere Page 40


Implementation Of Secure Data Storage In Block Chain with Near-Field Communication Authentication

sb.append(flag);

out.println(sb.toString());

%>

User Check

<%@page contentType="text/html" pageEncoding="UTF-8" import="java.sql.*"%>

<%@page import="java.sql.*"%>

<%@page import="com.data.*"%>

<%!

boolean flag=true;

String info = "Opps,Something Went Wrong Try Again.."%>

<%

if(request.getParameter("userId") != null){

StringBuffer sb = new StringBuffer();

String userid = request.getParameter("userId");

System.out.println("userid======= "+userid);

String hashCode = request.getParameter("hashCode");

System.out.println("hashCode======= "+hashCode);

flag = CommonDAO.CheckUser(userid, hashCode);

if(flag==true){

System.out.println("if"+flag);

Dept. of CS&E, B.I.E.T., Davanagere Page 41


Implementation Of Secure Data Storage In Block Chain with Near-Field Communication Authentication

sb.append(flag); }

else{

boolean flag=false;

System.out.println("else"+flag);

sb.append(flag);}

out.println(sb.toString());

}%>

Dept. of CS&E, B.I.E.T., Davanagere Page 42


Implementation Of Secure Data Storage In Block Chain with Near-Field Communication Authentication

CHAPTER 6

TESTING

6.1 SOFTWARE TESTING INTRODUCTION

Software testing is a process used to help identify the correctness, completeness and quality of
developed computer software. Software testing is the process used to measure the quality of
developed software .Testing is the process of executing a program with the intent of finding
errors. Software testing is often referred to as verification & validation

6.2 EXPLANATION FOR SDLC & STLC

SDLC: The software development life cycle (SDLC) is a conceptual model used in project
management that describes the stages involved in an information system development project,
from an initial feasibility study through maintenance of the completed application.

6.3 PHASES OF SOFTWARE DEVELOPMENT

 Requirement Analysis

 Software design

 Development or Coding

 Testing

 Maintenance

6.3.1 REQUIREMENT ANALYSIS

The requirements of a desired software product are extracted. Based the business scenario the
SRS (Software Requirement Specification) document is prepared in this phase.

6.3.2DESIGN
Plans are laid out concerning the physical construction, hardware, operating systems,
programming, communications, and security issues for the software. Design phase is concerned
with making sure the software system will meet the requirements of the product.

Dept. of CS&E, B.I.E.T., Davanagere Page 43


Implementation Of Secure Data Storage In Block Chain with Near-Field Communication Authentication

There are 2 stages in design,

HLD – High Level Design

LLD – Low Level Design

HLD – gives the architecture of the software product to be developed and is done by architects
and senior developers.

LLD – done by senior developers. It describes how each and every feature in the product should
work and how every component should work. Here, only the design will be there and not the
code.

6.3.3TESTING
Testing is evaluating the software to check for the user requirements. Here the software is
evaluated with intent of finding defects.

6.4 SDLC MODELS

6.4.1 WATER FALL MODEL

It will be executing one by one of the SDLC process. The design Starts after completing the
requirements analysis coding begins after design. It is a traditional model It is a sequential
design process, often used in SDLC, in which the progress is seen as flowing steadily
downwards ( like a waterfall ), through the different phases.

6.4.2 PROTO TYPE MODEL

Developed from the sample after getting good feedback from the customer. This is the
Valuable mechanism for gaining better understanding of the customer needs

6.4.3 RAPID APPLICATION DEVELOPMENT MODEL(RAD)

This mechanism will develop from already existing one. If The New requirement is matching
in already existing requirement, will develop from that.

6.4.4 SPIRAL MODEL

This mechanism is update the application version by version. All the SDLC process will update
version by version.

Dept. of CS&E, B.I.E.T., Davanagere Page 44


Implementation Of Secure Data Storage In Block Chain with Near-Field Communication Authentication

6.4.5 V-MODELV

V model is a process where the development and testing phases can do parallely. For every
development phase there is a testing phase. Development phases are called as verification
whereas testing phases are called as validation.

6.4.6 STLC (Software Testing Life Cycle)

Testing itself has many phases i.e. is called as STLC. STLC is part of SDLC
•Test Plan
•Test Development
•Test Execution
•Analyze Results
•Defect Tracking
• Summaries Report

6.5.1 TEST PLAN

It is a document which describes the testing environment, purpose, scope, objectives, test
strategy, schedules, mile stones, testing tool, roles and responsibilities, risks, training, staffing
and who is going to test the application, what type of tests should be performed and how it will
track the defects.

6.5.2 TEST DEVELOPMENT

Preparing test cases, test data, Preparing test procedure, Preparing test scenario, Writing test
script

6.5.3 TEST EXECUTION

In this phase we execute the documents those are prepared in test development phase

6.5.4 ANALYZE RESULT

Once executed documents will get results either pass or fail. we need to analyze the results
during this phase.

6.6 TYPES OF TESTING

White Box Testing

Black Box Testing

Dept. of CS&E, B.I.E.T., Davanagere Page 45


Implementation Of Secure Data Storage In Block Chain with Near-Field Communication Authentication

Grey box testing

6.6.1WHITEBOXTESTING
White box testing as the name suggests gives the internal view of the software. This type of
testing is also known as structural testing or glass box testing as well, as the interest lies in what
lies inside the box.

6.6.2 BLACK BOX TESTING

It is also called as behavioral testing. It focuses on the functional requirements of the software.
Testing either functional or non-functional without reference to the internal structure of the
component or system is called black box testing.

6.6.3 GREY BOX TESTING

Grey box testing is the combination n of black box and white box testing. Intention of this
testing is to find out defects related to bad design or bad implementation of the system.

Testing Used For Web Based Application

This is done for 3 tier applications (developed for Internet / intranet /Extranet).Here we will be
having Browser, web server and DB server. The applications accessible in browser would be
developed in HTML, DHTML, XML, JavaScript etc. (We can monitor through these
applications)

6.7 LEVEL OF TESTING USED IN PROJECT

6.7.1 UNIT TESTING

Initialization testing is the first level of dynamic testing and is first the responsibility of
developers and then that of the test engineers. Unit testing is performed after the expected test
results are met or differences are explainable/acceptable.

6.7.2 INEGRATION TESTING

All module which makes application are tested. Integration testing is to make sure that the
interaction of two or more components produces results that satisfy functional requirement.

Dept. of CS&E, B.I.E.T., Davanagere Page 46


Implementation Of Secure Data Storage In Block Chain with Near-Field Communication Authentication

6.7.3 SYSTEM TESTING To test the complete system in terms of functionality and non-
functionality. It is black box testing, performed by the Test Team, and at the start of the system
testing the complete system is configured in a controlled environment.

6.7.4 FUNCTIONAL TESTING

The outgoing links from all the pages from specific domain under test. Test all internal links.
Test links jumping on the same pages. Check for the default values of fields. Wrong inputs to
the fields in the forms.

6.7.5 ALPHA TESTING

Alpha testing is final testing before the software is released to the general public. This testing
is conducted at the developer site and in a controlled environment by the end user of the
software.

6.7.6 BETA TESTING

The beta test is conducted at one or more customer sites by the end user of the software. The
beta test is conducted at one or more customer sites by the end user of the software.

6.8 UNIT TESTING CASES

Initialization testing is the first level of dynamic testing and is first the responsibility of
developers and then that of the test engineers. Unit testing is performed after the expected test
results are met or differences are explainable/acceptable.

6.9 SYSTEM TESTING

To test the complete system in terms of functionality and non-functionality. It is black box
testing, performed by the Test Team, and at the start of the system testing the complete system
is configured in a controlled environment.

Dept. of CS&E, B.I.E.T., Davanagere Page 47


Implementation Of Secure Data Storage In Block Chain with Near-Field Communication Authentication

6.10 FUNCTIONAL TESTING

It is a quality assurance (QA) process and a type of black-box testing that bases its test cases
on the specifications of the software component under test. Functions are tested by feeding
them input and examining the output, and internal program structure is rarely considered
(unlike white-box testing).

Test Case Test Input Expected Result Actual Result Remarks


Id

PAS_01 In Admin The admin should The admin is Pass


Enter be navigated to navigated to the
username and admin homepage homepage
password
click on
submit button

In Admin It should create It is creating hash Pass


Enter user id, hash code and code and
PAS_02 user name, register user registering user
phone details into details into
number, email database database
id, etc. and
click on
submit button

Dept. of CS&E, B.I.E.T., Davanagere Page 48


Implementation Of Secure Data Storage In Block Chain with Near-Field Communication Authentication

In user User has to type User is typing Pass


android there user id and user-id and tapping
PAS_03
section enter tap NFC card to NFC card to their
user id and their mobile and it mobile and it is
tap NFC card has to validate the validating the user
to validate user
user details

In user From user android From user android Pass


android application all application all
PAS_04 section enter details has to store details it is storing
insurance into the block into the
details fixed chain. blockchain.
deposit details

6.11 INTEGRATION TESTING

The outgoing links from all the pages from specific domain under test. Test all internal links.
Test links jumping on the same pages. Check for the default values of fields. Wrong inputs to
the fields in the forms.

Dept. of CS&E, B.I.E.T., Davanagere Page 49


Implementation Of Secure Data Storage In Block Chain with Near-Field Communication Authentication

CHAPTER 7

SNAPSHOTS
7.1.1 Admin Login

Fig 7.1.1 Admin Login

7.1.2 Add User

Fig 7.1.2 Add User

Dept. of CS&E, B.I.E.T., Davanagere Page 50


Implementation Of Secure Data Storage In Block Chain with Near-Field Communication Authentication

7.1.3View User

Fig 7.1.3View User

7.1.4 Edit User

Fig 7.1.4 Edit User

Dept. of CS&E, B.I.E.T., Davanagere Page 51


Implementation Of Secure Data Storage In Block Chain with Near-Field Communication Authentication

7.1.5 Delete User

Fig 7.1.5 Delete User

7.1.6 User Login

Fig 7.1.6 User Login

Dept. of CS&E, B.I.E.T., Davanagere Page 52


Implementation Of Secure Data Storage In Block Chain with Near-Field Communication Authentication

7.1.7 Home

Fig 7.1.7 Home

7.1.8 Add Details

Fig 7.1.8 Add Details

Dept. of CS&E, B.I.E.T., Davanagere Page 53


Implementation Of Secure Data Storage In Block Chain with Near-Field Communication Authentication

7.1.9 View Details

Fig 7.1.9 View Details

Dept. of CS&E, B.I.E.T., Davanagere Page 54


CONCLUSION
A secure mobile application-based data mining is proposed in the research work through
block chain technology. To ensure the security the IoT devices, the generated data are stored
in cloud storage through block chain which provides better security. Similarly, the data
collected through mobile application retrieved from cloud through zero knowledge proof
technique which is achieved using near field communication cards. To illustrate the proposed
model, financial application is used as an example in the experimentation process. The
proposed model achieves better security over IoT data which is suitable for various
applications.
FUTURE WORK
o Improving by applying in Real time application.

o Creating Web based application which can run on browser.

o Support For Sending Images or Document.


BIBLIOGRAPHY

1. J. Demuro, “Here Are the 10 Sectors That Blockchain Will Disrupt Forever,” TechRadar
Pro, 16 Jan. 2018; https://www.techradar.com/news /here-are-the-10-sectors-that -blockchain-
will-disrupt-forever.

2. B. Dickson, “Blockchain Tech Could Fight Voter Fraud—and These Countries Are Testing
It,” VentureBeat, 22 Oct. 2016; https://venturebeat .com/2016/10/22/blockchain

tech-could-fight-voter-fraud-and these-countries-are-testing-it.

3. J. Hall, “Can Blockchain Technology Solve Voting Issues?” Bitcoin Magazine, 7 Mar. 2018;
https://www.nasdaq.com/article/can-blockchain technology-solve-voting-issuescm931347.

4. A. Sandre, “Blockchain for Voting and Elections,” Hackernoon, 14 Jan.

2018; https://hackernoon.com /blockchain-for-voting-and-elections-9888f3c8bf72.

5. G. Prico, “Sierra Leone Pilots Blockchain-Based Voting for Political

Elections,” 22 Mar. 2018; https://www.nasdaq.com/article/sierra-leone-pilots-blockchain-


based-voting-for-political-elections-cm938309.

6. B. Miller, “Blockchain Voting Startup Raises $2.2M,” Government Technology, 8 Jan. 2018;
http://www.govtech.com/biz/Blockchain-Voting-Startup-Raises-22M.html.

7. A. Perala, “Voatz Raises $2.2 Million in Seed Funding,” Mobile ID World,

9 Jan. 2018; https://mobileidworld.com/voatz-seed-funding-901093.

8. M. Hochstein, “Moscow’s Blockchain Voting Platform Adds Service for High-Rise


Neighbors,” CoinDesk, 15 Mar. 2018; https://www.coindesk .com/moscows-blockchain-
voting platform-adds-service-for-high-rise neighbors.

9. “Digital Home Blockchain Voting System, Active Citizen in MoscowOpens,”


BitccoinExchangeGuide.com; https://bitcoinexchangeguide.com/digital-home-blockchain-
voting-system-active-citizen-in-moscow-opens.

10. M.D. Castillo, “Russia Is Leading the Push for Blockchain Democracy,” CoinDesk, 2018;
https://www.coindesk.com/russias-capital.

You might also like