0% found this document useful (0 votes)
27 views

Final Doucmennt

This document describes a project that proposes implementing a cryptography technique using Fernet to secure sensitive information for a client's biofuel production process in order to prevent data breaches, and uses a classification algorithm to recommend fuel types to reduce human workload. The project involves designing cryptographic algorithms and protocols to protect communications and ensure data intercepted or tampered with is encrypted.

Uploaded by

bernandas17
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views

Final Doucmennt

This document describes a project that proposes implementing a cryptography technique using Fernet to secure sensitive information for a client's biofuel production process in order to prevent data breaches, and uses a classification algorithm to recommend fuel types to reduce human workload. The project involves designing cryptographic algorithms and protocols to protect communications and ensure data intercepted or tampered with is encrypted.

Uploaded by

bernandas17
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 60

CIPHER AND DECIPHER USING

CRYPTOGRAPHY FERNET APPLICATION


FOR SECURE DATA

By

GEORGE BERNANDAS A
Register No. 921321622013

A project report submitted to the

FACULTY OF INFORMATION AND COMMUNICATION


ENGINEERING

In partial fulfillment of the requirements


for the award of the degree of

MASTER OF COMPUTER APPLICATIONS

PSNA COLLEGE OF ENGINEERING AND TECHNOLOGY


(AUTONOMOUS)
DINDIGUL – 624 622

ANNA UNIVERSITY, CHENNAI

AUGUST 2023
BONAFIDE CERTIFICATE

Certified that this project report titled CIPHER AND DECIPHER USING

CRYPTOGRAPHY-FERNET APPLICATION FOR SECURE DATA is the

bonafide work of Mr. GEORGE BERNANDAS A (Reg. No:921321622013) who

carried out the work under my supervision. Certified further that to the best of my

knowledge and belief, the work reported herein does not form part of any other project

report or dissertation on the basis of which a degree or an award was conferred on an

earlier occasion on this or any other candidate.

Place: PSNACET Dr. N. RAJKUMAR, M.C.A., M.Phil., Ph.D.,


Date: Supervisor
Associate Professor
Department of MCA
PSNA College of Engineering and Technology
Dindigul – 624 622

COUNTERSIGNED

Dr. P. JAGANATHAN, M.C.A., Ph.D.,


Professor & Head
Department of MCA
PSNA College of Engineering and Technology
Dindigul – 624 622

ii
ANNA UNIVERSITY - CHENNAI 600 025

VIVA VOCE EXAMINATION

The Viva Voce Examination of this project work submitted by


GEORGE BERNANDAS A (Reg. No.:921321622013), was held on …………...

INTERNAL EXAMINER EXTERNAL EXAMINER

iii
ABSTRACT

The science of information security is called cryptography. The word is


a translation of the Greek word cryptos, which means hidden. Microdots, fusing
words and images, and other methods of obscuring information in storage or
transit are only a few examples of the techniques used in cryptography. Electrical
engineering, computer science, and mathematics all converge in modern
cryptography. Among the uses for cryptography are electronic commerce,
computer passwords, and ATM cards. There are open- source cryptography
projects that provide security for a variety of applications. In our project, this
propose that usage of cryptography algorithm. Which is used for security
purposes when the data is received and the data will be further encrypted and it
will secure the information until the data is decrypted when the situation arises.
This usage of cryptography algorithm which is used for security purposes when
the data is received and the data will be further Encrypted and it will secure the
information until the data is decrypted when the situation arises. In our project,
this propose the implementation of a cryptography algorithm to secure sensitive
information in an organization.
In our case, this project propose the implementation of a cryptography
technique to secure the biofuel production process requested by the client in order
to prevent data breach using fernet technology and the use of a classification
algorithm to reduce the workload of humans by providing the requested client with
a confidential fuel type. These Cryptography projects implement cryptographic
algorithms and protocols that are designed to protect communications and data
from being intercepted or tampered with in cryptography fernet algorithm
guarantees 'when the decryption read without the key also support the
implementation of key rotation via multi fernet.

v
ACKNOWLEDGEMENT

I express my sincere thanks to Tmt. K. DHANALAKSHMI AMMAL,

Chairperson and Rtn. MPHF. R.S.K. RAGURAAM D.A.E., M. Com, Pro-Chairman for

permitting us to utilize all the necessary facilities of this institution.

I express my gratitude to our Principal Dr. D. VASUDEVAN, M.E., Ph.D., for

his guidance and advice to shape myself for the future career.

I convey my earnest thanks to Dr. P. JAGANATHAN, M.C.A., Ph.D., Professor

and Head, Department of Computer Applications, PSNA College of Engineering and

Technology for his invaluable guidance, support and suggestions throughout the course of

this project work.

I am highly indebted to Dr. N. RAJKUMAR MCA., M.Phil., Ph.D., Associate

professor, Department of Computer Applications, PSNA College of Engineering and

Technology for her suggestions and constructive criticisms during the course of my

project.

I would not forget to remember Mr. J. SARATHKUMAR, of SHIASH INFO

TECHNOLOGIES, Chennai for his encouragement and more over for his timely

support and guidance.

I am thankful to all teaching and non-teaching staff of this Department who helped

me in successfully completing my project work. Last but not the least, I am grateful to my

parents and friends for their constant support and encouragement.

vi
TABLE OF CONTENTS

CHAPTER NO. TITLE PAGE NO.

ABSTRACT v
ACKNOWLEDGEMENT vi
LIST OF TABLES ix
LIST OF FIGURES x
LIST OF ABBREVIATIONS ix

1 INTRODUCTION 1
1.1 PROBLEM STATEMENT 1

1.2 CHALLENGES 2

1.3 AIM OF THE PROJECT 2

1.4 CHAPTER PLAN 2

1.5 LITERATURE SURVEY 2

2 SYSTEM ANALYSIS 4
2.1 EXISTING STSTEM 4

2.2 PROPOSED SYSTEM 5

2.3 REQUIREMENT GATHERING 6

2.4 COMPANY PROFILE 6

3 SYSTEM DESIGN 8
3.1 UML DIAGRAM 8

3.2 MODULES 16

3.3 DATABASE DESIGN 18

4 IMPLEMENTATION 22
4.1 BACKGROUND STUDY 22
4.2 IMPLEMENTATION 22

vii
5 SYSTEM TESTING 25
5.1 TESTING 25
5.2 TEST CASE 28
5.3 OUTCOME OF THE TEST 29

6 CONCLUDION 30
6.1 CONCLUSION 30
6.2 FUTURE ENHANCEMENT 30

APPENDIX A: Screen Shots


APPENDIX B: Sample Code
REFERENCES

viii
LIST OF TABLES

TABLE NO. TABLE NAME PAGE NO.

3.1 Client Home 19


3.2 Admin Table 19
3.3 Manager Table 20
3.4 Processing Team 21
3.5 Distributor Table 21
5.1 Test Case 28

ix
LIST OF FIGURES

FIGURE NO. NAME PAGE NO.


3.1 Use Case Diagram For Client 9

3.2 System Architecture For DataBase 10


3.3 ER Diagram For Encrypt And Decrypt 11
3.4 Data Flow Diagram for Client 12
3.5 Data Flow Diagram for Process Team 12
3.6 Data Flow Diagram for Logout 13
3.7 Sequence Diagram For Trained Data 14
3.8 Class Diagram For Distributor Model 15
5.1 Testing Users 26
5.2 Outcome of the Test for process 1 29
5.3 Outcome of the Test for Process 2 29
5.4 Outcome of the Test for Quantity 29

