Page 1 of 1

Which cipher is represented by the following function?

Posted: Wed Jul 13, 2022 7:40 pm
by answerhappygod
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[0] = (msg) % 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[0] + 65;
cout << CipherText;
}
a) vigenere cipher
b) hill cipher
c) keyword cipher
d) rotor cipher