Text Encryption - Gunadarma University

Download Report

Transcript Text Encryption - Gunadarma University

Encryption and Encoding
Table of Content
1. Introduction
2. Text Encryption Techniques
3. Data Encoding Techniques
Data/Text Encryption
• The primary objective of data encryption is to
transform the data in order to conceal the
information during network transmission
(internet, intranet).
Special Terms in Encryption
• The original unaltered contents of the message or text is
called plaintext.
• Encipherment or encryption is a process whereby
plaintext is converted into enciphered text or ciphertext.
• The enciphering process is an algorithm that operated
on the plaintext based on the value of a key. The key
defines the operation or the method of the
encipherment algorithm.
• Different keys produce different ciphertext from a fixed
plaintext.
Text Encryption
Key K
Plaintext X
Encryption
Ciphertext Y
• Encryption is a process whereby
plaintext is converted into enciphered
text or ciphertext.
Text Encryption
• Different types of key represent different
types of text encryption techniques.
• There are different techniques with various
security levels in text encryption,
depending on the level of confidentiality of
the data.
Text Decryption
• Decryption or decipherment is the reverse
process of encryption or encipherment,
which is to convert ciphertext back to its
original form of plaintext.
Key K
Ciphertext Y
Decryption
Plaintext X
Text Decryption
• Decryption process needs to use the same key
that is used in the encryption process to obtain
the original plaintext.
• Although one may obtain a copy of the
encrypted message, one must use the correct
key to successfully decrypt the message.
Text Encryption Technique
• A common encryption technique is known as
substitution method
• Substitution method can be divided into 3 forms:
• fixed displacement substitution
• keyword based substitution
• matrix based substitution.
Fixed Displacement Substitution
• Ciphertext represent a fixed displacement in the
alphabet.
• The relationship between the mapping of plaintext
and ciphertext characters are as below:
• Plaintext : ABCDEFGHIJKLMNOPQRSTUVWXYZ
• Key :
BCDEFGHIJKLMNOPQRSTUVWXYZA
Fixed Displacement Substitution
• Example :
• Plaintext : ABCDEFGHIJKLMNOPQRSTUVWXYZ
• Key :
BCDEFGHIJKLMNOPQRSTUVWXYZA
This encrypts “multimedia”(plaintext) into
“nvmujnfejb” (ciphertext)
Fixed Displacement Substitution
Keyword Based Substitution
• Simplest type of keyword based substitution is
implemented in three steps :
1. A word or phrase is selected as keyword and
use for forming the letters of the ciphertext
alphabet
2. Repeated letters are omitted after their first
occurrence
3. At the end of the word or phrase, remaining
letters of the alphabet are used in the normal
sequence
Keyword Based Substitution
• For example, suppose we use the phrase
“MULTIMEDIA UNIVERSITY”. We then form one word
and remove the duplicated letters to get a newly
formed word “MULTIEDANVRSY”.
• The remaining alphabet letters are then added at
the end of the keyword to give you the keywordbased mixed alphabet
“MULTIEDANVRSYBCFGHJKOPQWXZ” (key)
Keyword Based Substitution
• Example:
• Plaintext : ABCDEFGHIJKLMNOPQRSTUVWXYZ
• Key :
MULTIEDANVRSYBCFGHJKOPQWXZ
This encrypts “Hello”(plaintext) to “Aissc”(ciphertext)
Matrix Based Substitution
• By placing an alphabet into an n x n matrix or
array, one can obtain the ability to design the
ciphertext alphabet in many different ways
• For example, consider the matrix below:
Columns
1
Rows
2
3
4
5
6
7
1
A B
C D
E
F
G
2
H
I
J
L M
N
3
O
P
Q R
S T
U
4
V W X Y
K
Z
Matrix Based Substitution
• By extracting the matrix element in a predefined
sequence, you can develop a transpose
alphabet.
• If you extract the matrix elements in each column,
commencing with column 7 working backward,
extracting the elements in column 6, 5 and so on,
the alphabet GNUFMTELSZDKRYCJQXBIPWAHOV
(key) is created.
• If matrix elements are extracted in a progressive
column order, alphabet
AHOVBIPWCJQXDKRYELSZFMTGNU (key) is
created.
Data encoding techniques
• Data encoding techniques can be classified into
two broad types:• Repetition Encoding/Suppression
• Zero or Blank Encoding
• Run-length Encoding
• Statistical Encoding
• Pattern Substitution
• Diatomic Encoding
• Huffman Encoding
Statistical Encoding
• In this technique, patterns of bits (word) or that are
more frequent are recorded using shorter codes.
• This method may have 3 forms
• Pattern Substitution
• Diatomic Encoding
• Huffman Encoding
Pattern Substitution
• In pattern substitution technique, frequent patterns
or characters, or frequent words, are replaced by
a shorter sequence.
• For example, lecture notes for this course can be
encoded using pattern substitution by replacing
all the occurrences of the word “Multimedia” with
the character “*M”.
Pattern Substitution
Networked Multimedia Systems is an
exemplary example of a book on
multimedia and networking. Nowhere
else will you find this kind of coverage
and completeness. This is truly a onestop-shop for all that you want to know
about multimedia and network.
Pattern Substitution
a
about
all
an
and
for
is
of
on
1
2
3
4
5
6
7
8
9
that
this
to
will
multimedia
networking
+
&
=
#
m*
n*
Diatomic Encoding
• This encoding is based on a combination of
two data bytes which are frequently
occurring.
• According to the analysis of English language,
the most frequent occurring pairs are the
following : “E_”, “T_”, “TH”, “_A”, “S_”, “RE”,
“IN” and “HE”.
• Replacement of these pairs by special single
byte that do not occur anywhere else in the
text gives a data reduction of more than 10%.
Huffman Encoding
• Different characters need not be encoded with
the same number of bits.
• With the help of the knowledge of frequency
occurrence of characters, the Huffman encoding
algorithm provides the more frequent characters
with the code having lesser number of bits.
Huffman Encoding
• Eg:
• Consider weights 2, 4, 6, 7, 7, 9.
• First the algorithms repeatedly combines the smallest two
weights to obtain shorter and shorter weight sequences.
•
•
•
•
•
2, 4, 6, 7, 7, 9 replaces 2 and 4 by 2 + 4 and calls for
6, 6, 7, 7, 9 which replaces 6 and 6 by 12 and calls for
7, 7, 9, 12 which calls for
9, 12, 14 which calls for
14, 21
Huffman Encoding
0
1
14
0
7
21
1
7
0
1
9
12
0
1
6
0
2
6
1
4
7
7
9
6
2
4
00
01
10
111
1100
1101
Summary
1. The primary objective of data encryption is to transform the data
in order to conceal the information during network transmission
(internet, intranet).
2. The original unaltered contents of the message or text is called
plaintext.
3. Encipherment or encryption is a process whereby plaintext is
converted into enciphered text or ciphertext.
4. The enciphering process is an algorithm that operated on the
plaintext based on the value of a key.
5. Decryption or decipherment is the reverse process of encryption
or encipherment, which is to convert ciphertext back to its original
form of plaintext.
Summary
6. Text Encryption Techniques:
• fixed displacement substitution
• keyword based substitution
• matrix based substitution
7. Data encoding techniques:
- Statistical Encoding
• Pattern Substitution
• Diatomic Encoding
• Huffman Encoding