x
LIST OF ABBREVIATIONS

ACRONYM ABBREVIATIONS
HTML Hypertext Markup Language
HMAC Hash Based Message Authentication Code
SETL State Eligibly Test Language
ATM Automated Teller Machine
AES Advanced Encryption Standard
UML Unified Modeling Language
ABC American Broadcasting Company
MFA Master Of Fine Art
HSM Hardware Security Module
ERD Entity Relationship Diagram
WSGI Web Server Gateway Interface
BSD Berkeley Software Distribution
ISO International Organization for Standardization
CMS Content Management System
DSF Differential Scanning Fluorimetry
MVC Model View Controller
HMAC Hash based Message Authentication Code
CBC Complete Blood count

xi
CHAPTER 1

INTRODUCTION

Cryptography is the name of the field that studies information security. The word is a
translation of the hidden-meaning Greek word kryptos. The techniques employed in
cryptography include employing microdots, combining words and images, and other means of
disguising information while it is being stored or transported. Modern cryptography combines
elements of mathematics, computer science, and electrical engineering. Computer passwords,
ATM cards, and electronic commerce are a few applications for cryptography. There are efforts
for open source cryptography that offer security for many purposes. In our project, this suggest
using a cryptography technique that is employed for security purposes when the data is
received, the data is further encrypted, and the information is secured until the data is decoded
when the situation calls for it. In our project, this suggest putting a cryptography method into
practise to protect sensitive data within an enterprise. In this instance, this suggest using fernet
technology to implement a cryptography technique to secure the biofuel production process
that the client requested in order to prevent data breaches, as well as a classification algorithm
to lessen the workload of humans by giving the requested client a secret fuel type. The
cryptographic techniques and protocols used in these projects are intended to prevent
communicates Aons and data from being intercepted or altered. The fernet algorithm assures
that "when the decryption read without the key also support the implementation of key rotation
via multi fernet . The cryptographic techniques and protocols used in these projects are intended
to prevent communications and data from being intercepted or altered.

1.1 PROBLEM STATEMENT

A strongly encrypted, authentic, and digitally signed information can be difficult to


access even for a legitimate user at a crucial time of decision-making. The network or the
computer system can be attacked and rendered non-functional by an intruder. High availability,
one of the fundamental aspects of information security, cannot be ensured through the use of
cryptography. Other methods are needed to guard against the threats such as denial of service
or complete breakdown of information system.

1
1.2 CHALLENGES

 Securing valid data’s from unauthorized users


 Increased Productivity
 Encrypt the users valid data
 Analyse & Predict recommended result

1.3 AIM OF THE PROJECT

The aim of the project to implement encryption and decryption using the cryptography
library and Fernet application is to ensure secure communication and data protection. By using
encryption, sensitive information can be transformed into an unreadable format, making it
difficult for unauthorized individuals to access or understand the data. Decryption allows
authorized individuals to retrieve the original data from the encrypted format. The Fernet
application, which is part of the cryptography library, utilizes symmetric encryption, where the
same secret key is used for both encryption and decryption. This approach provides a simple
and efficient way to secure data.

1.4 CHAPTER PLAN

Chapter Introduction deals with overview of the project which comprises of problem
statement, challenges faced in the project and aim of the project. Chapter 2, System analysis is
followed by chapter 1 which deals with requirement gathering, existing system of our project
and proposed system of our project. Chapter 3, System design is followed by chapter 2 which
depicts module description, database design and UML diagram. Next Chapter 4,
implementation depicts frontend, backend software and steps to install the proposed software.
Last Chapter, Chapter 5 – Testing deals with testing and future proposal of our project.

1.5 LITERATURE SURVEY

A literature survey, also known as a literature review, is a critical and comprehensive


summary and analysis of published academic and research literature on a specific topic. It aims
to provide a thorough understanding of the current state of knowledge, the gaps in research,
and the latest developments in the chosen field.

2
Here are the key steps involved in conducting a literature survey

 Define the Research Question: Clearly define the scope and objectives of your literature
survey. Decide on the specific topic or research question you want to explore.
 Search for Relevant Literature: Use academic databases, digital libraries, and search
engines to find peer-reviewed research papers, conference proceedings, books, and
other scholarly sources related to your topic.
 Evaluate the Sources: Assess the quality and credibility of the sources you find. Focus
on reputable journals and publications from recognized researchers and institutions.
 Read and Summarize: Read the selected literature thoroughly and take notes.
Summarize the main findings, methodologies used, and any relevant conclusions or
implications.

DRAWBACKS FOR LITERATURE SURVEY

While literature surveys have numerous benefits, they also come with some drawbacks
and limitations.

Here are some of the drawbacks associated with conducting a literature survey

 Time-Consuming: Literature surveys can be time-consuming, especially when the topic


is vast or there is a significant volume of research available. Reading and analysing
multiple papers, articles, and books can take a considerable amount of time and effort.
 Incomplete Coverage: Despite efforts to be comprehensive, it is challenging to cover
all relevant literature, especially in rapidly evolving fields.
 Subjectivity: Literature surveys involve the researcher's subjective judgment in
selecting and interpreting the included studies.

Cryptography employs various techniques to disguise information during storage


transmission, making it a crucial aspect of modern digital communication. The use of
cryptography extends to various applications, such as computer passwords, ATM cards, and
electronic commerce. This introduction has been completed and system analysis will be
discussed in the next chapter.

3
CHAPTER 2

SYSTEM ANALYSIS

System analysis is a critical process that involves studying, understanding, and defining
the requirements and components of a system to design an effective solution. In the context of
building a secure data application that uses cryptography-Fernet for ciphering and deciphering,
system analysis.

2.1 EXISTING SYSTEM

Any computer system that is connected to the internet is vulnerable to attacks from
hackers who might try to take control the system in order to steal information for illicit
purposes. In an effort to undermine a company's business activities, they can potentially try to
crash a system [7].

A variety of system attacks have been developed to undermine computer system. To


prevent the attacks may encryption and decryption method are used like Triple DES, AES,
RSA, and Blowfish etc.. most of the pervious mentioned methods protects information stored
on smartphones, laptops, and other devices - in some cases by default [9].

At the same time, encryption is relied on by criminals to avoid investigation and


prosecution, including criminals who may unknowingly benefit from default settings as well
as those who deliberately use encryption the mentioned encryption algorithm is complicated
and slow performance to overcome this proposed advanced cryptography method for
encrypting and decrypting purposes. Thus, encryption complicates law enforcement and
intelligence investigations [6].

Disadvantages of Existing system

The existing system has several disadvantages that need to be addressed. These
drawbacks include

 Forgetting Passwords: A disadvantage of encrypting files is if you forget the password


that you used, you may never be able to recover the data.
 Raising Suspicious- a significant other may want to know what terrible secrets you are
keeping that require you to encrypt files on your computer.
 Developing False Sense of Security- A determined person may marshal overwhelming
computer resources to decrypt your secret files.

4
 Requiring cooperation- Using encrypted files that are designed to be opened and
shared by two or more people can be disadvantageous when one or more participants
finds it a burden to use encryption.
 Slow performances- each recipient receive the key through different channel.

2.2 PROPOSED SYSTEM

