0% found this document useful (0 votes)
31 views4 pages

Fahad Assignment

1. The document provides instructions for an assignment on cryptography and data security. It includes 5 questions on topics like monoalphabetic cipher, Caesar cipher, Playfair cipher, and symmetric vs asymmetric encryption. 2. A C# program is provided that implements a monoalphabetic cipher to encrypt and decrypt a given text using a key. It takes the plaintext as input, encrypts it, then decrypts the ciphertext output. 3. The responses to each question are also given, explaining concepts like how monoalphabetic cipher is more secure than Caesar cipher, why Playfair cipher uses a 5x5 matrix, and why asymmetric encryption is more secure than symmetric encryption.

Uploaded by

hussainremu038
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
31 views4 pages

Fahad Assignment

1. The document provides instructions for an assignment on cryptography and data security. It includes 5 questions on topics like monoalphabetic cipher, Caesar cipher, Playfair cipher, and symmetric vs asymmetric encryption. 2. A C# program is provided that implements a monoalphabetic cipher to encrypt and decrypt a given text using a key. It takes the plaintext as input, encrypts it, then decrypts the ciphertext output. 3. The responses to each question are also given, explaining concepts like how monoalphabetic cipher is more secure than Caesar cipher, why Playfair cipher uses a 5x5 matrix, and why asymmetric encryption is more secure than symmetric encryption.

Uploaded by

hussainremu038
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

North Campus

Spring Semester 2020

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:

Read the Instructions carefully.

1- Assignment must be type in the given question paper’s document


2- Mention your name and ID in this document
3- Your answers should not exceed one paragraph.
4- Attempt all questions on MS-Word. Font theme and size must be Time New Romans and 12
respectively. Use line spacing 1.5.
5- Mention your assumptions clearly.
6- Make the file name as per given format:
7- Subject Name (last four digits of your Registration Number)
e.g. Software Engineering (2342).pdf
8- It must be submitted on LMS before the due date

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

2. How mono-alphabetic cipher is more secure than Caesar Cipher?

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.

4. Among Symmetric and Asymmetric key Cryptography which is more secure?

Justify your answer.


ANSWER:
The Asymmetric key cryptography is more secure than the Symmetric key cryptography, because in
symmetric encryption the plaintext is encrypted using a key, and the same key is used at the
receiving end to decrypt the received cipher text. While asymmetric encryption uses two key for the
process. The public key used for encryption is available to everyone but the private key is not

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

cipher for encrypting and decrypting a given text.

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");

string cipherText = Encrypt(plainText, key);


Console.WriteLine("The Encrypted Data is here:\t" + cipherText);

Console.Write("\n");

string decryptedText = Decrypt(cipherText, key);


Page 3 of 4
Console.WriteLine("The Decrypted Data is here:\t" + decryptedText);
Console.ReadKey();

static string Encrypt(string plainText, string key)


{
char[] chars = new char[plainText.Length];
for (int i = 0; i < plainText.Length; i++)
{
if (plainText[i] == ' ')
{
chars[i] = ' ';
}

else
{
int j = plainText[i] - 97;
chars[i] = key[j];
}
}

return new string(chars);


}

static string Decrypt(string cipherText, string key)


{
char[] chars = new char[cipherText.Length];
for (int i = 0; i < cipherText.Length; i++)
{
if (cipherText[i] == ' ')
{
chars[i] = ' ';
}
else
{
int j = key.IndexOf(cipherText[i]) + 97;
chars[i] = (char)j;
}
}
return new string(chars);
}
}}

Page 4 of 4

You might also like