File Encryption and Decryption Using AES
Chapter 1
Introduction
1.1 Outline
Encrypted data must be deciphered, or decrypted, before it can be read by the recipient.
The root of the word encryption—crypt—comes from the Greek word kryptos, meaning
hidden or secret. In its earliest form, people have been attempting to conceal certain
information that they wanted to keep to their own possession by substituting parts of the
information with symbols, numbers and pictures, this paper highlights in chronology the
history of Cryptography throughout centuries. For different reason, humans have been
interested in protecting their messages.
Typical Features include:
Encryption: The data contained in the file is encrypted once it is entered as the input in
the GUI developed.
Decryption: The contents of the file which is encrypted using AES algorithm will be
decrypted using the specified algorithm.
1.2 Motivation and Scope
Easy and convenient for encryption.
The program works for variable size of grid.
All the outliers can be detected by the program in a two phase manner.
The performance of the software package depends on the volume of data i.e. the number of
objects in the dataset.
The inputs in terms of file size in a dataset have to be entered manually.
Efficient in terms of memory utilization.
1.3 Problem Statement
Apply AES algorithm for performing encryption and decryption of files
2017-2018 Dept of ISE. 1|Page
File Encryption and Decryption Using AES
1.4 Limitations
Although AES is free for any use public or private, commercial or non-commercial programs
that provide encryption capabilities are subject to U.S. export controls and sanctions
administered by the Bureau of Industry and Security (BIS) under the Export Administration
Regulations (EAR) and the Commerce Control List (CCL).
Most commercial encryption products have a license exception assigned to them by the BIS.
The exception allows them to be exported to specified destinations without having to obtain a
separate license each time from the Commerce Department. None of these license exceptions,
however, allow encryption products to be exported to the following embargoed countries:
Cuba, Iran, Iraq, Libya, North Korea, Sudan and Syria.
The control of the export of encryption tools is taken seriously by the U.S. government and
by vendors. In data encryption provider PGP Corp.'s license agreements, for example,
customers must represent that they will not export to a prohibited country or to a restricted
type of user.
Even the release of technology or source code to a foreign national in the United States is
subject to the EAR and is deemed to be an export to the home country of the foreign national.
Although export regulations have been relaxed, they are still quite complex, so I suggest you
contact a lawyer for further advice.
2017-2018 Dept of ISE. 2|Page
File Encryption and Decryption Using AES
Chapter 2
Requirements Specification
2.1 Functional Requirements
This requirement outlines the functional/operational capability that the system can be able to
provide and reaction to a particular problem. The data encryption and decryption system has
the following functional requirements:
i. The system shall be able to identify documents with .txt extension, for encryption.
ii. The system shall be able to generate public and private keys to be used by registered users
for both encryption and decryption.
iii. The system shall be able to encrypt and decrypt text files stored in the computer system.
iv. The system shall be able to save the encrypted plain text as .txt files
2.2 Non-Functional Requirements
Performance
Performance of the encryption and decryption should always vary between a few hundred
milliseconds. Time taken to encrypt file and decrypt file using the AES algorithm should be
minimal.
Usability
The GUI application shall provide an easy-to-use graphical interface similar to other existing
GUI’s so that the users do not have to learn a new style of interaction.
Integrity
The system must be programmed properly to prevent exploitation through buffer overflows
etc. The system should be secure and could use encryption to protect the files.
Users need to be authenticated before having access to any personal data.
Interoperability
The application shall minimize the effort required to couple it to another system, such as an
Integrated Development Environment.
2017-2018 Dept of ISE. 3|Page
File Encryption and Decryption Using AES
2.3 Domain Constraints
Hardware limitations: There must be a 64 MB on board memory
Control functions: The software must be very user-friendly and display appropriate error
messages.
Dependencies: Requires NetBeans 8.2 IDE and SceneBuilder 8.
Parallel operations: It must support many file operations simultaneously.
Safety/security considerations: The application must be exited always normally.
2017-2018 Dept of ISE. 4|Page
File Encryption and Decryption Using AES
Chapter 3
System/Requirements Analysis
3.1 Overall System Description
Encrypt File
User Main Panel Decrypt File
Exit
Fig. 3.1: Overall System Design
The overall description of the system is as follows:
The user is first presented with the Main Panel. Here user has a set of three options.
Encrypt file: - In this Module User can encrypt a file and its contents (data stored in file).
The file is encrypted using the AES algorithm.
Decrypt file: - In this Module the user chooses the file that has to be decrypted.
Exit: - If the user wants to close the application he can do so using the Exit Button.
2017-2018 Dept of ISE. 5|Page
File Encryption and Decryption Using AES
3.2 Components/Subsystem Design
Encrypt File Module
Encrypt File Save
Main Panel
Fig. 3.2: Encrypt File Flow Diagram
In the Encrypt File module, the user can encrypt file and the data encrypted is stored in an
another file. Lastly he can exit the window and discard contents by clicking the Exit button.
Decrypt File Module
Main Panel Decrypt File Save
Fig. 3.2 Decrypt File Flow Diagram
This module allows the user to decrypt the file which was encrypted earlier and the decrypted
texts are stored in the same file. Lastly he can exit the window and discard contents by
clicking the Exit button.
2017-2018 Dept of ISE. 6|Page
File Encryption and Decryption Using AES
Chapter 4
System Design
4.1 UI Logic Interface/Interaction Details
Fig 4.1: JFXButton Encrypt File
Fx:id: encrypt an existing file
onAction: saveNewfile
Controller Class: FXMLDocumentController.java
Fig 4.2: JFXButton Decrypt File
Fx:id: decrypt an existing file
onAction: saveNewfile
Controller Class: FXMLDocumentController.java
2017-2018 Dept of ISE. 7|Page
File Encryption and Decryption Using AES
Fig 4.3: JFXButton Exit
Fx:id button
onAction: handleButtonAction
Controller Class: FXMLDocumentController.java
2017-2018 Dept of ISE. 8|Page
File Encryption and Decryption Using AES
Chapter 5
Implementation
5.1 Description of Frameworks Used
JavaFX
JavaFX is a software platform for creating and delivering desktop applications, as well as rich
Internet applications (RIAs) that can run across a wide variety of devices. JavaFX is intended
to replace Swing as the standard GUI library for Java SE, but both will be included for the
foreseeable future. JavaFX has support for desktop computers and web
browsers on Microsoft Windows, Linux, and macOS.
Before version 2.0 of JavaFX, developers used a statically typed, declarative language
called JavaFX Script to build JavaFX applications. Because JavaFX Script was compiled
to Java bytecode, programmers could also use Java code instead. JavaFX applications could
run on any desktop that could run Java SE or on any mobile phone that could run Java ME.
On desktops, JavaFX supports Windows Vista, Windows 7, Windows 8, Windows
10, macOS and Linux operating systems. Beginning with JavaFX 1.2, Oracle has released
beta versions for OpenSolaris. On mobile, JavaFX Mobile 1.x is capable of running on
multiple mobile operating systems, including Symbian OS, Windows Mobile, and
proprietary real-time operating systems.
Version Used: JavaFX 8
JFeonix Material Design Library
JFeonix is an open source Java library, that implements Google Material Design using Java
components.
Basic Components
Button
Check Box
Combo Box
Hamburger
Input Fields
2017-2018 Dept of ISE. 9|Page
File Encryption and Decryption Using AES
Progress Bar
Radio Button
Rippler
Scroll Pane
Slider
Spinner
Tab Pane
Toggle Button
Advanced Components
Badge
Decorator
Dialog
Drawer
List View
Masonry
Pickers
Popup
Snack Bar
Tree Table View
Version Used : JFeonix 8.0.4
5.2 Description of Integrated Development Environment
NetBeans
The NetBeans Platform is a framework for simplifying the development of Java
Swing desktop applications. The NetBeans IDE bundle for Java SE contains what is needed
to start developing NetBeans plugins and NetBeans Platform based applications; no
additional SDK is required.
Applications can install modules dynamically. Any application can include the Update Center
module to allow users of the application to download digitally signed upgrades and new
features directly into the running application. Reinstalling an upgrade or a new release does
not force users to download the entire application again.
2017-2018 Dept of ISE. 10 | P a g e
File Encryption and Decryption Using AES
The platform offers reusable services common to desktop applications, allowing developers
to focus on the logic specific to their application.
Among the features of the platform are:
User interface management (e.g. menus and toolbars)
User settings management
Storage management (saving and loading any kind of data)
Window management
Wizard framework (supports step-by-step dialogs)
NetBeans Visual Library
Integrated development tools
Gluon Scene Builder
Scene Builder works with the JavaFX ecosystem – official controls, community projects, and
Gluon offerings including Gluon Mobile, Gluon Desktop, and Gluon CloudLink.
Drag & Drop user interface design allows for rapid iteration. Separation of design and logic
files allows for team members to quickly and easily focus on their specific layer of
application development.
Scene Builder is free and open source but is backed by Gluon. Commercial support
offerings are available, including training and custom consultancy services.
Version Used: Scene Builder 8
2017-2018 Dept of ISE. 11 | P a g e
File Encryption and Decryption Using AES
Chapter 6
Testing
6.1 Component Test
Main Panel
TEST UNIT TEST CASE RESULT
The system invokes the
Encrypt file Panel Encrypt button is pressed respective function and displays
the window to create a file.
Decrypt Button is pressed. The system invokes the
Decrypt file Panel respective function and displays
the window to open a file.
Exit Program Exit button is pressed. The system exits normally.
Fig 6.1.1: Main Panel Tests
2017-2018 Dept of ISE. 12 | P a g e
File Encryption and Decryption Using AES
Chapter 7
Interpretation of Results
Fig 7.1 Main application
Fig 7.2 Choose a file to encrypt
2017-2018 Dept of ISE. 13 | P a g e
File Encryption and Decryption Using AES
Fig 7.3 Encrypted file
Fig 7.4 Choose a file to decrypt
2017-2018 Dept of ISE. 14 | P a g e
File Encryption and Decryption Using AES
Fig 7.5 Decrypted file
2017-2018 Dept of ISE. 15 | P a g e
File Encryption and Decryption Using AES
Conclusion
Once this project is completed it offers users the following functionalities:
It allows the user to Encrypt a file using AES algorithm, to keep his data safe.
It also allows the user to Decrypt the file to retrieve back the information.
2017-2018 Dept of ISE. 16 | P a g e
File Encryption and Decryption Using AES
References
Michael J. Folk, Bill Zoellick, Greg Riccardi: File Structures-An Object Oriented
Approach with C++, 3rd Edition, Pearson Education, 1998.
Herbert Schildt: JAVA the Complete Reference, 7th/9th Edition, Tata McGraw Hill,
2007.
Jim Keogh: J2EE-TheCompleteReference, McGraw Hill, 2007.
StackOverflow: www.stackoverflow.com
Codeproject: www.codeproject.com
Javacreek: www.javacreek.com
2017-2018 Dept of ISE. 17 | P a g e