Data Structures & Algorithms Multiple Choice Questions & Answers (MCQs) on “Monoalphabetic Cipher”.
1. What is the meaning of cipher in cryptography? Answer: c 2. Which of the following is a type of traditional cipher? Answer: b 3. Which of the following ciphers are created by shuffling the letters of a word? Answer: b 4. Which of the following is a type of substitution cipher? 5. Which of the following is not a type of mono alphabetic cipher? Answer: d 6. Which of the following is not a type of poly alphabetic cipher? Answer:d 7. What will be the ciphered text for the input string “” with key string as “code” to the program of keyword cipher? 8. Which of the following is a type of transposition cipher? Answer: a 9. What will be output for the given code? a) bejjm Answer: c 10. What will be output for the given code taking input string as “”? a) Encrypted message: LQFYGXFRKN Answer: a 11. In which of the following cipher the plain text and the ciphered text does not have same number of letters? Answer: b
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
Clarification: Cipher is an algorithm for performing encryption or decryption. In cryptography, a set of defined steps are followed to generate ciphers.
a) transportation cipher
b) transposition cipher
c) transforming cipher
d) vigenere cipher
Clarification: There are two types of a traditional cipher. First is transposition cipher and the second is substitution cipher.
a) substitution cipher
b) transposition cipher
c) vigenere cipher
d) hill cipher
Clarification: 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.
a) Mono alphabetic cipher
b) transposition cipher
c) transportation cipher
d) transforming cipher
Answer: a
Clarification: 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.
a) additive cipher
b) multiplicative cipher
c) afffine cipher
d) hill cipher
Clarification: In mono alphabetic cipher each symbol of plain text is replaced by a particular respective symbol in the cipher text. There are three types of mono alphabetic ciphers- additive, multiplicative and affine.
a) Auto key cipher
b) Hill cipher
c) Playfair cipher
d) Additive cipher
Clarification: 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 additive cipher is not a poly alphabetic cipher.
a) SCMBNUMERY
b) SSCMBNUMERY
c) NIFO
d) NILO
Answer: a
Clarification: Keyword cipher is type of mono alphabetic cipher. In this algorithm the letters {A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z} by
{C,O,D,E,A,B,F,G,H,I,J,K,L,M,N,P,Q,R,S,T,U,V,W,X,Y,Z} respectively.
a) Rail Fence cipher
b) Hill cipher
c) Rotor cipher
d) One time pad
Clarification: 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.#include
b) LFPDAR
c) BEJJM
d) lfpdar
Clarification: The given code is the implementation of keyword cipher. It is an example of mono alphabetic cipher. The given string is always converted into an uppercase ciphered text.package com..setandstring;
import java.util.Scanner;
public class MonoalphabeticCipher
{
public static char p[] = { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j',
'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't',
'u', 'v', 'w', 'x', 'y', 'z' };
public static char ch[] = { 'Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P',
'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', 'Z',
'X', 'C', 'V', 'B', 'N', 'M' };
public static String doEncryption(String s)
{
char c[] = new char[(s.length())];
for (int i = 0; i < s.length(); i++)
{
for (int j = 0; j < 26; j++)
{
if (p[j] == s.charAt(i))
{
c[i] = ch[j];
break;
}
}
} return (new String(c));
}
public static void main(String args[])
{
Scanner sc = new Scanner(System.in);
System.out.println("Enter the message: ");
String en = doEncryption(sc.next().toLowerCase());
System.out.println("Encrypted message: " + en);
sc.close();
}
}
b) Encrypted message: NKRFXGYFQL
c) Encrypted message: lqfygxfrkn
d) Encrypted message: nkrfxgyfql
Clarification: The given code is an example of mono-alphabetic cipher. The code replaces the letters of the input string by corresponding keyboard letters.
a) keyword cipher
b) vigenere cipher
c) transposition cipher
d) additive cipher
View Answer
Clarification: In transposition cipher and mono alphabetic cipher the number of letters in the plain text and ciphered text remain same. But in poly alphabetic cipher the number of letters change. So here as vigenere cipher is the only poly alphabetic cipher so it will be the answer.