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

MAD Lab Mini Project Report sample (1)

The document details a mini-project titled 'Alumni Portal' submitted by students Vishal Yadav and Sumeet as part of their Bachelor of Engineering in Information Science and Engineering at Visvesvaraya Technological University. It includes acknowledgments, an abstract discussing the integration of cryptography and mobile applications, and outlines the structure of the project, including system requirements, design, implementation, and results. The project aims to enhance data security through encryption using Java and XML for the user interface.

Uploaded by

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

MAD Lab Mini Project Report sample (1)

The document details a mini-project titled 'Alumni Portal' submitted by students Vishal Yadav and Sumeet as part of their Bachelor of Engineering in Information Science and Engineering at Visvesvaraya Technological University. It includes acknowledgments, an abstract discussing the integration of cryptography and mobile applications, and outlines the structure of the project, including system requirements, design, implementation, and results. The project aims to enhance data security through encryption using Java and XML for the user interface.

Uploaded by

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

VISVESVARAYA TECHNOLOGICAL

UNIVERSITY
"Jnana Sangama", Belgaum-590 018

A Mini -Project Work on

“Alumni Portal”
A Dissertation work submitted in partial fulfillment of the requirement
for the award of the degree

Bachelor of Engineering
In
Information Science & Engineering

Submitted by
Vishal Yadav 1AY20IS097
Sumeet 1AY20IS084

Under the guidance of


Prof Geethalakshmi
Assistant Professor

DEPARTMENT OF INFORMATION SCIENCE &


ENGINEERING
ACHARYA INSTITUTE OF TECHNOLOGY
(AFFILIATED TO VISVESVARAYA TECHNOLOGICAL UNIVERSITY, BELAGAVI.APPROVED BY AICTE, NEW
DELHI, ACCREDITED BY NAAC, NEW DELHI )
Acharya Dr. Sarvepalli Radhakrishnan Road, Soldevanahalli, Bengaluru-560107

2022-23
DEPARTMENT OF INFORMATION SCIENCE &
ENGINEERING
ACHARYA INSTITUTE OF TECHNOLOGY
(AFFILIATED TO VISVESVARAYA TECHNOLOGICAL UNIVERSITY, BELAGAVI.APPROVED BY AICTE, NEW DELHI,
ACCREDITED BY NAAC, NEW DELHI)
Acharya Dr. Sarvepalli Radhakrishnan Road, Soldevanahalli, Bengaluru-560107

Certificate
This is to Certify that the Mini-Project work entitled “Alumni Portal” is a bonafide work carried out
by Vishal Yadav (1AY20IS097) and Sumeet(1AY20IS084) in partial fulfillment for the award of
the degree of Bachelor of Engineering in Information Science and Engineering of the
Visvesvaraya Technological University, Belagavi during the year 2022-23. It is certified that all
corrections/suggestions indicated for Internal Assessment have been incorporated in the Report
deposited in the departmental library. The Project has been approved as it satisfies the academic
requirements in respect of Project work prescribed for the Bachelor of Engineering Degree.

Prof. Geethalakshmi Prof. Kala Venugopal


Guide HOD

Name of the Examiners Signature with date

1.

2.
ACKNOWLEDGEMENT

The satisfaction that accompanies the successful completion of this mini-project would be
incomplete without the mention of the people who made it possible through constant
guidance and encouragement.

We would take this opportunity to express our heart-felt gratitude to Sri. B.


Premnath Reddy, Chairman, Acharya Institutes and Dr. Rajath Hegde H M, Principal and
Prof. C K Marigowda, Vice Principal, Acharya Institute of Technology for providing the
necessary infrastructure to complete this mini-project.

We wish to express our deepest gratitude and thanks to Prof. Kala Venugopal, Head
of the Department, Information Science and Engineering.

We wish to express sincere thanks to my guide Prof. Sushma T M, Assistant


Professor, Department of Information Science and Engineering for helping us throughout and
guiding us from time to time.

A warm thanks to all the faculty of the Department of Information Science and
Engineering, who have helped us with their views and encouraging ideas.

i
ABSTRACT
The rise of internet has created a major challenge for securing sensitive information sent
over the network. Several solutions have been proposed in the past to protect user
data. Encryption is the main part for the security of our data. It helps us protect our data
from other people by encrypting it using a cipher which is an algorithm used for
encrypting. We have implemented the concept of both cryptography and mobile
applications in the same environment. This has helped us learn that the symbiosis of
two different domains is possible. We have used Java for the encryption part, and we
have used XML for modifying the project in the front end and making it presentable for
the user.

ii
TABLE OF CONTENTS

Acknowledgement i
Abstract ii
1. Introduction 1
1.1 Introduction to Mobile Application Developments 1
1.1.1 What is a Mobile App? 1
1.1.2 What is Mobile OS? 2
1.1.3 Types of Mobile Apps 2
1.1.4 Different Categories of Mobile Apps 2
1.1.5 What is Mobile Application Development? 3
1.1.6 Mobile Application Development Challenges 4
1.17 How to develop Mobile Apps 4
1.2 Introduction to Android Studio 6
1.2.1 What is Android? 6
1.2.2 Different Versions of Android OS 6
1.2.3 Android Development Architecture. 7
1.2.4 Installing Android Studio 8
1.2.5 Android Studio window panes 10
1.2.6 Viewing the Android Manifest 11
1.2.7 Viewing and editing Java code 11
1.2.8 Viewing and editing layouts 12
1.3 Introduction to Project 13
1.3.1 Problem Statement 13
1.3.2 Motivation and Objectives 13
1.3.3 Project Applications 13
2. System Requirements 14
2.1 Hardware Requirements 14
2.2 Software Requirements 14
3. System Design 15
3.1 User Interface Design 15
3.2 ER or Data Flow Diagram 17

v
4. Implementation 18
4.1 Source Code 18
5. Results 35

Conclusion & Future Enhancements 37


Bibliography 38