Due to the recent increase in demand for digital signal transmission, the issue of
massive losses from unauthorized data access has emerged as a pressing concern. As a result,
data security has emerged as a crucial and pressing issue in applications for multimedia data
transfer. Various sorts of cryptographic systems are required to secure sensitive information
from unwelcome users or against unauthorized duplication and modification.

In our project this used the Cryptography method using the fernet Algorithm as to
prevent the massive losses data from unauthorized data access and transmitting a data in a
secure way using symmetric way, the symmetric cryptography is normally used to encrypt
private data for its high performance the use of single shared secret to share encrypt data
between parties comparatively symmetric Encryption is usually faster than asymmetric
Encryption because of the single key encryption and for to reduce the work load in an industry
we use an classification technique to predict and suggest fuel type by the details of the client
by using mentioned classification technique called gradient boosting algorithm. There have
been various data encryption techniques on multimedia data proposed [4].

Advantages of Proposed System

 Confidentiality - Confidentiality ensures that only the recipient can decrypt the
message and read its content.
 Integrity- Integrity focuses on the ability to ensure the information contained in the
message cannot be modified
 Authenticity - Authenticity ensures the sender and recipient can verify each other’s
identities and the destination of the message.
 Simple- The provided result helps encryption and decryption easily.

5
2.3 REQUIREMENT GATHERING

2.3.1 Hardware Requirements

Processor : Intel (R) Pentium (R)

Speed : 1.6 GHz and Above

RAM : 4 GB and Above

Hard Disk : 120 GB

Monitor : 15’’ LED SVGA

2.3.2 Software Requirements

Operating system : Windows 7 / 8 / 8.1 / 10

Coding Language : PYTHON

IDE : PyCharm

Database : MySQL

2.4 COMPANY PROFILE

Shiash Info Solutions is an IT services, Digital and Business solutions company based
in Chennai (India) providing Customized Software Development, Web Application
Development, Mobile Application Development and IT Consulting Services. We have earned
the pride of being one of the leading desktop & web based software solution provider in India,
we develop software solution that helps our customers to outperform the competition and stay
ahead in today’s competitive business environment. We firmly believe that business needs can
be only met when technology is in sync with business process. At Shiash Info Solution , we
provide multi- dimensional IT services that cater to high-end internet strategy, software
development and design solutions for corporate clients all across the globe.We have a wide and
varied range of products & services that can suit the divergent needs of our large client base.
We understand that for the success of any project Time, Quality and Support has to be top class,
for this our planning & quality control team make sure that your projects are very planned &
designed to be delivered on time & also the quality of the project is more than what you have
expected. We rapidly transform our self- motivated ideas and concepts into new products and
applications along with improving application performance, thus, reducing the complexities of
business operations and accelerating the business output or efficiency of our clients.
6
To provide the best in class, creative, unique Software Solutions that can solve all our
client’s business problems that they face on day-to-day bases. We provide software & solutions
for companies of all sizes and all industry sectors. We thrive in achieving excellence in
providing the best IT solutions to our clients so that they can meet their business needs in the
most effective and efficient way. At Shiash Info Solutions we focus on high quality & timely
delivery of our Services.

Our dedicated team provides you solutions that make achieving business objectives
easier and in a much efficient way. We provide the highest standard of products to our client
base belonging to all verticals. We outsource IT services to different industries across the globe
which includes Complex Software Solutions, web application & Other IT services. Our team
members are young and trained. We listen and provide services to our clients that are tailor
made for their business. We have sustainable base of clients who trust us for our quality service
in the field of Software & Web Application development.

The system analysis lays a solid foundation for building a secure data application that
utilizes cryptography-Fernet. Addressing security risks, implementing strong encryption
measures, and considering user experience, the application can provide a secure and user-
friendly environment for encrypting and decrypting sensitive data, meeting both functional and
security requirements. This introduction has been completed and system Design is be discussed
in the next chapter

7
CHAPTER 3

SYSTEM DESIGN

System design is the process of defining elements of a system like modules,


architecture, components and their interfaces and data for a system based on the specified
requirements. It is the process of defining, developing, and designing systems which satisfies
the specific needs and requirements of a business or organization. The most crucial concern in
today's computer world is the security, integrity, and confidentiality of the organization's data.
In this paper we propose that how the cryptography fernet Method are used to ensure secrecy
and integrity of the data presence in which our cases used in the bio industry in order to prevent
data leakage in bio industry the fuel processing process is a crucial it may varies from firm to
firm to prevent those data we use cryptography method to cipher and decipher, to prevent that
will lead to downstairs the company profit and the economic growth so the process will secured
by using Cryptography method, In our situation, we propose one of the classification
techniques, gradient boosting classifier, to lower the labour load and anticipate the required
fuel type by client side. Organization needs time efficient and reduced labour load to provide
more profit and overcome the data theft in the bio industry, Symmetric cryptography and
asymmetric cryptography are the two categories of cryptographic techniques. The same key is
used for encryption and decryption in the symmetric approach. The usage of two keys
Asymmetric cryptography uses two keys: a public key for encrypting data and a private key
for decrypting it. So, in our project we using symmetric approach to encrypt the data with
generated fernet key and uses encrypt and further the encrypted code will be encoded with the
asymmetric key file into the readable file.

3.1 UML DIAGRAM

A UML diagram is a diagram based on the UML (Unified Modelling Language) with
the purpose of visually representing a system along with its main actors, roles, actions, artifacts
or classes, in order to better understand, alter, maintain, or document information about the
system [4].

8
USE CASE DIAGRAM

Figure 3.1 Use Case Diagram For Client

Figure 3.1 The Use Case Diagram Registration, Login, Client details, Fuel, Admin,
Approve client, Distributor, Process, Raw Materials, Payslip Logout. The Manger and
processing team, Distributor the above use case diagram.

9
SYSTEM ARCHITECTURE

Figure 3.2 System Architecture Diagram For Database

Figure 3.2 System Architecture Diagram represents the entire database to store the
client, admin, management, process team, encrypt files.

10
ER DIAGRAMS

The relation upon the system is structured through a conceptual ER-Diagram, which
not only specifics the existing entities, but also the standard relations through which the system
exists and the cardinalities that are necessary for the system state to continue. The Entity
Relationship Diagram (ERD) depicts the relationship between the data objects [5]. The ERD is
the notation that is used to conduct, the date modelling activity the attributes of each data object
noted, is the ERD can be described resign a data object description.

The set of primary components that are identified by the ERD are,

 Data object
 Relationships
 Attributes
 Various types of indicators.

The primary purpose of the ERD is to represent data objects and their relationships.

Figure 3.3 ER Diagram For Encrypt And Decrypt

Figure 3.3 ER Diagram encrypt data to decrypt data the processed.

11
DATA FLOW DIAGRAM

Figure 3.4 Data Flow Diagram For Client

Figure 3.4 This Level is contain Client Login From With The Management Queries
Client Requirement Processing team, Distributor Response Database.

Figure 3.5 Data Flow Diagram For Process Team

Figure 3.5 This Level Executes The process team to raw material ,Dropped material
process and All Process Complete to Client Request

12
Figure 3.6 Data Flow Diagram For Logout

Figure 3.6 This Level Executes The Management Client Requirement To Identify
Process Team Receive Fuel, Raw Material Distributor View Company Details All Process
Finally Log Out.

