NEW
Font size
WorksheetsCryptography_midterm
Total questions: 18
Worksheet time: 22mins
What is the basic principle the shift cipher?
Splitting the plaintext into fixed-size blocks and replacing each block with a different symbol
Rearranging the letters of the plaintext according to a pre-defined pattern
Replacing each letter of the plaintext with a different letter from a pre-defined key
Replacing each letter of the plaintext with the letter that comes a fixed number of positions later in the alphabet
Calculate GCD(60, 36)
12
11
10
9
Calculate s with Extended Eucleadian algorithm for GCD(65, 40) where t is equal to 5:
Formula: as + bt = GCD(a, b)
5
0
3
-3
Calculate the task below:
2⁸ mod 13
12
11
10
9
By using Diffie-Hellman key exchange algorithm, Alice chose her private variable x = 2, and Bob as y = 4. Generator g is equal to 3, and n = 5.
What is the K equal to?
0
1
2
3
What is the multiplicative inverse of 11 modulo 26?
8
7
9
6
In which cipher the code below may be used?
def some_function(data, key = 'string', encode = False, decode= False):
from itertools import izip, cycle
import base64
if decode:
data = base64.decodestring(data)
d = ' '.join(chr(ord(x) ^ ord(y)) for (x,y) in izip(data, cycle(key)))
if encode:
return base64.encodestring(d).strip()
return d
Stream cipher
Hill cipher
XOR cipher
Vigenere cipher
Which of the following best describes a stream cipher?
Cipher that generates a stream of key bits that are combined with the plaintext to produce ciphertext
Cipher that involves rearranging the letters of the plaintext according to pre-defined pattern
Cipher that replaces each plaintext letter with another letter using a pre-defined key
Cipher that operates on fixed-size block of plaintext and ciphertext
From which cipher this formula is used?
M - letter of a message
K - letter of a key
E × (M + K) mod 26
Caeser cipher
Vigenere cipher
Affine cipher
Hill cipher
Which encryption technique is represented in the code below?
def encrypt(text, key):
result = ' '
for i in range(len(text)):
char = text[i]
if(char.isupper()):
result += chr((ord(char) + key - 65) % 26 + 65)
else:
result += chr((ord(char) + key - 97) % 26 + 97)
return result
Caeser cipher
Vigenere cipher
Affine cipher
Hill cipher
What is the definition of cryptography?
The study of secret writing and the practice of secure communication techniques
The study of secret languages and the practice of linguistics
The study of secret societies and the practice of clandestine operations
The study of the art of writing secret messages
What is formula used by the Affine Cipher to decrypt a letter in the plaintext?
new_index = (index - a) % n
new_index = (a × index + b) % n
new_index = (a × index - b) % n
new_index = (index + a) % n
Which of the following best describes the figure below?
Encryption system
Communication channel
Decryption sytem
Key exchange algorithm
Which encryption technique is used in the code below?
def some_function(seq, length):
return [seq[i : i + length] for i in range(0, len(seq), length)]
def encode(key, plaintext):
order = {
int(val): num for num, val in enumerate(key)
}
ciphertext = ' '
for index in sorted(order.keys()):
for part in some_function(plaintext, len(key)):
try:
ciphertext += part[order[index]]
except IndexError:
continue
return ciphertext
Permutation
Transposition
Stream
Hill
By using a stream cipher to encrypt message: 010111001010 with a key stream: 1010
What will be the ciphertext?
11001100000
111011000000
11011010000
111001100000
What is the cipher name that the code below might be implemented?
result = " "
for letter in text:
if letter.lower() is alphabet:
result += key[alphabet.find(letter.lower())]
else:
result += letter
Permutation
Transpostion
Substitution
Affine
Which cipher this code is part of?
def init(self):
pass
def encryptChar(self, char):
K1, K2 kI = self.KEY
return chr((K1 × ord(char) + K2) % self.d)
def encrypt(self, string):
return " ".join(map(self.encryptChar, string))
Caeser
Vigenere
Hill
Affine
Calculate multiplicative inverse modulo of a matrix below
[[5, 2], [6, 7]]
[2, 7], [15, 18]
None of them
Matrix is not invertible
I don't know :(
