Sei sulla pagina 1di 17

ABSTRACT

Cryptography or cryptology (hidden secret) is the practice and study of


techniques for secure communication in the presence of third parties
called adversaries. More generally, cryptography is about constructing and
analyzing protocols that prevent third parties or the public from reading
private messages; various aspects in information security such as
data confidentiality, data integrity, authentication, and non-
repudiation are central to modern cryptography.
In this paper, a method is proposed that consists of three different levels
of encryption, accomplished using Red Black Trees and Linear
Congruential Generator. Due to the existence of three levels, it becomes
extremely difficult for an attacker to hack data.
RED-BLACK TREES
Red-Black Tree is a self-balancing Binary Search Tree (BST) where every node
follows certain properties (given below). Each node of the binary tree has
an extra bit, and that bit is often interpreted as the colour (red or black) of
the node.
1. Every node is coloured either red or black.
2. The root element is always black.
3. Every leaf (NIL) is black.
4. If a node is red in colour, then both of its children are black.
5. If a node is black in colour, it can have either red or black children.
6. For each node x, all paths from x to the descendant leaves will contain
the same number of black nodes.

The number of black nodes on any path from a particular node x to a leaf
node is called the black height of that node; bh(x). Property 6 defines the
constraint on black-height of a node. We define the black height of the
tree to be the black height of the root.
Insertion Example
Red Black Tree Traversal
This method involves visiting all the nodes at each level from left to right
before moving on to the next level. It requires the addition of a next
pointer in the definition of the node which points to next node in the
same level. If it is the last node in a given level, then it points to the first
node of the next level. For example, the result of traversing the Red-Black
Tree shown in Figure 1 using the next pointers is as follows: 30, 15, 70, 10,
20, 60, 85, 50
Linear Congruential Generator
A Linear Congruential generator is an algorithm that yields a sequence of
randomized numbers calculated with a discontinuous linear equation. The
method represents one of the oldest and best-known pseudorandom
number generator algorithms. These algorithms are also called as
deterministic random bit generators.

The linear congruential method produces a sequence of integers X1, X2,


X3 between zero and according to the following recursive relationship:
Xn = (aXn-1 + c) mod m, n=1,2,...

Where X is the sequence of pseudo random value, the initial value X0 is


called seed, a is the constant multiplier, c is the increment, m is modulus.
Let seed value (Xo) = 0, a = 2, c = 1 and m = 10
Then,
X1 = (2*0 + 1) mod 10 = 1 mod 10 = 1
X2 = (2*1 + 1) mod 10 = 3 mod 10 = 3
By continuing the above procedure we have produced the following table

X Values Assigned Values


X0 0
X1 1
X2 3
X3 7
X4 5
X5 1
X6 3
X7 7
X8 5
X9 1
X10 3
Proposed Method
Encryption

The plain text is encrypted at following three levels.

The first level involves the usage of the Linear Congruential Generator (LCG).

The second level uses the Red-Black tree data structure.

The third level encrypts data based on the color of the nodes in the tree structure.

First Level

LCG is used to map each text character to another encrypted character

The seed value needs to be agreed upon by the sender and the receiver before data exchange
(Xo)

For our encryption, we use the following values: a=5 ,c=3 ,m=16 ,Xo=0
Representation of
LCG Table Encryption Table
characters using nos
Second level

After the first level of encryption, indices are assigned to the encrypted text and Red-Black
tree is constructed with these indices. Then the constructed Red-Black tree is traversed using
RB Traversal.

After Traversing the Red-Black tree successfully, Rearrange the data according to the new
order of indices obtained by the traversal. This is the second level of encryption which
scrambles the data

Third Level

In Third level of encryption the nodes which are black in color or the data associated with
the indices which are colored black in the Red-Black tree are further encrypted by
incrementing the character by 1.
Flow Diagram For Encryption
Flow Diagram For Decryption
ILLUSTRATION

Encryption
Let the data to be encrypted be: HELLO WORLD
First level
Step 1: Use Table 3 to map the original
characters to encrypted characters.
After mapping we get: MWX ZLHZG SM

Encryption
Table
Second Level
Step 2
After mapping assign indices to the encrypted data received from step 1.

After this construct RB Tree using these indices and perform RB Traversal on the
resulting Tree.

RB Traversal of the resulted tree is : 4,2,8,1,3,6,10,5,7,9,12,11,13


Second Level
Step 3
Now again assign the characters corresponding to the indices
RB Traversal of the resulted tree is : 4,2,8,1,3,6,10,5,7,9,12,11,13
Table Constructed before was:

Data after Scrambling: WHMXZG LZS M


Third Level
Step 4
Now in third level Encrypt black nodes by incrementing 1.

Now the final encrypted text i.e. !XINYZG!MAT M is passed to receiver by the
sender.
Decryption
Now data to be decrypted at receiver side is !XINYZG!MAT M
First Level
Step 1: Construct a Red Black Tree with nodes from 1 to 13 (size of text) as shown

Output after RB Traversal: 4,2,8,1,3,6,10,5,7,9,12,11,13


Step 2
Now decrypt black nodes by decrementing 1 from them.
Second level
Step 3
Reorder the result of step 2 such that the indices are in ascending order:

Resulting ordered sequence of characters: MWX ZLHZG SM


Third Level
Step 4
Using Encryption table decode the result of the previous step, we get the following
result as
MWX ZLHZG SM HELLO WORLD
Conclusion
In this paper they have proposed encryption method
that encrypts data at three levels hence provides
three level of encryption. So, even if a hacker cracks
the first level, they have to pass through two more
level of encryption which exists to maintain
information integrity.

Potrebbero piacerti anche