13
SEQUENCE DIAGRAM

Figure 3.7 Sequence Diagram For Trained Data

Figure 3.7 Sequence Diagram Represents the upload data details to be dropped encrypt
data and decrypt data view result.

14
3.8 CLASS DIAGRAM

Figure 3.8 Class Diagram For Distributor Model

Figure 3.8 Class diagram represents the data process manager model and process model
send data in distributor.

15
3.2 MODULES

• Client

• Admin

• Management

• Process Team

• Distributor

3.2.1 Client

Clients are the more crucial one the business, firm or any organization which are the
revenue resources, Clients require projects for personal or corporate reasons and wish to
contact the company by registering their company details include their organization name,
contacts, address and city what type of company in the application Client initially uploading
their company details to the company waiting until to accept if the company rejects they send
mail along with the reason and query after the filling up with the query client upload their need
to the company , after the company process and they suggest the best fuel to the client according
to their request and requirement consist of the following what the company type, and their
purpose of fuel and the quantity according with this detail the company will find and suggest
the best fuel to the client after viewing the client , if client having any queries they intimate the
reason with the company after successfully selecting the fuel type next process is payment after
completing the payment process the fuel will deliver in the schedule time [1].

3.2.2 Admin

Initially admin logs into the application with the specified user name and password only
specified for admins and then views the client company if the client meet with the company
requirements the admin will accept the client company or else the client doesn’t suit with the
company policy the admin send mail along with mentioned reason to the client if the reason
was satisfies with the client the next process is fuel production for that the processing team will
buy the specific raw materials with the distributor for that the admin should will approve the
distributor company after inspecting distributor company, after the requirement is satisfied the
admin will receive the pay slip from the distributor after the successful payment with the
distributor the distributor company will drop the raw materials to business firm[1].

16
3.2.3 Manager

The role of manger in the company or organization in this company was after
completion of admin accepting the required client for the firm the manager should need to be
check the requirement of the client which was uploaded along with the client details with
include company type, and their purpose of fuel and the quantity With the received details from
the client the manager will helps the client by finding the right type fuel that should suitable
for the client requirements with the classifier algorithm after finding the fuel type with given
of requirement, then fuel type will be forwarded back to the specific client, after receiving the
fuel type the client share the if there any queries with the manager, after the solving the query
process with the client the manager will finalize the fuel type and the fuel type will be
forwarded to the processing team with the alteration that made by the client for the further
process [6].
3.2.4 Processing Team

The role of Processing team in this industry was to produce the right type of fuel with
client requirement forwarded by the manager in the industry initially process team will receive
fuel detail from the manager after the query acceptance with the client and to manufacture the
right type of fuel they should buy the needed raw materials from the vendor to manufacture the
mentioned fuel so the process team will put the request after selection of distributor company
by the admin the distributor will drop the materials after the payment process with the admin
the required raw materials that need to produce the fuel and the process team will start to
manufacture the fuel type with process like hydrolysis, fermentation and Distillation these
process method will vary from firm to firm so process team need to secure the data, to protect
the process they use the cryptography method was used to secure the data by generating using
the key for encrypting and decrypting the key for the encode process after the mentioned the
process is completed the fuel will be delivered to the client with the given schedule time [3].

3.2.5 Distributor

The role of distributor is to supply the demand or request from the process team in the
organization, hence there are various process team and requests, and hence the distributor must
satisfy all the demand request that was made by the process team and the raw materials that
include (Fruit Pits, cassava, and dungs) that vendor should verify and supply the demand
product where the raw material’s supplies to the process team required at first the vendor must
upload their company details that include (company email, address, company type, contact and

17
CIN number)to the organization for which the manager could accept distributor according to
their policy , when the company approves the distributor, then the further process will be
proceed and the distributor also share the pay slip with the manager after the payment process
the demand raw materials will be delivered to the process team with in the given time to the
manager [7].

3.3 DATABASE DESIGN

Securing data in a database, encryption is an essential component of data protection.


Using the Fernet encryption algorithm, as mentioned earlier, can help ensure that sensitive data
is securely stored in the database. However, the design of the database itself also plays a crucial
role in maintaining data security.

Input Design

Designing the input process for a system that uses cryptography (Fernet) for secure data
encryption and decryption involves ensuring that sensitive data is handled securely throughout
the input phase. Here are some guidelines for designing the input process:

 User Input Validation: Ensure that all user inputs are properly validated to prevent any
malicious data or unexpected inputs from causing issues in the encryption process.
Validate the data format, length, and content before proceeding with encryption or
decryption.
 Secure Communication: If the data is being received over a network, use secure
communication protocols (such as SSL/TLS) to encrypt the data during transit. This
prevents eavesdropping and data interception during the input phase.
 Authentication and Authorization: Implement proper authentication and authorization
mechanisms to ensure that only authorized users have access to sensitive data and the
encryption/decryption functionalities.
 Logging and Auditing: Implement logging and auditing mechanisms to record all input
activities, including encryption and decryption operations. This provides an audit trail
for security analysis and potential incident investigation.
 Input Sanitization: Sanitize all input data to remove any potential malicious code or
harmful characters. This is crucial for preventing injection attacks.

18
Table 3.1 Client Home

Name Data Type Null Default


Id Bigint(20) No None
Username Varchar(150) No None
Email Varchar(150) No None
Phone Number Bigint(20) Yes Null
Password Varchar(150) No None
Gender Varchar(20) Yes Null

Table 3.1 This client home table describes the customer details to create the id ,user
name, email, phone number, password, gender.

Table 3.2 Admin Table

Name Data Type Null Default


Id Bigint(20) No None
Email Varchar(150) Yes Null
Fuel Varchar(150) No None
Item 1 Varchar(150) Yes Null
Quality 1 Varchar(150) Yes Null
Item 2 Varchar(150) Yes Null
Quality 2 Varchar(150) Yes Null
Item 3 Varchar(150) Yes Null

Table 3.2 Admin Table Describes the to check the customer id then the fuel type item
and quantity check and distribute the customer.

Output Design
Designing the output process for a system that uses cryptography (Fernet) for secure
data encryption and decryption is equally important to ensure the confidentiality and integrity
of sensitive data. Here are some guidelines for designing the output process:

19
 Data Integrity Verification: After decrypting the data using Fernet, perform data
integrity checks to ensure that the decrypted data has not been tampered with during
transit or storage. One common approach is to use message authentication codes
(MACs) to verify the data's integrity.
 Secure Communication: If the decrypted data needs to be transmitted over a network,
use secure communication protocols (such as SSL/TLS) to encrypt the data during
transit to protect against eavesdropping and data interception.
 Authentication and Authorization: Implement proper authentication and authorization
mechanisms for accessing and viewing decrypted data. Ensure that only authorized
users can access sensitive information.
 Secure Key Management: Continuously protect and manage encryption keys
throughout the output process. Ensure that the decryption key (used in Fernet) is
securely stored and accessible only to authorized personnel.
 Secure Storage: If the decrypted data needs to be stored, ensure it is stored in a secure
manner, using proper access controls and encryption at rest, to protect against
unauthorized access.
 Secure Logging: If any sensitive data is logged or recorded, ensure that logs are
protected and access is restricted to authorized personnel only.

Table 3.3 Manager Table

Name Data Type Null Default