v
LIST OF FIGURES AND TABLES
Figures
Fig 1.1: Android development architecture. 7
Fig 1.2: Android studio window panes. 10
Fig 1.3 Android Manifest File. 11
Fig 1.4 MainActivity.java. 12
Fig 1.5 Design view of layout. 12
Fig-3.1.1: Main User Interface 15
Fig-3.1.2: Main page of encryption 15
Fig-3.1.2: Main page of hashing technique 16
Fig-5.1: Snapshot of encryption 35
Fig-5.2: Snapshot of decryption 35
Fig-5.3: Snapshot of hashing technique 36
Tables
Table 1.1 Different versions of Android OS 6

v
Android Text Encryption MAD Lab Mini-
Project

CHAPTER 1

INTRODUCTION
1.1Introduction to Mobile Application Development
Mobile application development is the process of making software for smartphones
and digital assistants, most commonly for Android and iOS. The software can be preinstalled
on the device, downloaded from a mobile app store or accessed through a mobile web
browser. The programming and markup languages used for this kind of software
development include Java, Swift, C# and HTML5.

Mobile app development is rapidly growing. From retail, telecommunications and e-


commerce to insurance, healthcare and government, organizations across industries must
meet user expectations for real-time, convenient ways to conduct transactions and access
information.

Today, mobile devices—and the mobile applications that unlock their value—are the most
popular way for people and businesses to connect to the internet. To stay relevant, responsive
and successful, organizations need to develop the mobile applications that their customers,
partners and employee’s demand.

1.1.1 What is a Mobile App?

A mobile application, also referred to as a mobile app or simply an app, is a computer


program or software application designed to run on a mobile device such as a phone, tablet,
or watch. Apps were originally intended for productivity assistance such as email, calendar,
and contact databases, but the public demand for apps caused rapid expansion into other areas
such as mobile games, factory automation, GPS and location-based services, order-tracking,
and ticket purchases, so that there are now millions of apps available.

Apps are generally downloaded from application distribution platforms which are operated
by the owner of the mobile operating system, such as the App Store (iOS) or Google Play
Store. Some apps are free, and others have a price, with the profit being split between the
application's creator and the distribution platform. Mobile applications often stand in contrast
to desktop applications which are designed to run on desktop computers, and web
applications which run in mobile web browsers rather than directly on the mobile device.

AIT / ISE / 2022-23 1


Android Text Encryption MAD Lab Mini-
Project

1.1.2 What is Mobile OS?

A mobile operating system (OS) is software that allows smartphones, tablet PCs
(personal computers) and other devices to run applications and programs. A mobile OS
typically starts up when a device powers on, presenting a screen with icons or tiles that
present information and provide application access. Mobile operating systems also manage
cellular and wireless network connectivity, as well as phone access.

1.1.3 Types of Mobile Apps

Native Apps: Such apps are developed for a single mobile operating system exclusively,
therefore they are “native” for a particular platform or device. App built for systems like iOS,
Android, Windows phone, Symbian, Blackberry can’t be used on a platform other than their
own.

Hybrid Apps: They are built using multi-platform web technologies (for example HTML5,
CSS and JavaScript). So-called hybrid apps are mainly website applications disguised in a
native wrapper. Apps possess usual pros and cons of both native and web mobile
applications.

Web Apps: These are software applications that behave in a fashion similar to native
applications. Web apps use a browser to run and are usually written in HTML5, JavaScript or
CSS. These apps redirect a user to URL and offer “install” option by simply creating a
bookmark to their page.

1.1.4 Different categories of Mobile Apps

Educational Apps: Educational and informative apps do just that–educate and inform. While
the purpose of this type of app is fairly straightforward, there is a lot of diversity when it
comes to educational apps, like news and language apps. If you’re looking to break into this
crowded space, you’ll need to serve up news or other information in a fun and unique format
for learners of all ages, interests, and levels.

Lifestyle Apps: This app category covers a lot of ground, literally. Where you’re going, how
you’re getting there, what you’re going to order off the menu–it all falls under lifestyle apps.
Think of apps you use for convenience, like fitness, dating, food, and travel. Lifestyle and
leisure apps are increasingly popular, especially for tasks that require an extra step aside from
the search itself (e.g., the scary action of actually picking up the phone to make a call).

AIT / ISE / 2022-23 2


Android Text Encryption MAD Lab Mini-
Project

Social Media Apps: Social media apps give users the opportunity to connect with people
inside or outside their social circles. For the most part, social media apps are universal and
have a very diverse user base. These apps are used to share live video, post images, facilitate
conversations, and more. Social media apps have quickly become part of our everyday lives.

Productivity Apps: Also known as business apps, productivity apps typically organize and
complete complex tasks for you, anything from sending an email to figuring out the tip on
your dinner bill. Most productivity apps serve a single purpose and are built with a very
intuitive interface and design to increase efficiency and improve user experience.

Entertainment Apps: This category of apps has one sole focus–keeping you busy.
Entertainment apps are often used to fill your time, whether you are jet-setting across the
country, lounging at home, or really anywhere in-between. Along with their websites, a lot of
popular streaming services have mobile applications so users can access their library
wherever they are. Entertainment apps can include video, text, or audio content.

Game Apps: This app category is pretty self-explanatory and represents the biggest portion
of app downloads by far. With such a crowded category, it makes sense that there are so
many types of game apps for different target audiences, such as arcade games, brain training
puzzles, or just plain silly games, like launching tiny birds at pigs. Some mobile app games
are played solo, others online, and occasionally in-person with a group of friends.

1.1.5 What is Mobile Application Development?

Mobile app development is the act or process by which a mobile app is developed for
mobile devices, such as personal digital assistants, enterprise digital assistants or mobile
phones. These applications can be pre-installed on phones during manufacturing platforms, or
delivered as web applications using server-side or client-side processing (e.g., JavaScript) to
provide an "application-like" experience within a Web browser.

To develop apps using the SDK, use the Java programming language for developing the app
and Extensible Markup Language (XML) files for describing data resources. By writing the
code in Java and creating a single app binary, you will have an app that can run on both
phone and tablet. To help you develop your apps efficiently, Google offers a full Java
Integrated Development Environment (IDE) called Android Studio, with advanced features
for developing, debugging, and packaging Android apps. Using Android Studio, you can
develop apps on any available Android device, or create virtual devices that emulate any
hardware configuration.

