Mobile App Client Server-Caeser Encryption
Mobile App Client Server-Caeser Encryption
Introduction
1.1. Introduction
The amount and variety of data that require to be secret today is immense,
but the problems of data security were recognized centuries ago. The records that
show that early Romans encrypted messages carried by couriers to distant
battlefields. Kings and queens kept secret the details of family madness and
peccadilloes. Nobles sent tokens (a ring, a seal) with their messages to prove their
source. Ancient religious stories complain of tax collectors and recount arguments
over the validity of their records. Like our ancestors, we design data security with
the tools that we have, and like them we still require data security to follow several
basic principles:
• Non-repudiation
1
The sender must not be able to deny sending the information, and the
receiver must not be able to deny it was received
2
3
1.4. Chapters Outlines
Chapter Two
Chapter Three
Chapter Four
4
Chapter Two
This chapter introduces the basic concepts in cryptography. Although this word
sounds fearful, we shall realize that it is very simple to understand. In fact, most
terms in computer security have very straightforward meaning terms. for no
reason. sound complicated.
Any communication in the language that you and I speak that is the human
language, takes the form of plain text or clear text. That is the message in plain text
can be understood by anybody knowing the language as long as the message is not
codified in any manner, For instance, when we speak with our family members.
Friends or colleagues. we use plain text because we do not want to hide anything
from them. Suppose I say “Hi Anita”, it is plain text because both Anita and I
5
know its meaning and intention. More significantly, anybody in the same room
would also get to hear these words. and would know that I am greeting Anita.
Notably. we also use plain text during electronic conversations. For instance.
When we send an email to someone, we compose the email message using English
(or these days another) language. For instance, I can compose the email message as
shown in Fig 2.1.
Now. not only Amit, but also any other person who reads this email would know
what I have written. As before. This is simply because I am not using any codified
language here.
I have composed my email message using plain English This is another example of
plain text, albeit in written form.
In normal life, we do not bother much about the fact that someone could be
overhearing us. In most cases. that makes little difference lo us because the person
overhearing us can do little dan1age by using the overheard information after all,
we do not reveal n1an)" secrets in our day-to-day lives.
However, there are situations where we are concerned about the secrecy of our
conversations. For instance, suppose that I am interested in knowing my bank
account's balance and hence I call up my phone banker from my office. The phone
6
banker would generally ask a secret question (e.g. what is your mother’s maiden
name?) whose answer only I know.
This is to ascertain that someone else is not posing as me. Now, when I give
the answer to the secret question (e.g. Meena). I generally speak in low voice, or
better yet. initially call up from a phone that is isolated. This ensures that only the
intended receipt (the phone banker) gets to know the correct answer.
On the same lines, suppose that my email to any friend Anut earlier shown in Fig.
2.1 is confidential for some reason. Therefore. I do not want anyone else to
understand what I have written.
Clearly, the Caesar Cipher is a very weak scheme of hiding plain text
message. All that is required to break the Caesar Cipher is to do the reverse of the
Caesar Cipher process replace each alphabet is a cipher text message produced by
Caesar Cipher with the alphabet that is three places up the line. Thus, to work
backwards, take a cipher text produced by Caesar Cipher. and replace each A with
7
X, B with Y. C with Z. D with A. E with B and so on. The simple algorithm
required to break Caesar Cipher can be summarized as shown in Fig. 2.6 [3].
The earliest known, and the simplest, use of a substitution cipher was by
Julius Caesar. The Caesar cipher involves replacing each letter of the alphabet with
the letter standing three places further down the alphabet. For example, plain: meet
me after the toga party
Note that the alphabet is wrapped around, so that the letter following Z is A. We
can define the transformation by listing all possibilities, as follows:
plain: a b c d e f g h i j k l m n o p q r s t u v w x y z
cipher: d e f g h i j k l m n o p q r s T u v w x y z a b c
8
Figure 2.3. numerical equivalent to example letter
9
2.3. MIT APP Inventor
The first tool you’ll use is the Component Designer (or just Designer).
Components are the elements you combine to create apps, like ingredients in a
recipe. Some components are very simple, like a Label component, which shows
text on the screen, or a Button component, which you tap to initiate an action.
Other components are more elaborate: a drawing Canvas that can hold still images
or animations; an accelerometer, a motion sensor that works like a Wii controller
and detects when you move or shake the phone; or components that make or send
text messages, play music and video, get information from websites, and so on as
shown in figure 2.5.
10
• Toward the center is a white area called the Viewer. This is where you
place components and arrange them to map out what you want your app to look
like. The Viewer shows only a rough indication of how the app will look, so, for
example, a line of text might break at a different place in your app than what you
see in the Viewer. To see how your app will really appear, you’ll need to either
download the app to your phone (we’ll go through how to do this a bit later, in the
section “Packaging the App for Downloading”) or view it in the emulator that
comes with App Inventor.
• To the left of the Viewer is the Palette, which is a list of components you
can select from. The Palette is divided into sections; at this point, only the Basic
components are visible, but you can see components in other sections of the Palette
by clicking the headers labeled Media, Animation, and so on.
• To the right of the Viewer is the Components list, which lists the
components in your project. Any component that you drag into the Viewer will
show up in this list. Currently, the project has only one component listed: Screen1,
which represents the phone screen itself.
• Under the Components list is an area that shows the Media (pictures and
sound) in the project. This project doesn’t have any media yet, but you’ll be adding
some soon.
At the far right is a section that shows the Properties of components; when
you click a component in the Viewer, you’ll see its Properties listed here.
Properties are details about each component that you can change. (For
example, when clicking on a Label component, you might see properties related to
color, text, font, and so on.) [4].
11
Adding Components to Your New Project
To add components to your application, click the component you want and
drag it onto the Viewer window in Design view. Th e representation of your phone
is labeled Screen1. Every project starts with a default component called Screen1,
and its Title property or label is set to Screen1. The ink of this default screen
component as the blank sheet of paper on which you will design your application.
All App Inventor components have settings called properties. Properties are set in
the Properties column when a component is selected in the Viewer. The
As a demonstration, open the Basic palette and drag and drop a Button
component on to the Viewer. A button shows up not only on the Viewer but also
on your connected Android phone. A button allows you to interact with the users
12
of your application. The users tap it and things happen. Buttons, as you might well
expect, play a big part in almost all applications. They provide events that you can
tie actions to. Every time you drop any component onto the Viewer, a new
component drawer and new blocks are added to the My Blocks tab in the Block
Editor. The blocks are stored in drawers. The drawers are accessed by clicking the
corresponding button on the left side of the Blocks Editor. Click over to the Blocks
Editor to see the new component drawer and blocks: If you have minimized the
Blocks Editor, it will be in your system taskbar. Click the icon to maximize it. If
the Blocks Editor is closed, you need to open it by clicking the Open the Blocks
Editor button. When you have the Blocks Editor open, you see two tabs labeled
Built-In and My Blocks in the far left column of the Blocks Editor. Click on the
My Blocks tab. All of the components you add to the Design view create a new
component drawer. Click on the Button1 rectangle to open the component drawer
for your new button. All of the blocks for the button you placed on the Design
view are in this drawer as shown in figure 2.6.
13
Figure 2.6. The drawer for your new Button component and all of its programming blocks
Click on and drag a Label component from the Basic palette onto the Viewer
screen. Once again, you see your new label show up on your connected Android
phone. A label allows you to place text and display information on your screen. It
also places blocks into the Block Editor that allow you change and manipulate the
label properties and text. Just like with the button you placed, you can use blocks
that change the label properties such as size, visibility, or text. Labels can be used
to display information that your application generates.
14
By default, the label drops below the button you placed on Screen1. You can
drag components around to reorder them on Screen1. Click on the label and drag it
above the button. As you drag the label, you see a blue place indicator line, like the
one you see in Figure 2.7, indicating where the label will drop when you release it
[5].
Figure 2.7. The blue line indicates where component will be placed when it is dropped
15
Chapter Three
3.1. Overview
In this project, both the bluetooth client and server modules are used to
create a chat session. Both components are in the same app. The client component
will be used for the device which starts the connection, the server component will
be used for the device accepting the connection. The devices must have been
paired first. There is no searching for available chat clients.
An initialization parameters such as message and Caesar shifting key are set
as shown in figure 3.2.
16
Figure 3.2. initialization parameters for both client and server
After select server side, message send to server “client connect” as shown in
figure 3.3.
17
The encryption button will encrypt the text by using Caesar algorithm as
described
- Read each character of text and put it in list as shown in figure 3.3.
18
Figure 3.4. encryption process
19
- Add to current ASCII number what a Caesar shifting number as shown in
figure 3.6.
20
This process is shown in mobile window as in figure 3.8.
21
Chapter Four
4.1. Conclusion
In this project, a client and server chat applications has been designed for
Android mobile application. The message transmitted and received between them
is encrypted by using Caesar algorithm, and the value of shifting key can be
entered as needed. Also, the design of application can decrypt the message in both
client and server if need.
22
References
23