Monoalphabetic Cipher Multiple Choice Questions and Answers (MCQs)

Monoalphabetic Cipher Multiple Choice Questions and Answers (MCQs). This set of Data Structures & Algorithms Multiple Choice Questions & Answers (MCQs) focuses on “Monoalphabetic Cipher”.

1. What is the meaning of cipher in cryptography?
a) an algorithm that performs encryption
b) an algorithm that generates a secret code
c) an algorithm that performs encryption or decryption
d) a secret code

Answer: c
Explanation: Cipher is an algorithm for performing encryption or decryption. In cryptography, a set of defined steps are followed to generate ciphers.

2. Which of the following is a type of traditional cipher?
a) transportation cipher
b) transposition cipher
c) transforming cipher
d) vigenere cipher

Answer: b
Explanation: There are two types of a traditional cipher. The first is a transposition cipher and the second is a substitution cipher.

3. Which of the following ciphers are created by shuffling the letters of a word?
a) substitution cipher
b) transposition cipher
c) vigenere cipher
d) hill cipher

Answer: b
Explanation: There are two types of traditional ciphers – Transposition and substitution cipher. In transposition cipher the letters of the given data are shuffled in a particular order, fixed by a given rule.

4. Which of the following is a type of substitution cipher?
a) Mono alphabetic cipher
b) transposition cipher
c) transportation cipher
d) transforming cipher

Answer: a
Explanation: In a substitution cipher, the plain text is replaced by ciphertext according to a fixed rule. There are two types of substitution cipher – Mono alphabetic and Poly alphabetic cipher.

5. Which of the following is not a type of mono alphabetic cipher?
a) additive cipher
b) multiplicative cipher
c) afffine cipher
d) hill cipher

Answer: d
Explanation: In monoalphabetic cipher, each symbol of plain text is replaced by a particular respective symbol in the ciphertext. There are three types of monoalphabetic ciphers- additive, multiplicative and affine.

6. Which of the following is not a type of poly alphabetic cipher?
a) Auto key cipher
b) Hill cipher
c) Playfair cipher
d) Additive cipher

Answer:d
Explanation: In polyalphabetic cipher, each symbol of plain text is replaced by a different ciphertext regardless of its occurrence. Out of the given options, the only additive cipher is not a polyalphabetic cipher.

7. Which of the following is a type of transposition cipher?
a) Rail Fence cipher
b) Hill cipher
c) Rotor cipher
d) One time pad

Answer: a
Explanation: In transposition cipher the letters of the given data are shuffled in a particular order, fixed by a given rule. There are two types of transposition cipher – Rail fence cipher and Columnar transposition cipher.

9. What will be output for the given code?

#include<bits/stdc++.h> 
using namespace std; 
string encrypter(string keyword) 
{ 
	string encoded = ""; 	
	bool arr[26] = {0}; 
	for (int i=0; i<keyword.size(); i++) 
	{ 
		if(keyword[i] >= 'A' && keyword[i] <= 'Z') 
		{ 		
			if (arr[keyword[i]-65] == 0) 
			{ 
				encoded += keyword[i]; 
				arr[keyword[i]-65] = 1; 
			} 
		} 
		else if (keyword[i] >= 'a' && keyword[i] <= 'z') 
		{ 
			if (arr[keyword[i]-97] == 0) 
			{ 
				encoded += keyword[i] - 32; 
				alpha[keyword[i]-97] = 1; 
			} 
		} 
	} 
	for (int i=0; i<26; i++) 
	{ 
		if(arr[i] == 0) 
		{ 
			arr[i]=1; 
			encoded += char(i + 65); 
		} 
	} 
	return encoded; 
} 
string ciphertxt(string msg, string encoded) 
{ 
	string cipher=""; 
	for (int i=0; i<msg.size(); i++) 
	{ 
		if (msg[i] >='a' && msg[i] <='z') 
		{ 
			int pos = msg[i] - 97; 
			cipher += encoded[pos]; 
		} 
		else if (msg[i] >='A' && msg[i] <='Z') 
		{ 
			int pos = msg[i] - 65; 
			cipher += encoded[pos]; 
		} 
		else
		{ 
			cipher += msg[i]; 
		} 
	} 
	return cipher; 
} 
int main() 
{ 
	string keyword; 
	keyword = "cipher"; 	
	string encoded = encrypter(keyword); 
	string message = "hello"; 
	cout  << ciphertxt(message,encoded) << endl; 
	return 0; 
}

a) bejjm
b) LFPDAR
c) BEJJM
d) lfpdar

Answer: c
Explanation: The given code is the implementation of keyword cipher. It is an example of the mono alphabetic cipher. The given string is always converted into an uppercase ciphered text.

11. In which of the following cipher the plain text and the ciphered text does not have same number of letters?
a) keyword cipher
b) vigenere cipher
c) transposition cipher
d) additive cipher

Answer: b
Explanation: In transposition cipher and monoalphabetic cipher the number of letters in the plain text and ciphered text remain the same. But in polyalphabetic cipher, the number of letters changes. So here as vigenere cipher is the only polyalphabetic cipher so it will be the answer.

Leave a Comment