AIT / ISE / 2022-23 3


Android Text Encryption MAD Lab Mini-
Project

1.1.6 Mobile Application Development Challenges

While the Android platform provide rich functionality for app development, there are
still a number of challenges you need to address, such as:

● Building for a multi-screen world

● Getting performance right

● Keeping your code and your users secure

● Remaining compatible with older platform versions

● Understanding the market and the user.

1.1.7 How to develop Mobile Apps

Step 1: Set a Goal

Step away from any form of technology and get out a pen and paper and define what it is you
want to accomplish. The starting line in the app development word is a pen and paper, not
complex coding and designing.

Step 2: Sketch your ideas

You need to use the pen and paper that has the answers to the questions about your apps
purpose to develop a sketch of what it will look like. Here you move your clearly worded
ideas into visual representations of your thoughts. Decide if you are going to give your app
away and offer ads to generate money, or are you going to offer it as a paid download. You
can also choose the option to offer in app purchases.

Step 3: Research

You have to dig deep and research the competition of your app idea. I know you think you
have one of a kind idea, but the numbers are not in your favor—odds are someone has
already tried it. You can look at this in two different ways. One you can become deflated
and give up, or two, you can examine the competition and make your app better.

Step 4: Wireframe

In the technology world, a wireframe is a glorified story board. Here is where you take your
sketch and your design idea, and you give your idea a little more clarity and functionality.
This will become the foundation for your app’s development, so it really is a crucial step.

AIT / ISE / 2022-23 4


Android Text Encryption MAD Lab Mini-
Project

Step 5: Start Defining the Back End of Your App

We left off with your wireframe, so at this point in your app development, you have a
storyboard of how you want your app to function. Now it’s time to use that storyboard to
start examine functionality.

Step 6: Check Your Model

Here’s where you need to call in the troops. Show your demo to friends, family, and anyone
else who is willing to give you constructive criticism. Don’t waste your time with people
who will tell you, “Wow, that’s neat.” Seek out those cynics and critics. Brutal honesty is
crucial at this phase.

Step 7: Get Building

With the foundation in place, you can start to put the puzzle together to building your app.
First, your developer will set up your servers, databases, and APIs.

Step 8: Design the Look

Now it’s time to employ the designers to create your UI, user interface. The user interface is a
very important part of your app because people are attracted to how things look and how easy
they are to navigate.

Step 9: Test Your App, again

A second round of testing is imperative. In this round, you will have both a functioning app
as well as a user interface to test. All the screens of your app should properly work at this
point, and your app should be visually appealing as well.

Step 10: Modify and Adjust

You’ve taken your prototype for a spin, and you’ve learned that there are still a few tweaks
you need to make. Now that you’ve seen your app in it’s fully functioning form, you need to
call the troops back and ask they to do the same.

Step 11: Beta Testing

You’ve looked at your app through several different lenses, and you think you’ve managed to
develop a smoothly functioning, aesthetically pleasing, problem solving app. Now, you need
to examine how your app is going to function in a live environment.

AIT / ISE / 2022-23 5


Android Text Encryption MAD Lab Mini-
Project

Step 12: Release Your App

You’ve made it to the finish line. You’ve brought your idea to fruition, and the last step is to
share it with the world. Hopefully, you’ve gone on to solve a major problem. If not, with
any luck your app has some features that can simplify or bring enjoyment to someone’s life.
Regardless, you’ve accomplished something big. Now it’s time to distribute it.

1.2 Introduction to Android Studio

Android is one of the most popular mobile device platforms. The Android platform allows
developers to write managed code using Java to manage and control the Android device.
Android Studio is a popular IDE developed by Google for developing applications that are
targeted at the Android platform. Android Studio has replaced Eclipse as the IDE of choice
for developing Android applications.

1.2.1 What is Android?

Android is a software package and Linux based operating system for mobile devices such as
tablet computers and smartphones. It is developed by Google and later the OHA (Open
Handset Alliance). Java language is mainly used to write the android code even though other
languages can be used.

1.2.2 Different versions of Android OS


Table 1.1: Different versions of Android OS

Name Version Numbers Release Date API Level

No official Name 1.0 Sept, 2008 1

No official Name 1.1 Feb, 2009 2

Cupcake 1.5 Apr, 2009 3

Donut 1.6 Sept, 2009 4

Éclair 2.0-2.1 Oct, 2009 5-7

Froyo 2.2-2.2.3 May, 2010 8

AIT / ISE / 2022-23 6


Android Text Encryption MAD Lab Mini-
Project

Gingerbread 2.3-2.3.7 Dec, 2010 9-10

Honeycomb 3.0-3.2.6 Feb, 2011 11-13

Ice Cream Sandwich 4.0-4.0.4 Oct, 2011 14-15

Jelly Bean 4.1-4.3.1 July, 2012 16-18

KitKat 4.4-4.4.4 Oct, 2013 19-20

Lollipop 5.0-5.1.1 Nov, 2014 21-22

Marshmallow 6.0-6.0.1 Oct, 2015 23

Nougat 7.0-7.1.2 Aug, 2016 24-25

Oreo 8.0-8.1 Aug, 2017 26-27

Pie 9 Aug, 2018 28

Android 10 10 Sept, 2019 29

Android 11 11 Sept 2020 30

1.2.3 Android Development Architecture

AIT / ISE / 2022-23 7


Android Text Encryption MAD Lab Mini-
Project

Fig 1.1: Android development architecture.

Apps: Your apps live at this level, along with core system apps for email, SMS messaging,
calendars, Internet browsing, or contacts.

Java API Framework: All features of Android are available to developers through
application programming interfaces (APIs) written in the Java language. You don't need to
know the details of all of the APIs to learn how to develop Android apps, but you can learn
more about the following APIs, which are useful for creating apps:

● View System used to build an app's UI, including lists, buttons, and menus.

● Resource Manager used to access to non-code resources such as localized strings,


graphics, and layout files.

● Notification Manager used to display custom alerts in the status bar.

● Activity Manager that manages the lifecycle of apps.

● Content Providers that enable apps to access data from other apps.

● All framework APIs that Android system apps use.

Libraries and Android Runtime: Each app runs in its own process and with its own
instance of the Android Runtime, which enables multiple virtual machines on low-memory
devices. Android also includes a set of core runtime libraries that provide most of the
functionality of the Java programming language, including some Java 8 language features
that the Java API framework uses. Many core Android system components and services are
built from native code that require native libraries written in C and C++. These native
libraries are available to apps through the Java API framework.

Hardware Abstraction Layer (HAL): This layer provides standard interfaces that expose
device hardware capabilities to the higher-level Java API framework.

Linux Kernel: The foundation of the Android platform is the Linux kernel. The above layers
rely on the Linux kernel for underlying functionalities such as threading and low-level
memory management.

1.2.4 Installing Android Studio

System Requirements:

● Microsoft® Windows® 7/8/10, Mac or Linux (64-bit).

AIT / ISE / 2022-23 8


Android Text Encryption MAD Lab Mini-
Project

● 4 GB RAM minimum, 8 GB RAM recommended.

● GB of available disk space minimum, 4 GB Recommended.

● 1280 x 800 minimum screen resolution.

Windows

To install Android Studio on Windows, proceed as follows:

● Download android-studio-ide-201.7199119-windows.exe file from the


https://developer.android.com/studio

● Double-click .exe file to launch it.

● Follow the setup wizard in Android Studio and install any SDK packages that it
recommends.

Mac

To install Android Studio on your Mac, proceed as follows:

● Launch the Android Studio DMG file.

● Drag and drop Android Studio into the Applications folder, then launch Android
Studio.

● Select whether you want to import previous Android Studio settings, then click OK.

● The Android Studio Setup Wizard guides you through the rest of the setup, which
includes downloading Android SDK components that are required for development.

Linux

To install Android Studio on Linux, proceed as follows:

● Unpack the .zip file you downloaded to an appropriate location for your applications,
such as within /usr/local/ for your user profile, or /opt/ for shared users.

● If you're using a 64-bit version of Linux, make sure you first install the required
libraries for 64-bit machines.

● To launch Android Studio, open a terminal, navigate to the android-studio/bin/


directory, and execute studio.sh.

● Select whether you want to import previous Android Studio settings or not, then click
OK.

AIT / ISE / 2022-23 9


Android Text Encryption MAD Lab Mini-
Project

● The Android Studio Setup Wizard guides you through the rest of the setup, which
includes downloading Android SDK components that are required for development.

1.2.5 Android Studio Window Panes

Fig 1.2: Android studio window panes.

● The Toolbar. The toolbar carries out a wide range of actions, including running the
Android app and launching Android tools.

● The Navigation Bar. The navigation bar allows navigation through the project and
open files for editing. It provides a more compact view of the project structure.

● The Editor Pane. This pane shows the contents of a selected file in the project. For
example, after selecting a layout (as shown in the figure), this pane shows the layout
editor with tools to edit the layout. After selecting a Java code file, this pane shows
the code with tools for editing the code.

● The Status Bar. The status bar displays the status of the project and Android Studio
itself, as well as any warnings or messages. You can watch the build progress in the
status bar.

● The Project Pane. The project pane shows the project files and project hierarchy.

AIT / ISE / 2022-23 10


Android Text Encryption MAD Lab Mini-
Project

● The Monitor Pane. The monitor pane offers access to the TODO list for managing
tasks, the Android Monitor for monitoring app execution (shown in the figure), the
logcat for viewing log messages, and the Terminal application for performing
Terminal activities.

1.2.6 Viewing the Android Manifest

Before the Android system can start an app component, the system must know that the
component exists by reading the app's AndroidManifest.xml file. The app must declare all its
components in this file, which must be at the root of the app project directory. To view this
file, expand the manifests folder in the Project: Android view, and double-click the file
(AndroidManifest.xml). Its contents appear in the editing pane as shown in the figure below.

Fig 1.3: Android manifest file.

1.2.7 Viewing and editing Java code

Components are written in Java and listed within module folders in the java folder in the
Project: Android view. Each module name begins with the domain name (such as
com.example.android) and includes the app name.

The following example shows an activity component:

● Click the module folder to expand it and show the MainActivity file for the activity
written in Java (the MainActivity class).

● Double-click MainActivity to see the source file in the editing pane, as shown in the
figure below.

AIT / ISE / 2022-23 11


Android Text Encryption MAD Lab Mini-
Project

Fig 1.4: MainActivity.java file.

1.2.8 Viewing and editing layouts

Layout resources are written in XML and listed within the layout folder in the res folder in
the Project: Android view. Click res > layout and then double-click activity_main.xml to see
the layout file in the editing pane. Android Studio shows the Design view of the layout, as
shown in the figure below. This view provides a Palette pane of user interface elements, and a
grid showing the screen layout.

Fig 1.5: Design view of layout.

AIT / ISE / 2022-23 12


Android Text Encryption MAD Lab Mini-
Project

1.3 Introduction to Project

Encryption is changing the way information is displayed so that it is masked and the
only way its true form can be viewed with a clear set of instructions.

Decryption is the reverse process of encryption. It is the process of decoding all encrypted
data using symmetric or asymmetric key in such a way that only authorized parties can
access the data and can read it.

The main purpose of developing a cryptosystem is to protect the user’s data privacy.
Information is transferred from one user to another. In that case, possibilities of data
losing or stealing data still remain there. So it is necessary for us to inspect the overall access
of data from any unauthorized public or interceptor. So, to protect the information from
being lost or stolen, encryption is used/cryptosystem is necessary.

1.3.1 Problem Statement

The primary purpose of encryption is to protect the confidentiality of digital data stored on
computer systems or transmitted over the internet or any other computer network.

1.3.2 Motivation and Objectives

