Vidyalelo
Data Structure · Q831

Miscellaneous on Data Structures

Programming · Data Structure · question 831

Q831

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 'Z') continue; res += (char) ((c + key.charAt(j) - 2 * 'A') % 26 + 'A'); j = ++j % key.length(); return res;

A.
vigenere cipher
Answer
B.
hill cipher
C.
keyword cipher
D.
rotor cipher

Answer: Option A

Solution

Answer: Option A
No explanation is given for this question Let's Discuss on Board