# Polyalphabetic Cipher Multiple Choice Questions and Answers (MCQs)

This set of Data Structures & Algorithms Multiple Choice Questions & Answers (MCQs) focuses on “Polyalphabetic 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. These are necessary to prevent data breach.

2. Which of the following ciphers are created by shuffling the letters of a word?
a) rotor cipher
b) rail fence 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. Rail fence cipher is an example of transposition cipher.

3. Which of the following is a type of substitution cipher?
a) poly alphabetic cipher
b) transposition cipher
c) columnar cipher
d) rail fence cipher

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

4. Which of the following correctly defines poly alphabetic cipher?
a) a substitution based cipher which uses multiple substitution at different positions
b) a substitution based cipher which uses fixed substitution over entire message
c) a transposition based cipher which uses multiple substitution at different positions
d) a transposition based cipher which uses fixed substitution over entire message

Explanation: Poly alphabetic cipher is a type of substitution cipher. It uses multiple substitution at different positions in order to cipher the plain text.

5. Which of the following is not a type of poly alphabetic cipher?
a) Rotor cipher
b) Hill cipher
d) Affine cipher

Explanation: In poly alphabetic cipher each symbol of plain text is replaced by a different cipher text regardless of its occurrence. Out of the given options, only affine cipher is not a poly alphabetic cipher.
Sanfoundry Certification Contest of the Month is Live. 100+ Subjects. Participate Now!

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

Explanation: There are two types of a traditional cipher. First is transposition cipher and the second is substitution cipher.

7. Poly alphabetic cipher harder to decipher than mono alphabetic cipher.
a) true
b) false

Explanation: Mono alphabetic ciphers can be decoded by using the method frequency analysis. But in poly alphabetic cipher each symbol of plain text is replaced by a different cipher text regardless of its occurrence. This makes it very difficult to be decoded by using frequency analysis.

8. Which cipher is represented by the following function?

```void Cipher(string msg, string key)
{
// Get key matrix from the key string
int keyMat[3][3];
getKeyMatrix(key, keyMat);
int msgVector[3][1];
for (int i = 0; i <=2; i++)
msgVector[i][0] = (msg[i]) % 65;
int cipherMat[3][1];
// Following function generates
// the encrypted vector
encrypt(cipherMat, keyMat, msgVector);
string CipherText;
for (int i = 0; i <=2; i++)
CipherText += cipherMat[i][0] + 65;
cout  << CipherText;
}```

a) vigenere cipher
b) hill cipher
c) keyword cipher
d) rotor cipher

Explanation: The given function represents hill cipher. It is a type of poly alphabetic substitution which is based on linear algebra.

9. Which cipher is represented by the following function?

```public class Cipher
{
public static String encrypt(String text, final String key)
{
String res = "";
text = text.toUpperCase();
for (int i = 0, j = 0; i < text.length(); i++)
{
char c = text.charAt(i);
if (c < 'A' || c > 'Z')
continue;
res += (char) ((c + key.charAt(j) - 2 * 'A') % 26 + 'A');
j = ++j % key.length();
}
return res;
}```

a) vigenere cipher
b) hill cipher
c) keyword cipher
d) rotor cipher

Explanation: The given function represents the function of hill cipher. It is a type of poly alphabetic substitution which makes use of the vigenere table for making substitutions in the plain text.

10. In which of the following cipher the plain text and the ciphered text does not have same number of letters?
a) affine cipher
b) hill cipher
c) columnar cipher

Explanation: In transposition cipher and mono alphabetic cipher the number of letters remains the same in ciphered and deciphered text. But in poly alphabetic cipher the number of letters are different. So here as hill cipher is the only poly alphabetic cipher so it will be the answer.

11. What will be the ciphered text if the string “SANFOUNDRY” is given as input to the code of vigenere cipher with keyword as “HELLO”?
a) UEWIIDKLL
b) ZEYQCOCM
c) ZEYQCBROCM
d) ZEYQCBROCMJDH

Explanation: Vigenere cipher is a type of poly alphabetic substitution which uses vigenere table for making substitutions in the plain text. Using the table we find the solution to be ZEYQCBROCM.

12. What will be the ciphered text if the string “HELLO” is given as input to the code of hill cipher with keyword as “SANFOUNDRY”?
a) EZJ
b) JEZ
c) ZEJ
d) JZE

Explanation: Hill cipher is a type of poly alphabetic substitution. It uses a n x n matrix in order to cipher the given plain text. Using this method we find the ciphered text to be JZE.

Sanfoundry Global Education & Learning Series – Data Structures & Algorithms.

To practice all areas of Data Structures & Algorithms, here is complete set of 1000+ Multiple Choice Questions and Answers.