# 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

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

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

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

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?
b) multiplicative cipher
c) afffine cipher
d) hill cipher

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

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

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