Id Bigint(20) No None
Vendor-Name Varchar(150) No None
Company -Name Varchar(150) No None
Company -Email Varchar(150) No None
Country Varchar(150) Yes Null
Company -Address Varchar(150) Yes Null
Contact Varchar(150) Yes Null
Cin-Number Varchar(150) Yes Null
Approves Tinyint(1) No None

Table 3.3 Manager Table describes the company details like, vendor name, company
name, mail, country, address, contact and approve the id

20
Table 3.4 Processing Team

Name Data Type Null Default


Id Bigint(20) No None
Company-Name Varchar(150) Yes Null
Purpose Varchar(150) No None
Reason Varchar(150) Yes Null
Quantity Bigint(20) Yes Null
Changes Varchar(150) Yes Null
New-Quantity Bigint(20) Yes Null
Satisfied Varchar(150) Yes Null
Date Varchar(15) Yes Null

Table 3.4 Processing team provides the customer purpose, Quantity, Reason, changes,
new quantity, satisfied and Date

Table 3.5 Distributor Team

Name Data Type Null Default


Id Bigint(20) No None
Company-Name Varchar(150) No None
Company-Type Varchar(150) No None
Purpose Varchar(150) No None
Fuel Varchar(150) Yes Null
Boolean Tinyint(1) No None

Table 3.5 The Distributor team describes the company details distributed to customer
like us company name, company type, purpose, fuel, and Boolean

The system design for the secure data application using cryptography-Fernet has been
well-planned and thought-out, taking into consideration the essential aspects of data security,
user experience, and system performance. This introduction has been completed and
implementation will be discussed in the next chapter.

21
CHAPTER 4

IMPLEMENTAION

Cybernetics is a transdisciplinary approach for exploring regulatory systems their


structures, constraints, and possibilities. The essential goal of the broad field of cybernetics is
to understand and define the functions and processes of systems that have goals and that
participate in circular, causal chains that move from action to sensing to comparison with
desired goal, and again to action [13]. Cybernetics has been defined in a variety of ways, by a
variety of people, from a variety of disciplines. Science concerned with the study of systems
of any nature which are capable of receiving, storing and processing information so as to use
it for control. Studies in cybernetics provide a means for examining the design and function of
any system, including social systems such as business management and organizational
learning, including for the purpose of making them more efficient and effective[13].

4.1 BACKGROUND STUDY

The study delves into the inner workings of Fernet encryption, including the AES
encryption process, CBC mode, and the role of HMAC in ensuring message integrity.
Exploring key management practices is crucial, as the security of the encryption keys is
paramount to safeguarding sensitive data[4]. The study analyzes methods for key generation,
storage, and distribution. Assessing the security features and strengths of Fernet encryption is
essential to understand its suitability for secure data applications. The study examines potential
vulnerabilities and countermeasures. The study investigates how Fernet encryption can be
integrated into a secure data application effectively. It explores the design considerations, user
interface, and data flow to ensure seamless implementation. Evaluating the performance impact
of Fernet encryption and the overall usability of the secure data application is crucial for user
satisfaction and adoption [2].

4.2 IMPLEMENTATION
The implementation of Fernet encryption ensures that sensitive data remains secure
both during transmission and storage. The symmetric key approach guarantees that only
authorized parties possessing the secret key can decrypt the data, providing a robust layer of
protection against unauthorized access[5].

22
Django

Django sometimes stylized as Django is a Python-based free and open-source web


framework that follows the model-template-views (MTV) architectural pattern. It is maintained
by the Django Software Foundation (DSF), , such as naming the callable objects generating the
HTTP responsed[9]. The core Django framework can be seen as an MVC architecture [10]. It
consists of an object-relational mapper (ORM) that mediates between data models (defined as
Python classes) and a relational database ("Model"), a system for processing HTTP requests
with a web templating system .

Flask

Flask is a micro web framework written in Python. It is classified as a microframework


because it does not require particular tools or libraries. It has no database abstraction layer,
form validation, or any other components where pre-existing third-party libraries provide
common functions[8]. However, Flask supports extensions that can add application features as
if they were implemented in Flask itself. Extensions exist for object-relational mappers, form
validation, upload handling, various open authentication technologies and several common
framework related tools. The microframework Flask is based on the Pocoo projects, Werkzeug
and Jinja2.

Werkzeug

Werkzeug is a utility library for the Python programming language, in other words a
toolkit for Web Server Gateway Interface (WSGI) applications, and is licensed under a BSD
License. Werkzeug can realize software objects for request, response, and utility functions. It
can be used to build a custom software framework on top of it and supports Python 2.7 and 3.5
and later.

Jinja

Jinja, also by Ronacher, is a template engine for the Python programming language and
is licensed under a BSD License. Similar to the Django web framework, it handles templates
in a sandbox [12].

23
HTML, JAVASCRIPT

Hypertext Markup Language (HTML), the languages of the World Wide Web (WWW),
allows users to produce web pages that included text, graphics and pointer to other web pages
(Hyperlinks).

HTML is not a programming language, but it is an application of ISO Standard 8879,


SGML (Standard Generalized Markup Language), but Specialised to hypertext and adapted to
the Web. The idea behind Hypertext one point to another point. We can navigate through the
information based on out interest and preference. A markup language is simply a series of items
enclosed within the elements should be displayed. Hyperlinks are underlined or emphasized
works that load to other documents or some portions of the same document [12].

MYSQL

MySQL is popular among all databases, and is ranked as the 2nd most
popular database, only slightly trailing Oracle Database. Among open source databases,
MySQL is the most popular database in use today. MySQL uses standalone clients that allow
users to interact with MySQL, and also to use it with other programs for applications that need
relational database capabilities. MySQL's reputation for reliability has led to its inclusion in
the popular LAMP stack (Linux, Apache, MySQL, Python/Perl/PHP) and is also used as the
default DBMS in popular CMS options like Drupal, Joomla, phpBB, and WordPress.

This implementation is a basic example to demonstrate encryption and decryption using


Fernet. In a real-world application, you would need to handle key management securely, ensure
proper data handling practices, and provide secure mechanisms for key storage and
distribution. The implementation of the secure data application using cryptography-Fernet has
achieved the objectives of providing a secure, user-friendly, and efficient solution for protecting
sensitive data. The implementation has been completed and system testing is be discussed in
the next chapter.

24
CHAPTER 5

SYSTEM TESTING

Software testing is a critical element of software quality assurance and represents the
ultimate review of specification, design and coding. In fact, testing is the one step in the
software engineering process that could be viewed as destructive rather than constructive.

5.1 TESTING

The software engineering process can be viewed as a spiral. Initially system engineering
defines the role of software and leads to software requirement analysis where the information
domain, functions, behavior, performance, constraints and validation criteria for software are
established. Moving inward along the spiral, we come to design and finally to coding. To
develop computer software we spiral in along streamlines that decrease the level of abstraction
on each turn [8].

A strategy for software testing may also be viewed in the context of the spiral. Unit
testing begins at the vertex of the spiral and concentrates on each unit of the software as
implemented in source code. Testing progress is done by moving outward along the spiral to
integration testing, where the focus is on the design and the construction of the software
architecture [7]. Talking another turn on outward on the spiral we encounter validation testing
where requirements established as part of software requirements analysis are validated against
the software that has been constructed. Finally, we arrive at system testing, where the software
and other system elements are tested as a whole.

