Examveda

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

Answer: Option B


This Question Belongs to Data Structure >> Miscellaneous On Data Structures

Join The Discussion

Related Questions on Miscellaneous on Data Structures