ExamVeda
Login
Home
51
Which ordered board is the highest enumerated board till now?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
52
Who along with Samuel Morse developed Morse code?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
53
Which of the following is true about encryption in gronsfeld cipher?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
54
Quickselect is an example of . . . . . . . .
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
55
Karger's algorithm always gives a minimum cut for a connected graph.
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
56
Polybius square is also known by the name of?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
57
What is a chromatic index?
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
58
What will be the output of the following code?
#include <iostream>
#include <string>
using namespace std;
void func1(string input,string output)
{
    if(input.length()==0)
    {
        cout<<output<<",";
        return;
    }
    for(int i=0;i<=output.length();i++)
    func1(input.substr(1),output.substr(0,i) + input[0] + output.substr(i));
}
 
int main()
{
    char str[] = "AB";
 
	func1(str, "");
    return 0;
}
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
59
An Extended hamming code is also called as . . . . . . . .
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
60
What will be the ciphered text if the string "HELLO" is given as input to the code of hill cipher with keyword as "DATASTRUCTURE"?
Discuss
Answer & Solution
Answer: Option A
Solution:
Hill Cipher: The Hill cipher is a polygraphic substitution cipher based on linear algebra. It uses matrix multiplication for encryption.

Given:
Plaintext: "HELLO"
Keyword: "DATASTRUCTURE"

Steps to Encrypt Using Hill Cipher:
Step 1: Convert the keyword "DATASTRUCTURE" into a matrix. The matrix size is determined by the length of the keyword. For simplicity, assume a 2x2 matrix is used for a 2-letter cipher.
Using the first 4 letters of the keyword "DATA" we get:
D=3, A=0, T=19, A=0
Matrix: [ [3, 0], [19, 0] ]

Step 2: Convert the plaintext "HELLO" into numerical values (H=7, E=4, L=11, L=11, O=14) and arrange them into 2-letter pairs:
HE = [7, 4]
LL = [11, 11]
LO = [11, 14]

Step 3: Multiply each pair by the matrix and take modulo 26 to get the encrypted values:
For HE:
Matrix * [7, 4] = [3*7 + 0*4, 19*7 + 0*4] = [21, 133]
Modulo 26:
[21, 133 mod 26 = 5] = [21, 5] = [V, F]

For LL:
Matrix * [11, 11] = [3*11 + 0*11, 19*11 + 0*11] = [33, 209]
Modulo 26:
[33 mod 26 = 7, 209 mod 26 = 1] = [H, B]

For LO:
Matrix * [11, 14] = [3*11 + 0*14, 19*11 + 0*14] = [33, 209]
Modulo 26:
[33 mod 26 = 7, 209 mod 26 = 1] = [H, B]

Conclusion: The encryption results in the ciphered text being "VFBH" when the plaintext "HELLO" is processed using the Hill cipher with the keyword "DATASTRUCTURE".