Affine Cipher Multiple Choice Questions and Answers (MCQs)

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

Answer: b
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

Answer: a
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

Answer: c
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.
advertisement
advertisement

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

Answer: b
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

Answer: a
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.
Note: Join free Sanfoundry classes at Telegram or Youtube

6. Affine cipher is an example of?
a) Mono alphabetic cipher
b) Poly alphabetic cipher
c) Transposition cipher
d) Asymmetric cipher
View Answer

Answer: a
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

Answer: b
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.
advertisement

8. Affine cipher is not susceptible to frequency analysis.
a) true
b) false
View Answer

Answer: b
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

Answer: a
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”.
advertisement

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

Answer: c
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

Answer: c
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.

If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.