This set of Data Structures & Algorithms Multiple Choice Questions & Answers (MCQs) focuses on “Affine Cipher”.
1. Which of the following cipher makes use of linear algebra for encrypting data?
a) polybius square cipher
b) affine cipher
c) caesar cipher
d) rail fence cipher
View Answer
Explanation: Affine cipher is the only cipher out of the given options that make use of linear algebra for the purpose of encryption. It is a type of mono alphabetic cipher.
2. Which of the following cipher requires only one key for decoding the ciphered text?
a) Affine cipher
b) RSA
c) DSA
d) PKCS
View Answer
Explanation: Asymmetric cipher makes use of 2 keys for the purpose of encryption. As affine cipher is the only symmetric cipher out of the given options so it requires only one key.
3. Choose the weakest cipher from the following?
a) Vigenere cipher
b) Autokey cipher
c) Affine cipher
d) Hill cipher
View Answer
Explanation: Affine cipher is the weakest cipher out of the given options as it is a mono alphabetic cipher and other options are poly alphabetic ciphers. So it is quite vulnerable to frequency analysis.
4. What is the formula used for encryption of data using affine cipher(a,b are constants and x is the numerical equivalent of a letter to be encrypted)?
a) ax+b
b) (ax+b)%26
c) ax2+bx
d) (ax2+bx)%26
View Answer
Explanation: Affine cipher uses linear algebra for the purpose of encryption. It uses the formula (ax+b)%26 for this purpose.
5. What is the formula used for decoding the ciphered text using affine cipher(a,b are constants and x is the numerical equivalent of a letter to be encrypted)?
a) a-1(x-b)%26
b) (ax+b)%26
c) b-1(x-a)%26
d) b-1(x-a)
View Answer
Explanation: Affine cipher uses linear algebra for the purpose of encryption. It uses the formula a-1(x-b)%26 for decryption of ciphered text.
6. Affine cipher is an example of?
a) Mono alphabetic cipher
b) Poly alphabetic cipher
c) Transposition cipher
d) Asymmetric cipher
View Answer
Explanation: Affine cipher falls in the category of mono alphabetic substitution cipher. It uses linear algebra for encrypting the plain text.
7. Affine cipher is less secure than caesar cipher.
a) true
b) false
View Answer
Explanation: Affine cipher is more secure as compared to caesar cipher. But affine cipher is a very weak cipher as it can be easily broken using frequency analysis.
8. Affine cipher is not susceptible to frequency analysis.
a) true
b) false
View Answer
Explanation: Affine cipher is a very weak cipher as it can be easily broken using frequency analysis. It can be easily cracked even if 2 characters are known.
9. What will be the ciphered text corresponding to plain text “sanfoundry” if an affine cipher is used with key values as a=5, b=10?
a) wkxjcgxzra
b) gkxteuxfzw
c) ukxhmyxdfg
d) rfsexbsumv
View Answer
Explanation: Affine cipher uses linear algebra for the purpose of encryption. It uses the formula (ax+b)%26 for this purpose. So the ciphered text will be “wkxjcgxzra”.
10. What will be the plain text corresponding to ciphered text “rmw ” if an affine cipher is used with key values as a=5, b=10?
a) csk
b) kkr
c) srt
d) msd
View Answer
Explanation: Affine cipher uses linear algebra for the purpose of encryption It uses the formula a-1(x-b)%26 for decryption of ciphered text. So the plain text will be “srt”.
11. While choosing the value of a and m (m is the no. of alphabets) in affine cipher it must be ensured that?
a) a and m are prime numbers
b) a and m are odd numbers
c) a and m are coprime
d) a and m are even numbers
View Answer
Explanation: While choosing the values of a and m it should be ensured that a and m are coprime. Otherwise decoding the ciphered text would be difficult.
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.
- Apply for Computer Science Internship
- Check Programming Books
- Practice Data Structure MCQ
- Check Computer Science Books
- Check Design and Analysis of Algorithms Books