There are Five Testing

 UNIT TESTING
 MODULE TESTING
 SUB-SYSTEM TESING
 SYSTEM TESTING
 ACCEPTANCE TESTING

25
Figure 5.1 Testing Users

Figure 5.1 the user can request on the process to integration the manager approve and
client request to component testing to user will be approve test.

5.1.1 Unit Testing

Unit testing focuses verification effort on the smallest unit of software design, the
module. The unit testing we have is white box oriented and some modules the steps are
conducted in parallel.

5.1.2 White Box Testing

This type of testing ensures that

• All independent paths have been exercised at least once

• All logical decisions have been exercised on their true and false sides

• All loops are executed at their boundaries and within their operational bounds.

• All internal data structures have been exercised to assure their validity.

To follow the concept of white box testing we have tested each form. We have created
independently to verify that Data flow is correct, All conditions are exercised to check their
validity, All loops are executed on their boundaries.

26
5.1.3 Base Path Testing

The established technique of flow graph with Cyclamate complexity was used to derive
test cases for all the functions. The main steps in deriving test cases were:

Use the design of the code and draw correspondent flow graphs.

Determine the Cyclamate complexity of the resultant flow graph, using formula: V(G) =E-N+2
or

V(G) =P+1 or

V(G) =Number of Region

Where V (G) is Cyclomatic complexity, E is the number of edges,

N is the number of flow graph nodes, P is the number of predicate nodes.

Determine the basis of set of linearly independent paths.

5.1.4 Conditional Testing

In this part of the testing each of the conditions were tested to both true and false
aspects. And all the resulting paths were tested. So that each path that may be generated on
particular condition is traced to uncover any possible errors.

5.1.5 Data Flow Testing

This type of testing selects the path of the program, according to the location of the
definition and use of variables. This kind of testing was used only when some local variables
were declared. The definition-use chain method was used in this type of testing. These were
particularly useful in nested statements.

5.1.6 Loop Testing

In this type of testing all the loops are tested to all the limits possible. The following
exercise was adopted for all loops:

• All the loops were tested at their limits, just above them and just below them.

• All the loops were skipped at least once.

• For nested loop test the innermost loop first and then work outwards.

27
5.2 TEST CASE

The test environment is collection of hardware and software, which helps us to execute
the test case. Once we get the client request, the login user id &password. The developer starts
developing the code. The following test client requirement to request used to test the secure
data system.

Table 5.1 Test Case Table

Test
Case Test Case Test Case Description Expected Output Actual
ID Result
The client to create a Predicted login page
1 Client Testing registration and and requirement details As Expect
Requirement details created or not
To Approve client Predicted payment
2 Admin Testing details and make details created or not As Expect
payment
To approve client Predicted receive fuel
3 Manager Testing details and accept fuel details created or not As Expect
details
4 Processing To request raw Predicted raw materials
Testing materials process created or not As Expect
To view raw materials Predicted company
5 Distributor and company details details and payslip As Expect
Testing then to proceed the details are created or not
payslip details

Table 5.1 The Test case table describes the testing are client testing, admin testing,
manager testing, processing testing, distributor testing.

28
5.3 OUTCOME OF THE TEST

Figure 5.2 Outcome Of The Test For Process 1

__

Figure 5.3 Outcome Of The Test For Process 2

Figure 5.4 Outcome Of The Test For Quantity

The system testing phase for the secure data application using cryptography-Fernet has
been successfully completed, validating the functionality, security, and performance of the
application. This system testing has been completed and conclusion& future enhancement is
be discussed in the next chapter.

29
CHAPTER 6

CONCLUSION

6.1 CONCLUSION

In this project, the cryptography Fernet application provides a straightforward and


effective way to secure data through encryption and decryption using symmetric encryption
based on the AES algorithm. By generating a secret key known only to authorized parties,
sensitive information can be transformed into an unreadable format, ensuring confidentiality
during data transmission or storage. Fernet is a valuable addition to the arsenal of tools used to
protect sensitive information, and when used correctly in conjunction with other security
measures, it can significantly enhance the overall security posture of an application or system.
Fernet's simplicity and integration with python's cryptography library make it accessible to
developers, enabling them to implement robust encryption mechanisms in their applications.
The strength of AES encryption and the secure key generation provided by Fernet contribute
to the overall security of the data.

6.2 FUTURE ENHANCEMENT

One area of improvement is in key management. Implementing robust key management


practices, such as key rotation, key storage, and secure key exchange protocols, can further
enhance the security of the system. Integrating multi-factor authentication (MFA) with Fernet
encryption can add an extra layer of security. By combining something the user knows (e.g., a
password) with something they have (e.g., a physical token or a biometric identifier), the
overall security of the system can be strengthened. Integration with Hardware Security
Modules provide secure key storage and cryptographic operations. Integrating Fernet
encryption with HSMs can further enhance the security of key management and protect against
physical attacks on the encryption keys. cryptographic libraries and algorithms should be
regularly updated to address any discovered vulnerabilities or weaknesses. Staying up to date
with the latest security patches and best practices is essential for maintaining the security of
the system.

30
APPENDIX A: Output Screen

A1: Login Screen

A2: Register From

31
A3: Requirement Client

A4: Process Team

32
A5: Classy Register From

33
APPENDIX B: Sample Coding

<!DOCTYPE html>

<html lang="en">

{% extends 'client/client_home.html' %}

{% load static %}

{% block content %}

<head>

<script>

{% for msg in messages %} alert('{{ msg }}');

{% endfor %}

</script>

<title>Home Loan Application Form Responsive Widget Template :: w3layouts</title> <!--

Meta tag Keywords -->

<meta name="viewport" content="width=device-width, initial-scale=1"> <meta http-

equiv="Content-Type" content="text/html; charset=utf-8" />

<meta name="keywords" content="Home Loan Application Form Responsive Widget,Login

form widgets, Sign up Web forms , Login signup Responsive web form,Flat Pricing table,Flat

Drop downs,Registration Forms,News letter Forms,Elements" />

<script type="application/x-javascript"> addEventListener("load", function() {

setTimeout(hideURLbar, 0); }, false);

34
function hideURLbar(){ window.scrollTo(0,1); } </script>

<!-- Meta tag Keywords -->

<!-- css files -->

<link rel="stylesheet" href="{% static 'client/requirement/css/style.css' %}" type="text/css"

media="all" /> <!-- Style-CSS -->

<link rel="stylesheet" href="{% static 'client/requirement/css/jquery-ui.css' %}" />

<!-- //css files -->

<!-- web-fonts -->

<link href="//fonts.googleap is.com/css?family=Poiret+One" rel="stylesheet">

href="//fonts.googleapis.com/css?family=GFS+Neohellenic:400,400i,700,700i&amp;subset

=greek" rel="stylesheet">

<style>

<div class="center-container">

<!--header-->

<div class="header-w3l">

<h1>REQUIREMENT</h1>

</div>

<!--//header-->

<!--main-->

35
<div class="agileits-register">

<form action="/requirement_form/" method="post"> {% csrf_token %}

<div class="w3_modal_body_grid w3_modal_body_grid1"> <span>Company Name :</span>

<select id="w3_country" onchange="change_country(this.value)"

class="frm-field required" name="company_name">

<option value="null">Select</option>

<option value="suzuki">suzuki</option>

<option value="tata">tata</option>

<option value="bmw">bmw</option>

<option value="honda">honda</option>

<option value="boeing">boeing</option>