● To develop an algorithm for data security in an android platform.


● To maintain the security of the system by preventing cryptanalytic attack like key
attacks and brute force attacks

1.3.3 Project Applications

● This system can be used by everyone who wants to send some confidential text via
social media.
● Fast and easy way of to send secure stuff.
● Easy process to encrypt text.
● Highly secure as type of algorithm and secret key is required while encryption and
decryption.

AIT / ISE / 2022-23 13


Android Text Encryption MAD Lab Mini-
Project

CHAPTER 2
SYSTEM REQUIREMENTS
2.1 Hardware Requirements
● Tools: Android Studio 4.2.2(Software), Android Phone or Emulator.
● Platform: Windows 8 / Windows 10.
● RAM: 4GB of RAM Minimum, 8GB of RAM is recommended.
● Memory: 256GB of Hard drive.

2.2 Software Requirements


● Operating system: Windows® Vista 64-Bit / Windows® 7 64-Bit /Windows®
8.1 64-Bit.
● Front end: XML
● Back end: Java
● SDK : Android 5.0
● IDE: Android Studio

AIT / ISE / 2022-23 14


Android Text Encryption MAD Lab Mini-
Project

CHAPTER 3
DESIGN
3.1 User Interface Design
This is the home page of the app where you can see the encryption and hash button.

Fig-3.1.1: Main User Interface.


You can see the front view of the app. At the top you can see the index where you can switch
between the different algorithms. This is the overview of the application, encryption process
and hashing technique.

Fig-3.1.2: Main page of encryption

AIT / ISE / 2022-23 15


Android Text Encryption MAD Lab Mini-
Project

Fig-3.1.2: Main page of hashing

AIT / ISE / 2022-23 16


Android Text Encryption MAD Lab Mini-
Project

3.2 ER Diagram /Data Flow Diagram

Fig-3.2: Data Flow Diagram of encryption.

Fig-3.2: Data Flow Diagram of hashing technique

CHAPTER 4

AIT / ISE / 2022-23 17


Android Text Encryption MAD Lab Mini-
Project

