Fahad Assignment
Fahad Assignment
BS (CS)/ BS (SE)/
BE (EE)/
Subject Cryptography and data Security (3+0) Program
BE (ELECT)/
BS (TEL)
Dr. M. Zubair Ahmed
Dated: 05-08-2020
Faculty Members and
Deadline: 12-08-2020
Engr. Darakhshan Syed
Student Name: Umer Hussain Qidwai
Student ID: 40274
Weight (Max.
Assessment Activity Assignment -2 10
Marks)
Semester Summer 2020 (Semester- ) Section Code
IMPORTANT INSTRUCTIONS:
ASSIGNMENT TASKS:
1. Encrypt the given paint text by using Mono-alphabetic cipher having key: WORLD
Plain text:
Page 1 of 4
Cryptography prior to the modern age was effectively synonymous with encryption, the conversion
of information from a readable state to apparent nonsense. The originator of an encrypted message
shares the decoding technique only with intended recipients to preclude access from adversaries.
ANSWER:
A B C D E F G H I J K L M
W O R L D A B C E F G H I
Cipher alphabet
N O P Q R S T U V W X Y Z
J K M N P Q S T U V X Y Z
ANSWER:
Monoalphabetic cipher is a substitute for a given key, the cipher characters of each explicit letter are
directed throughout the encryption process. For example, if 'A' is enclosed as 'D', for any value from
the text, 'A' will always be enclosed in 'D'.
Caesar Cipher is not a secure cryptosystem because there are only 26 keys to try. An attacker can
perform active key searches with limited computer resources and the brute attacks occur.
3. What is the first practical cipher? Who introduced it? Why it uses a 5x5 matrix?
ANSWER:
Playfair Cipher is the first practical digraph substitution cipher which was introduced by Charles
Wheatstone in 1854 but was named after as Lord Playfair who promoted the use of cipher. The
Playfair cipher uses 5x5 matrix of letter for encryption and decryption. The secrets in Playfair cipher
are a keyword and the method by which 5x5 matrix is filled.
Page 2 of 4
disclosed. When a text is encrypted using a public key, it can only be decrypted using a private key.
However, when a message is encrypted using a private key, it can be decrypted using a public key.
5. Given the following table. Write a C program to implement Mono-alphabetic
ANSWER:
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
namespace CryptographyCode
{
class Program
{
static void Main(string[] args)
{
string key = "BVGQKMNADZCWSEOYFJXHTLPUIR ,
ABCDEFGHIJKLMNOPQRSTUVWXYZ";
Console.WriteLine("****************MONO-ALPHABETIC CIPHER*************\n");
Console.WriteLine("Enter your message:");
Console.Write("\n");
string plainText = Console.ReadLine();
Console.Write("\n");
Console.Write("\n");
else
{
int j = plainText[i] - 97;
chars[i] = key[j];
}
}
Page 4 of 4