<option value="indian railways">Indian railways</option> </select>

</div>

<div class="w3_modal_body_grid w3_modal_body_grid1"> <!-- <span>Address :</span>-->

<!-- <input type="text" name="address" placeholder="Address" required=""/>--> <div

class="clear"> </div>

</div>

<div class="w3_modal_body_grid w3_modal_body_grid1"> <!--<input type="text"

name="address" placeholder="Street" required=""/>--> <div class="clear"> </div>

</div>

36
<div class="w3_modal_body_grid w3_modal_body_grid1">

<!-- <input type="text" name="address" placeholder="City" required=""/>--> <div

class="clear"> </div>

</div>

<div class="w3_modal_body_grid w3_modal_body_grid1">

<!--<input type="text" name="address" placeholder="ZipCode" required=""/>-->

<div class="clear"> </div>

</div>

<div class="w3_modal_body_grid" >

<span>COMPANY TYPE :</span>

<select id="w3_country" onchange="change_country(this.value)" class="frm-field required"

name="reason"> value="RAILWAY">RAILWAY</option>

</select>

<div class="clear"> </div>

</div>

<div class="w3_modal_body_grid">

<span>Purposes :</span>

<option value="null">Select</option>

<option value="best organic and high efficiency and low pollution">best organic and high

efficiency and low pollution</option>

37
<option value="AIRCRAFT,reduce green house and efficiency and low

cost,SAF">AIRCRAFT,reduce green house and efficiency and low cost,SAF</option>

<option value="RAILWAY,few pollutants and produce more power">RAILWAY,few

pollutants and produce more power</option>

<div class="clear"> </div>

</div>

<div class="w3_modal_body_grid w3_modal_body_grid1"> <span>Quanatity :</span>

<input type="text" name="quantaity" placeholder="quantaity" required=""/> <div

class="clear">

</div>

</div>

<div class="w3_modal_body_grid w3_modal_body_grid1"> <!--<span>Date Of Apply

:</span>-->

<!-- <input class="date" id="datepicker" name="Text" type="text" value="mm/dd/yyyy"

onfocus="this.value = '';" onblur="if (this.value == '') {this.value

='2/08/2013';}" required="" />--> <!--<div class="clear"> </div>-->

</div>

<div class="w3_modal_body_grid"> <span>previous customer :</span>

</div>

<div class="w3_modal_body_grid">

<span>previous customer :</span>

38
<input type="text" name="customer" placeholder="purpose" required=""/> <div

class="clear"> </div>

</div>

<div class="w3_modal_body_grid">

<input type="submit" value="Apply Now" />

<div class="clear"></div>

</form/>

Backend Code:

from django.shortcuts import render, redirect, HttpResponse, HttpResponseRedirect from

.models import * from django.http import HttpResponse from django.contrib import messages

from client.models import *

from management.models import * from administrator.models import * import random

import string

from django.conf import settings import pyAesCrypt

from client.models import *

from processteam.models import * from distributor.models import * from .Encrypting import

from cryptography.fernet import Fernet from django.conf import settings

class Encryptor():

def key_create(self):

39
key = Fernet.generate_key() return key

def key_write(self, key, key_name):

with open(key_name, 'wb') as mykey: mykey.write(key)

def key_load(self, key_name):

with open(key_name, 'rb') as mykey:

key = mykey.read() return key

def file_encrypt(self, key, original_file, encrypted_file): f = Fernet(key)

with open(original_file, 'rb') as file:

original = file.read()

encrypted = f.encrypt(original)

with open(encrypted_file, 'wb') as file:

file.write(encrypted)

def file_decrypt(self, key, encrypted_file, decrypted_file):

f = Fernet(key)

with open(encrypted_file, 'rb') as file:

encrypted = file.read()

decrypted = f.decrypt(encrypted)

with open(decrypted_file, 'wb') as file:

file.write(decrypted)

40
def process_index(request):

return render(request, 'process_team/p_index.html') def process_r(request):

if request.method == 'POST':

username = request.POST['username'] email = request.POST['email'] password =

request.POST['password']

phonenumber = request.POST['phonenumber'] gender = request.POST['gender']

address = request.POST['address']

process_l(username=username, email=email, password=password,

phonenumber=phonenumber, gender=gender,

address=address).save()

messages.info(request, "successfully registered") return redirect('/process_login/')

return render(request, 'process_team/process_team_l_R.html') def process_login(request):

if request.method == 'POST': email = request.POST['email']

password = request.POST['password'] try:

emp = process_l.objects.get(email=email, password=password) request.session['process'] =

emp.email messages.info(request, "successfully login") return redirect('/process_index/')

except:

messages.info(request, "Wrong Credentials")

return render(request, 'process_team/process_team_l_R.html') def view_fuel(request):

datas = send_procees.objects.all()

41
return render(request, 'process_team/view_fuel.html', {'datas': datas}) def

request_raw_materials(request):

if request.method == 'POST':

email = request.POST['email'] fuel = request.POST['fuel'] item1 = request.POST['item1']

quantaity1 = request.POST['quantaity1'] item2 = request.POST['item2'] quantaity2 =

request.POST['quantaity2'] item3 = request.POST['item3'] quantaity3 =

request.POST['quantaity3']

send_rawmaterials(email=email, fuel=fuel, item1=item1, quantaity1=quantaity1,

item2=item2, quantaity2=quantaity2, item3=item3, quantaity3=quantaity3).save()

messages.info(request, "successfully registered") return redirect('/process_index/')

return render(request, 'process_team/raw_materials.html') def process_form(request):

if request.method == 'POST':

email = request.POST['email'] team = request.POST['team']

totalprocess = request.POST['totalprocess'] process1 = request.POST['process1'] process2 =

request.POST['process2'] process3 = request.POST['process3'] quantaity =

request.POST['quantaity']

time_duration = request.POST['time_duration']

file = request.FILES['file'] f = Fernet(key)

with open(original_file, 'rb') as file:

original = file.read()

encrypted = f.encrypt(original)

42
with open(encrypted_file, 'wb') as file: file.write(encrypted)

def file_decrypt(self, key, encrypted_file, decrypted_file): f = Fernet(key)

with open(encrypted_file, 'rb') as file: encrypted = file.read()

decrypted = f.decrypt(encrypted)

with open(decrypted_file, 'wb') as file: file.write(decrypted)

def encryption(request,id):

data = send_process.objects.get(id=id) file = data.file

location = f'{settings.MEDIA_ROOT}/{file}'

encryptor = Encryptor()

mykey = encryptor.key_create() encryptor.key_write(mykey, 'mykey.key') loaded_key =

encryptor.key_load('mykey.key')

encryptor.file_encrypt(loaded_key, location, 'enc_final1.csv') return redirect('/encypt/')

# encryptor.file_decrypt(loaded_key, 'enc_final.csv', 'dec_final.csv') def

decirption(request,id):

data =send_process.objects.get(id=id) encryptor = Encryptor() print('hi')

mykey = encryptor.key_create() encryptor.key_write(mykey, 'mykey.key') loaded_key =

encryptor.key_load('mykey.key') encryptor.file_encrypt(loaded_key, 'abc.csv', 'enc_final.csv')

encryptor.file_decrypt(loaded_key, 'enc_final.csv', 'dec_final.csv') return redirect('/encypt/')

def process_logout(request):

if 'process' in request.session:

request.session.pop('process',None) messages.success(request,'logout already

43
successfully') return redirect('/')

else:

messages.success(request, 'session logged out') return redirect('/')

def enc1(request,id):

get = send_process.objects.get(id=id) r = get.id

a = get.process1 b = get.process2 c = get.process3 d = get.quantaity alpha=[a,b,c,d] enc=[]

key = Fernet.generate_key() print("the key isssss:", key)

sa=send_process.objects.filter(id=r).update(key=key) f = Fernet(key)

for i in alpha:

encrypted_data = f.encrypt(i.encode())

enc.append(encrypted_data) print(enc)

x1=enc[0]

x2=enc[1] x4=enc[3]

ss=send_process.objects.filter(id=r).update(process1=x1,process2=x2,process3=x3,qu antaity

=x4)

return redirect('/view_encrypted/') def view_encrypted(request):

datas = send_process.objects.all()

return render(request, 'process_team/view_encrypted.html', {'datas': datas}) def

view_dropped(request):

datas=send_payslip.objects.all()

44
return render(request, 'process_team/dropped.html', {'datas': datas}) from django.shortcuts

import render,redirect

from .models import *

from client.models import *

from django.http import HttpResponse from django.contrib import messages import numpy as

np

import pandas as pd import warnings

warnings.filterwarnings('ignore')

from sklearn.preprocessing import LabelEncoder from sklearn.ensemble import

GradientBoostingClassifier def manager_index(request):

return render(request, 'manager/manager_index.html') def management_r(request):

if request.method == 'POST': username = request.POST['username'] email =

request.POST['email'] password = request.POST['password']

phonenumber = request.POST['phonenumber'] gender = request.POST['gender']

address = request.POST['address']

management_l(username=username, email=email, password=password,

phonenumber=phonenumber, gender=gender,

address=address).save() messages.info(request, "successfully registered") return

redirect('/login/')

return render(request, 'manager/manager_login_register.html') def m_login(request):

if request.method == 'POST':

45
email = request.POST['email'] password = request.POST['password'] try:

emp= management_l.objects.get(email=email, password=password)

request.session['manager'] = emp.email messages.info(request, "successfully login") return

redirect('/manager_index/')

except:

messages.info(request, "Wrong Credentials")

return render(request, 'manager/manager_login_register.html') def requirement_view(request):

datas=requirements.objects.all()

return render(request,'manager/view_requirements.html',{'datas': datas}) gender =

request.POST['gender']

address = request.POST['address']

management_l(username=username, email=email, password=password,

phonenumber=phonenumber, gender=gender,address=address).save()

messages.info(request, "successfully registered") return redirect('/login/')

return render(request, 'manager/manager_login_register.html') def m_login(request):

if request.method == 'POST':

try:emp= management_l.objects.get(email=email, password=password)

request.session['manager'] = emp.email

messages.info(request, "successfully login") return redirect('/manager_index/')

except:

messages.info(request, "Wrong Credentials")

46
return render(request, 'manager/manager_login_register.html') def requirement_view(request):

datas=requirements.objects.all()

return render(request,'manager/view_requirements.html',{'datas': datas}) gender =

request.POST['gender']

address = request.POST['address']

management_l(username=username, email=email, password=password,

phonenumber=phonenumber, gender=gender,

address=address).save()

messages.info(request, "successfully registered") return redirect('/login/')

return render(request, 'manager/manager_login_register.html') def m_login(request):

if request.method == 'POST':

email = request.POST['email'] password = request.POST['password'] try:

emp= management_l.objects.get(email=email, password=password)

request.session['manager'] = emp.email messages.info(request, "successfully login") return

redirect('/manager_index/')

except:

messages.info(request, "Wrong Credentials")

return render(request, 'manager/manager_login_register.html')

def requirement_view(request): datas=requirements.objects.all()

return render(request,'manager/view_requirements.html',{'datas': datas}) l = 0

for i in string_datas:

47
z = LabelEncoders[l] value[i] = z.transform([value[i]])[0] l += 1

value = [i for i in value.values()] predicted = model.predict([value])

print(12334455) if ylabel_encoder:

predicted = ylabel_encoder.inverse_transform(predicted) return predicted[0]

def get_input(request, id):

# if 'user' in request.session:

get = requirements.objects.get(id=id) r=get.id

inputvar = []

get.save();

company_name= get.company_name company_type= get.company_type purpose=

get.purpose inputvar.append(company_name) inputvar.append(company_type)

inputvar.append(purpose) print('input:', inputvar)

ka = algo(inputvar,r) print('OUTPUT:',ka)

st = requirements.objects.filter(id=r).update(fuel=ka) return redirect('/suguest_fuel_type/')

def send_p(request):

if request.method == 'POST':

company_name = request.POST['company_name'] company_type =

request.POST['company_type'] purpose = request.POST['purpose'] fuel = request.POST[

send_procees(company_name=company_name,

company_type=company_type, purpose=purpose,fuel=fuel,

48
).save()messages.info(request, "successfully Send To admin")

# data = requirements.objects.get(id=id)

return render(request, 'manager/send_form.html')

def manager_logout(request):

if'manager'in equest.session:

request.session.pop('manager',None)

messages.success(request,'logout already successfully') return redirect('/')

else:

messages.success(request, 'session logged out') return redirect('/client_logout/’)

49
REFERENCES

[1] Boyen X, Reusable cryptographic fuzzy extractors, in Proceedings of the 11th ACM
conference on Computer and communications security. ACM,2004.

[2] Gao C.-Z., Cheng Q, Li X, and S.-b. Xia, “Cloud-assisted privacy preserving profile-
matching scheme under multiple keys in mobile social network,” Cluster Computing,
vol. 22, no. 1, pp. 1655– 1663, 2019.

[3] Guo F, Susilo W, and Mu Y, “Distance-based encryption: How to embed fuzziness in


biometric-based encryption,” IEEE Transactions on Information Forensics and Security,
vol. 11, no. 2, 2016.

[4] Lindell Y, How to simulate it–a tutorial on the simulation proof technique, in Tutorials
on the Foundations of Cryptography. Springer, 2017.

[5] Paillier P, Public-key cryptosystems based on composite degree residuosity classes, in


International conference on the theory and applications of cryptographic techniques.
Springer, pp. 223– 238,1999.

[6] Uludag U, Pankanti S, Prabhakar S, and Jain A.k, Biometric cryptosystems: issues and
challenges, Proceedings of the IEEE, vol. 92, no. 6, pp. 948–960, 2004.

[7] Zhang J, Wang X, Yiu S.-M, Jiang Z.L, and Li J, Secure dot product of outsourced
encrypted vectors and its application to svm, in Proceedings of the Fifth ACM
International Workshop on Security in Cloud Computing, pp.75–82,2017.

[8] Zhuang D, Wang S, and Chang J.M, “Fripal: Face recognition in privacy abstraction
layer,”in Dependable and Secure Computing, 2017 IEEE Conference on. IEEE, 2017.

[9] https://fidoalliance.org/certification/biometric- component-certification/.com

[10] http://www.cbsr.ia.ac.cn/english/ Databases.asp.in

[11] http://vip.ifaa.org.cn/en/specifications.html.com

[12] https://www.helpnetsecurity.com /2019/08/14/ biometric-data-leak/.

[13] https://Decrypt Python cryptography fernet token in C# - Stack Overflow

50

You might also like