IMPLEMENTATION
4.1 Source Code
encryption.java
package Encryption;
import android.content.Context;
import android.os.Bundle;
import android.text.InputType;
import android.util.Base64;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;
import androidx.appcompat.app.AppCompatActivity;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.constraintlayout.widget.ConstraintSet;
import androidx.fragment.app.Fragment;
import com.example.Algorithms.R;
import java.nio.charset.StandardCharsets;
import java.security.KeyPair;
import java.security.KeyPairGenerator;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.security.PublicKey;
import Encryption.Algorithms.AES;
import Encryption.Algorithms.DES;
import Encryption.Algorithms.PlayFair;
import Encryption.Algorithms.Vigenere;
import Encryption.Algorithms.Caesarcipher;
public class EncryptionMain extends Fragment {

AIT / ISE / 2022-23 18


Android Text Encryption MAD Lab Mini-
Project

private String message;


private String key;
private Button Switch;
private Button Encrypt_Buuton;
private Button Decrypt_Buuton;
private PlayFair p;
private TextView Answer;
private EditText Textfield_Text;
private EditText Textfield_Key;
private TextView Matrix_value;
private TextView Play_Fair_VALUE;
private View view;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle
savedInstanceState) {
view = inflater.inflate(R.layout.encryption_main, container, false);
((AppCompatActivity)getActivity()).getSupportActionBar().hide();
getActivity().getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
Switch = view.findViewById(R.id.Swtich);
Encrypt_Buuton = view.findViewById(R.id.Encrypt_Buuton);
Decrypt_Buuton = view.findViewById(R.id.Decrypt_Buuton);
Answer = view.findViewById(R.id.Answer);
Textfield_Text = view.findViewById(R.id.TextArea);
Textfield_Key = view.findViewById(R.id.Key);
Matrix_value = view.findViewById(R.id.Matrix);
Play_Fair_VALUE = view.findViewById(R.id.Play_Fair_VALUE);
return view;
}
public void encrypt(View view) throws Exception {
if (Textfield_Text.length() == 0) {
Toast.makeText(view.getContext(), "Enter a message to Encrypt",
Toast.LENGTH_SHORT).show();
return;

AIT / ISE / 2022-23 19


Android Text Encryption MAD Lab Mini-
Project

}
message = String.valueOf(Textfield_Text.getText());
key = String.valueOf(Textfield_Key.getText());
String Algorithm = String.valueOf(Switch.getText());
switch (Algorithm) {
case "Advanced Encryption Standard":
AES aes = new AES();
String enc = aes.AESencrypt(key.getBytes("UTF-16LE"),
message.getBytes("UTF-16LE"));
Answer.setText(enc);
break;
case "Triple Data Encryption Standard":
DES des = new DES();
String encData = des.encrypt(key.getBytes("UTF-16LE"),
message.getBytes("UTF-16LE"));
Answer.setText(encData);
break;
case "Caesar Cipher":
if (key.isEmpty()) {
Toast.makeText(view.getContext(), "Enter a key to Encrypt",
Toast.LENGTH_SHORT).show();
return;
}
if (key.length() > 26) {
Toast.makeText(view.getContext(), "The Key must be less than 26 characters",
Toast.LENGTH_SHORT).show();
return;
}
Caesarcipher c = new Caesarcipher();
Answer.setText(c.caesarcipherEnc(message, Integer.parseInt(key)));
break;
case "Vigenere Cipher":
if (Textfield_Key.length() == 0) {

AIT / ISE / 2022-23 20


Android Text Encryption MAD Lab Mini-
Project

Toast.makeText(view.getContext(), "Enter a key to Encrypt",


Toast.LENGTH_SHORT).show();
return;
}
for (char i : message.toUpperCase().toCharArray()) {
if (i < 'A' || i > 'Z') {
Toast.makeText(view.getContext(), "Only Letters are allowed here",
Toast.LENGTH_SHORT).show();
return;
}
}
for (char i : key.toUpperCase().toCharArray()) {
if (i < 'A' || i > 'Z') {
Toast.makeText(view.getContext(), "Only Letters are allowed here",
Toast.LENGTH_SHORT).show();
return;
}
}
Vigenere v = new Vigenere();
Answer.setText(v.Vigenereencrypt(message, key));
break;
case "Play Fair":
try {
p = new PlayFair("");
Play_Fair_VALUE.setText(p.Encrypt(message, key));
Matrix_value.setText(p.getT1());
} catch (Exception e) {
Toast.makeText(view.getContext(), "Only Letters are allowed here",
Toast.LENGTH_SHORT).show();
}
break;
}
}
public void decrypt(View view) throws Exception {

AIT / ISE / 2022-23 21


Android Text Encryption MAD Lab Mini-
Project

if (Textfield_Text.length() == 0) {
Toast.makeText(view.getContext(), "Enter a message to Decrypt",
Toast.LENGTH_SHORT).show();
return;
}
message = String.valueOf(Textfield_Text.getText());
key = String.valueOf(Textfield_Key.getText());
String SwitchValue = Switch.getText().toString();
switch (SwitchValue) {
case "Advanced Encryption Standard":
AES aes = new AES();
try {
String decData = aes.AESdecrypt(key, Base64.decode(message.getBytes("UTF-
16LE"), Base64.DEFAULT));
Answer.setText(decData);
} catch (Exception e) {
Toast.makeText(view.getContext(), "Your key is wrong",
Toast.LENGTH_SHORT).show();
}
break;
case "Triple Data Encryption Standard":
DES des = new DES();
try {
String decData = des.decrypt(key, Base64.decode(message.getBytes("UTF-
16LE"), Base64.DEFAULT));
Answer.setText(decData);
} catch (Exception e) {
Toast.makeText(view.getContext(), "Your key is wrong",
Toast.LENGTH_SHORT).show();
}
break;
case "Caesar Cipher":
if (Textfield_Key.length() == 0) {

AIT / ISE / 2022-23 22


Android Text Encryption MAD Lab Mini-
Project

Toast.makeText(view.getContext(), "Enter a key",


Toast.LENGTH_SHORT).show();
return;
}
if (Integer.parseInt(key) >= 26) {
Toast.makeText(view.getContext(), "The Key must be less than 26 characters",
Toast.LENGTH_SHORT).show();
return;
}
Caesarcipher c = new Caesarcipher();
Answer.setText(c.caesarcipherDec(message, Integer.parseInt(key)));
break;
case "Vigenere Cipher":
if (Textfield_Key.length() == 0) {
Toast.makeText(view.getContext(), "Enter a key to Decrypt",
Toast.LENGTH_SHORT).show();
return;
}
for (char i : message.toUpperCase().toCharArray()) {
if (i < 'A' || i > 'Z') {
Toast.makeText(view.getContext(), "Only Letters are allowed here",
Toast.LENGTH_SHORT).show();
return;
}
}
for (char i : key.toUpperCase().toCharArray()) {
if (i < 'A' || i > 'Z') {
Toast.makeText(view.getContext(), "Only Letters are allowed here",
Toast.LENGTH_SHORT).show();
return;
}
}
Vigenere v = new Vigenere();
Answer.setText(v.Vigeneredecrypt(message, key));

AIT / ISE / 2022-23 23


Android Text Encryption MAD Lab Mini-
Project

break;
case "Play Fair":
try {
Play_Fair_VALUE.setText(p.Decrypt(message, key));
Matrix_value.setText(p.getT1());
} catch (Exception e) {
Toast.makeText(view.getContext(), "Only Letters are allowed here",
Toast.LENGTH_SHORT).show();
}
break;
}
}
public void switchAlgho(View view) {
reset(null);
String SwitchValue = Switch.getText().toString();
switch (SwitchValue) {
case "Advanced Encryption Standard":
Switch.setText("Triple Data Encryption Standard");
break;
case "Triple Data Encryption Standard":
Textfield_Key.setInputType(InputType.TYPE_CLASS_NUMBER);
Switch.setText("Caesar Cipher");
break;
case "Caesar Cipher":
Textfield_Key.setInputType(InputType.TYPE_CLASS_TEXT);
Switch.setText("Vigenere Cipher");
break;
case "Vigenere Cipher":
Textfield_Key.setVisibility(View.VISIBLE);
Answer.setVisibility(View.GONE);
Matrix_value.setVisibility(View.VISIBLE);
Play_Fair_VALUE.setVisibility(View.VISIBLE);
Switch.setText("Play Fair");
break;

AIT / ISE / 2022-23 24


Android Text Encryption MAD Lab Mini-
Project

case "Play Fair":


Answer.setVisibility(View.VISIBLE);
Matrix_value.setVisibility(View.GONE);
Play_Fair_VALUE.setVisibility(View.GONE);
Switch.setText("Advanced Encryption Standard");
break;
}
}
public void reset(View view) {
Textfield_Text.setText("");
Textfield_Key.setText("");
Answer.setText("");
Play_Fair_VALUE.setText("");
Matrix_value.setText("");
if(view!=null)
Toast.makeText(view.getContext(), "All data has been deleted",
Toast.LENGTH_SHORT).show();
}
public void copyToClipboard(View view) {
if (Play_Fair_VALUE.length() == 0) {
String copyText = String.valueOf(Answer.getText());
if (Answer.length() == 0) {
Toast.makeText(view.getContext(), "There is no message to copy",
Toast.LENGTH_SHORT).show();
return;
}
int sdk = android.os.Build.VERSION.SDK_INT;
if (sdk < android.os.Build.VERSION_CODES.HONEYCOMB) {
android.text.ClipboardManager clipboard = (android.text.ClipboardManager)
view.getContext().getSystemService(Context.CLIPBOARD_SERVICE);
clipboard.setText(copyText);
} else {
android.content.ClipboardManager clipboard =
(android.content.ClipboardManager)

AIT / ISE / 2022-23 25


Android Text Encryption MAD Lab Mini-
Project

view.getContext().getSystemService(Context.CLIPBOARD_SERVICE);
android.content.ClipData clip = android.content.ClipData
.newPlainText("Your message :", copyText);
clipboard.setPrimaryClip(clip);
}
Toast.makeText(view.getContext(),
"Your message has be copied", Toast.LENGTH_SHORT).show();
} else {
int sdk = android.os.Build.VERSION.SDK_INT;
if (sdk < android.os.Build.VERSION_CODES.HONEYCOMB) {
android.text.ClipboardManager clipboard = (android.text.ClipboardManager)
view.getContext().getSystemService(Context.CLIPBOARD_SERVICE);
clipboard.setText(Play_Fair_VALUE.getText().toString());
} else {
android.content.ClipboardManager clipboard =
(android.content.ClipboardManager)
view.getContext().getSystemService(Context.CLIPBOARD_SERVICE);
android.content.ClipData clip = android.content.ClipData
.newPlainText("Your message :", Play_Fair_VALUE.getText().toString());
clipboard.setPrimaryClip(clip);
}
Toast.makeText(view.getContext(), "Your message has be copied",
Toast.LENGTH_SHORT).show();
}
}
}

hash.java
package Hash;
import android.content.Context;
import android.os.Bundle;
import android.text.InputType;
import android.util.Base64;

AIT / ISE / 2022-23 26


Android Text Encryption MAD Lab Mini-
Project

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;
import androidx.appcompat.app.AppCompatActivity;
import androidx.fragment.app.Fragment;
import com.example.Algorithms.R;
import java.math.BigInteger;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.security.NoSuchProviderException;
import java.security.SecureRandom;
public class HashMain extends Fragment {
private Button Switch;
private Button Hash_Buuton;
private TextView Answer;
private EditText Textfield_Text;
private EditText Textfield_salt;
private String message;
private String salt;
private View view;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle
savedInstanceState) {
view = inflater.inflate(R.layout.hash_main, container, false);
((AppCompatActivity) getActivity()).getSupportActionBar().hide();
getActivity().getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);

AIT / ISE / 2022-23 27


Android Text Encryption MAD Lab Mini-
Project

Switch = view.findViewById(R.id.Swtich);
Hash_Buuton = view.findViewById(R.id.hash_Buuton);
Answer = view.findViewById(R.id.Answer);
Textfield_Text = view.findViewById(R.id.TextArea);
Textfield_salt = view.findViewById(R.id.salt);
return view;
}
public void hash(View view) throws Exception {
if (Textfield_Text.length() == 0) {
Toast.makeText(view.getContext(), "Enter a message to Hash",
Toast.LENGTH_SHORT).show();
return;
}
message = String.valueOf(Textfield_Text.getText());
salt = String.valueOf(Textfield_salt.getText());
String Algorithm = String.valueOf(Switch.getText());
String answer="";
switch (Algorithm) {
case "MD5":
answer=hashText("MD5",salt,message);
Answer.setText(answer);
break;
case "SHA-256":
answer=hashText("SHA-256",salt,message);
Answer.setText(answer);
break;
case "SHA-512":
answer=hashText("SHA-512",salt,message);
Answer.setText(answer);
break;
}
}

AIT / ISE / 2022-23 28


Android Text Encryption MAD Lab Mini-
Project

public void switchAlgho(View view) {


reset(null);
String SwitchValue = Switch.getText().toString();
switch (SwitchValue) {
case "MD5":
Switch.setText("SHA-256");
break;
case "SHA-256":
Switch.setText("SHA-512");
break;
case "SHA-512":
Switch.setText("MD5");
break;
}
}
public String hashText(String algo,String salt, String plainText)
throws NoSuchAlgorithmException {
MessageDigest m = MessageDigest.getInstance(algo);
m.reset();
if (salt.length() != 0) {
m.update(salt.getBytes());
}
m.update(plainText.getBytes());
byte[] digest = m.digest();
BigInteger bigInt = new BigInteger(1,digest);
String hashtext = bigInt.toString(16);
// Now we need to zero pad it if you actually want the full 32 chars.
while(hashtext.length() < 32 ){
hashtext = "0"+hashtext;
}
return hashtext;
}

AIT / ISE / 2022-23 29


Android Text Encryption MAD Lab Mini-
Project

private byte[] getRandomSalt() throws NoSuchAlgorithmException,


NoSuchProviderException
{
//Always use a SecureRandom generator
SecureRandom sr = SecureRandom.getInstance("SHA1PRNG", "SUN");
//Create array for salt
byte[] salt = new byte[16];
//Get a random salt
sr.nextBytes(salt);
//return salt
return salt;
}
public void reset(View view) {
Textfield_Text.setText("");
Textfield_salt.setText("");
Answer.setText("");
if(view!=null)
Toast.makeText(view.getContext(), "All data has been deleted",
Toast.LENGTH_SHORT).show();
}
public void copyToClipboard(View view) {
String copyText = String.valueOf(Answer.getText());
if (Answer.length() == 0) {
Toast.makeText(view.getContext(), "There is no message to copy",
Toast.LENGTH_SHORT).show();
return;
}
int sdk = android.os.Build.VERSION.SDK_INT;
if (sdk < android.os.Build.VERSION_CODES.HONEYCOMB) {
android.text.ClipboardManager clipboard = (android.text.ClipboardManager)
view.getContext().getSystemService(Context.CLIPBOARD_SERVICE);
clipboard.setText(copyText);

AIT / ISE / 2022-23 30


Android Text Encryption MAD Lab Mini-
Project

} else {
android.content.ClipboardManager clipboard =
(android.content.ClipboardManager)
view.getContext().getSystemService(Context.CLIPBOARD_SERVICE);
android.content.ClipData clip = android.content.ClipData
.newPlainText("Your message :", copyText);
clipboard.setPrimaryClip(clip);
}
Toast.makeText(view.getContext(),
"Your message has be copied", Toast.LENGTH_SHORT).show();
}
}

main.java
package Main;
import android.os.Bundle;
import android.view.View;
import androidx.appcompat.app.AppCompatActivity;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentTransaction;
import com.example.Algorithms.R;
import Encryption.EncryptionMain;
import Hash.HashMain;
public class MainActivity extends AppCompatActivity {
EncryptionMain encryptionMain;
HashMain hashMain;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Fragment fragment = new MainFragment();

AIT / ISE / 2022-23 31


Android Text Encryption MAD Lab Mini-
Project

FragmentManager fragmentManager = getSupportFragmentManager();


fragmentManager.beginTransaction().replace(R.id.container, fragment).commit();
}
public void goToEncryption(View view) {
encryptionMain = new EncryptionMain();
FragmentManager manager = getSupportFragmentManager();
FragmentTransaction transaction = manager.beginTransaction();
transaction.setCustomAnimations(android.R.anim.fade_in,android.R.anim.fade_out,
android.R.anim.fade_in, android.R.anim.fade_out);
transaction.replace(R.id.container, encryptionMain);
transaction.addToBackStack(null);
transaction.commit();
}
public void goToHash(View view) {
hashMain = new HashMain();
FragmentManager manager = getSupportFragmentManager();
FragmentTransaction transaction = manager.beginTransaction();
transaction.setCustomAnimations(android.R.anim.fade_in,android.R.anim.fade_out,
android.R.anim.fade_in, android.R.anim.fade_out);
transaction.replace(R.id.container, hashMain);
transaction.addToBackStack(null);
transaction.commit();
}
public void encryptionButtonClick(View view) {
try {
switch (view.getId()) {
case R.id.Swtich:
encryptionMain.switchAlgho(view);
break;
case R.id.Encrypt_Buuton:
encryptionMain.encrypt(view);
break;

AIT / ISE / 2022-23 32


Android Text Encryption MAD Lab Mini-
Project

case R.id.Decrypt_Buuton:
encryptionMain.decrypt(view);
break;
case R.id.copy_button:
encryptionMain.copyToClipboard(view);
break;
case R.id.reset_button:
encryptionMain.reset(view);
break;
}
}
catch (Exception e){
e.printStackTrace();
}
}
public void HashButtonClick(View view) {
try {
switch (view.getId()) {
case R.id.Swtich:
hashMain.switchAlgho(view);
break;
case R.id.hash_Buuton:
hashMain.hash(view);
break;
case R.id.copy_button:
hashMain.copyToClipboard(view);
break;
case R.id.reset_button:
hashMain.reset(view);
break;
}
}

AIT / ISE / 2022-23 33


Android Text Encryption MAD Lab Mini-
Project

catch (Exception e){


e.printStackTrace();
}
}
}

CHAPTER 5

AIT / ISE / 2022-23 34


Android Text Encryption MAD Lab Mini-
Project

RESULTS
The following snapshot contains the encryption part of the application where users enter the
text that needs to be encrypted and a key.When the encrypt button is pressed cipher text is
displayed.

Fig-5.1: Snapshot of encryption


The following snapshot contains the decryption part of the application where users enter the
cipher text obtained before and the key provided. When decrypt key is pressed message will
be displayed

Fig-5.3: Snapshot of decryption

AIT / ISE / 2022-23 35


Android Text Encryption MAD Lab Mini-
Project

The following snapshot contains the hashing part of the application where users enter the text
that needs to be hashed and a salt. When hash button is pressed, hashed text is displayed.

Fig-5.4: Snapshot of hash technique

AIT / ISE / 2022-23 36


Android Text Encryption MAD Lab Mini-
Project

CONCLUSION & FUTURE ENHANCEMENT


Conclusion
Today, our main problem is that we are very concerned about security. As a result, we fall
into very high risk when our data or information is leaked. The main attempt to get rid of
these problems is to create a safe security system in the android platform. The accuracy of
android based text encryption is that it encodes any data or information in such a way
that an unauthorized person cannot read it but only authorized person can. So, to protect
all the information in our daily life more securely, the cryptographic technique is needed.

Future Enhancement
● While some messaging apps already offer end-to-end encryption, it could become a
standard feature in the future. This would ensure that only the sender and recipient
can read the encrypted messages, protecting them from unauthorized access or
interception.
● Adding an extra layer of security through multi-factor authentication (MFA) can
significantly enhance the protection of encrypted text messages. This could involve
using biometric authentication (e.g., fingerprint or facial recognition) or hardware
tokens in addition to passwords or PINs.
● Making encryption applications more user-friendly and intuitive can encourage wider
adoption and ensure that individuals can easily encrypt their text messages without
requiring advanced technical knowledge. Streamlined interfaces, guided setup
processes, and automated encryption can all contribute to improving the user
experience.
● Future enhancements could enable seamless encryption and synchronization of text
messages across multiple devices using cloud storage. This would allow users to
access their encrypted messages from different devices while maintaining their
security and privacy.

AIT / ISE / 2022-23 37


Android Text Encryption MAD Lab Mini-
Project

BIBLIOGRAPHY
Book References
➢ Google Developer Training, "Android Developer Fundamentals Course – Concept
Reference”, Google Developer Training Team, 2017.
➢ Erik Hellman, “Android Programming – Pushing the Limits”, 1st Edition, Wiley India
Pvt Ltd, 2014. ISBN-13: 978-8126547197.
➢ Dawn Griffiths and David Griffiths, “Head First Android Development”, 1st Edition,
O’Reilly
➢ SPD Publishers, 2015. ISBN-13: 978-9352131341.
➢ Bill Phillips, Chris Stewart and Kristin Marsicano, “Android Programming: The Big
Nerd Ranch Guide”, 3rd Edition, Big Nerd Ranch Guides, 2017. ISBN-13: 978-
0134706054.

Web References
➢ Android Developers https://developer.android.com/
➢ Android Tutorial https://www.tutorialspoint.com/android/index.htm
➢ Android Tutorial https://www.w3schools.in/category/android-tutorial/
➢ Java Tutorial https://www.javatpoint.com/java-tutorial
➢ Java Tutorial https://www.w3schools.com/java/

AIT / ISE / 2022-23 38

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy