-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathquiz_DH.html
116 lines (86 loc) · 6.09 KB
/
quiz_DH.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
<!DOCTYPE html>
<html>
<head>
<link href="https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,500,600,700,700i|Montserrat:300,400,500,600,700" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Ubuntu&display=swap" rel="stylesheet">
<link rel= "stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" >
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<!-- Libraries CSS Files -->
<link href="lib/font-awesome/css/font-awesome.min.css" rel="stylesheet">
<link href="lib/animate/animate.min.css" rel="stylesheet">
<link href="lib/ionicons/css/ionicons.min.css" rel="stylesheet">
<link href="lib/owlcarousel/assets/owl.carousel.min.css" rel="stylesheet">
<link href="lib/lightbox/css/lightbox.min.css" rel="stylesheet">
<link href="css/materialise.css" rel="stylesheet">
<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
<link rel="stylesheet" type="text/css" href="css/RSA.css">
<link rel="stylesheet" type="text/css" href="css/quiz.css">
<title>Diffie Hellman Key Exchange Algorithm Quiz</title>
</head>
<body>
<div id="main"><!-- open main div -->
<div id="header"><!-- open header div -->
<h1>Diffie Hellman Key Exchange Algorithm Quiz</h1>
</div><!-- close header div -->
<form id="form1">
<h4>1. How many bytes of the secret key is generated using Diffie-Hellman encryption/decryption scheme?</h4>
<label for="var_string"><input type="radio" name="variable" value="0" id="var_string" />256</label>
<label for="var_join"><input type="radio" name="variable" value="1" id="var_join" />871</label>
<label for="var_info"><input type="radio" name="variable" value="0" id="var_info" />1024</label>
<label for="var_condition"><input type="radio" name="variable" value="0" id="var_condition"/>962</label>
<h4>2. The security of Diffie-Hellman key exchange relies on which assumption?</h4>
<label for="sub_string"><input type="radio" name="sub" value="0" id="sub_string"/>It is computationally infeasible to compute a GCD of two large numbers.</label>
<label for="sub_join"><input type="radio" name="sub" value="0" id="sub_join"/>It is computationally infeasible to compute an inverse modulo prime p.
</label>
<label for="sub_info"><input type="radio" name="sub" value="0" id="sub_info" />It is computationally infeasible to test whether a large number is prime.</label>
<label for="sub_condition"><input type="radio" name="sub" value="1" id="sub_condition" />It is computationally infeasible to solve the discrete log problem. </label>
<h4>3. What is the objective of Diffie-Hellman key exchange?</h4>
<label for="cat_string"><input type="radio" name="con" value="0" id="cat_string" />To protect encrypted data from man-in-the-middle attack</label>
<label for="cat_join"><input type="radio" name="con" value="0" id="cat_join" />To perform mutual authentication on both sides</label>
<label for="cat_info"><input type="radio" name="con" value="0" id="cat_info" />To prove to another party that one holds a secret key without revealing it</label>
<label for="cat_condition"><input type="radio" name="con" value="1" id="cat_condition" />To establish a shared secret key on both sides</label>
<h4>The ___ attack can endanger the security of the Diffie-Hellman method if two parties are not authenticated to each other.</h4>
<label for="if_string"><input type="radio" name="ifstate" value="1" id="if_string" />man-in-the-middle</label>
<label for="if_join"><input type="radio" name="ifstate" value="0" id="if_join" />ciphertext attack</label>
<label for="if_info"><input type="radio" name="ifstate" value="0" id="if_info" />plaintext attack</label>
<label for="if_condition"><input type="radio" name="ifstate" value="0" id="if_condition" />none of the above</label>
<h4>The man in the middle attackcan endanger the security of the Diffie-Hellman method if two parties are not</h4>
<label for="temp_string"><input type="radio" name="tempQ" value="1" id="temp_string" /> Authenticated</label>
<label for="temp_join"><input type="radio" name="tempQ" value="0" id="temp_join" />Joined</label>
<label for="temp_info"><input type="radio" name="tempQ" value="0" id="temp_info" />Submit</label>
<label for="temp_condition"><input type="radio" name="tempQ" value="0" id="temp_condition" />Seperate</label>
<br>
<button type="submit" class="btn btn-success value" value="Submit">Submit</button>
</form>
<h4>Your grade is: <span id="grade">__</span></h4>
<p id="grade2"></p>
</div><!-- close main div -->
</body>
<script>
document.getElementById("form1").onsubmit=function() {
variable = parseInt(document.querySelector('input[name = "variable"]:checked').value);
sub = parseInt(document.querySelector('input[name = "sub"]:checked').value);
con = parseInt(document.querySelector('input[name = "con"]:checked').value);
ifstate = parseInt(document.querySelector('input[name = "ifstate"]:checked').value);
tempQ = parseInt(document.querySelector('input[name = "tempQ"]:checked').value);
result = variable + sub + con + ifstate + tempQ;
document.getElementById("grade").innerHTML = result;
grading = [
{score:0,feedback:"0/5 You need revision. Try again"},
{score:1,feedback:"1/5 You need revision. Try again"},
{score:2,feedback:"2/5 You need revision. Try again"},
{score:3,feedback:"3/5 You are almost there. Try again"},
{score:4,feedback:"4/5 You are very close. Try again"},
{score:5,feedback:"5/5 Excellent. Congratulations!"}
];
for(i=0; i<6; i++) {
if(result == grading[i].score) {
result2 = grading[i].feedback;
}
}
document.getElementById("grade2").innerHTML = result2;
return false; // required to not refresh the page; just leave this here
} //this ends the submit function
</script>
</html>