LabManual For Cryptography and Network Security
LabManual For Cryptography and Network Security
College of Engineering
Bishoftu, Ethiopia
Department
of
Computer and Information Technology
LAB MANUAL
for
Cryptography and
Network Security
TABLE OF CONTENTS
Introduction
Page
3
10
11
12
Resources/Tools
14
INTRODUCTION
1.1 About this Lab Manual
This lab manual is written to accompany the Cryptography & Network
Security course (CT-4120) for the Department of Computer and Information
Technology of Defence Engineering University. Lab sessions are 3 hours a
week. The lab topics complemented the material covered during lecture
sessions and in accordance to the course syllabus.
This lab manual is divided into a number of lab topics. Each lab
contains a topic background followed by activities. Activities are categorized
into three activities: Pre Lab activity, which can be an introductory exercise or
sample demo program; Lab Activity, these are the activities evaluated by the
instructors. A lab topic includes one or more lab activity. It is not expected
that all these activities will be given; the instructors can choose which activity
can be given; Post Lab activity, these are assignments provided as an activity
outside the lab sessions.
1.2 Assessment Criteria
Lab activity
Post Lab Activity
1.3 Expectations
Student are expected to have their own copy of the lab manual
Use of Internet during class is not allowed.
Required assignments should be submitted on time.
Students are not allowed to collaborate during lab activity.
encrypted message from one person to another, it is first necessary that both
parties have the 'key' for the cipher, so that the sender may encrypt it and the
receiver may decrypt it. For the Caesar cipher, the key is the number of
characters to shift the cipher alphabet.
Mathematical Description
First we translate all of our characters to numbers, 'a'=0, 'b'=1, 'c'=2, ... , 'z'=25. We
can now represent the Caesar cipher encryption function, e(x), where x is the
character we are encrypting, as:
Where k is the key (the shift) applied to each letter. After applying this function the
result is a number which must then be translated back into a letter. The decryption
function is:
TRANSPOI
12 34 567 8
AI NOPRST
3 84 7 6 2 5 1
Hence we should put the letters into the order 3, 8, 4, 7, 6, 2, 5, 1:
TRHIFNEO ORFBETFS RNYIEAWU
ESUERRNA IICDERTT PFIOESTN
UDNETEIH AFTOSTES EXRACMIA
NEDBOETT NASMBIUG
IISWEHWT TPOEEHKS
NFERAIWR
UTTLAERN
As a final step, let us rewrite the cipher-text with a different number of letters in each
block:
TRHIF NEOOR FBETF SRNYI EAWUN EDBOE TTNAS MBIUG NFERA IWRES
UERRN AIICD ERTTP FIOES TNIIS WEHWT TPOEE HKSUT TLAER NUDNE
TEIHA FTOST ESEXR ACMIA
This disguises the number of letters in the keyword, making the cryptogram harder to
decipher.
Pre Lab Activity
Take out a piece of paper and write the algorithm of pure transposition technique to
encrypt and decrypt the given plain text.
Lab Activity
Write the C++ program for the implementation of pure transposition algorithm.
Post Lab Activity
You are given the following text We all are surrounded retreat to the bush. Write the
encrypted output of the above text using the technique you implemented.
have a high security level related to a small key used for encryption and
decryption
be easily understood
not depend on the algorithm's confidentiality
be adaptable and economical
be efficient and exportable
In late 1974, IBM proposed "Lucifer", which, thanks to the NSA (National Security
Agency), was modified on 23 November 1976 to become the DES (Data Encryption
Standard). The DES was approved by the NBS in 1978. The DES was standardized
by the ANSI (American National Standard Institute) under the name of ANSI X3.92,
better known as DEA (Data Encryption Algorithm).
Principle of the DES
It is a symmetric encryption system that uses 64-bit blocks, 8 bits (one octet) of which
are used for parity checks (to verify the key's integrity). Each of the key's parity bits (1
every 8 bits) is used to check one of the key's octets by odd parity, that is, each of
the parity bits is adjusted to have an odd number of '1's in the octet it belongs to. The
key therefore has a "useful" length of 56 bits, which means that only 56 bits are
actually used in the algorithm.
The algorithm involves carrying out combinations, substitutions and permutations
between the text to be encrypted and the key, while making sure the operations can
be performed in both directions (for decryption). The combination of substitutions and
permutations is called a product cipher.
The key is ciphered on 64 bits and made of 16 blocks of 4 bits, generally denoted k1
to k16. Given that "only" 56 bits are actually used for encrypting, there can be 256 (or
7.2*1016) different keys!
Pre Lab Activity
Take out a piece of paper and write the algorithm of DES technique to encrypt and
decrypt the given plain text.
Lab Activity
Write the C++ program for the implementation of DES encryption and decryption
algorithm.
Post Lab Activity
You are given the following text We all are surrounded retreat to the bush. Write the
encrypted output of the above text using the technique you implemented and perform
decryption process on the encrypted output.
10
11
12
13
RESOURCES / TOOLS:
14