My Report

Data Structure II Mock Test 9


Correct Answer: 2 points | Wrong: -1 point
Grades: A* (100% score) | A (80%-99%) | B (60%-80%) | C (40%-60%) | D (0%-40%)
advertisement
 10%

Question 1 of 10

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

Question 1 of 10

Question 2 of 10

2. Which of the following is not a type of transposition cipher?

Question 2 of 10

Question 3 of 10

3. Which of the following is a difference between beaufort cipher and vigenere cipher?

Question 3 of 10

Question 4 of 10

4. Poly alphabetic cipher harder to decipher than mono alphabetic cipher.

Question 4 of 10

Question 5 of 10

5. What is the rule for encryption in playfair cipher if the letters in a pair does not appear in same row or column?

Question 5 of 10

Question 6 of 10

6. 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; 
} 

Question 6 of 10

Question 7 of 10

7. Route cipher is closely related to?

Question 7 of 10

Question 8 of 10

8. Trithemius cipher is harder to crack than vigenere cipher.

Question 8 of 10

Question 9 of 10

9. Which of the following is a type of substitution cipher?

Question 9 of 10

Question 10 of 10

10. Consider the expression T & F | T. What is the number of ways in which the expression can be parenthesized so that the output is T (true)?

Question 10 of 10


 

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.