July 01, 2019

Network Security Assignment - SEM 7


Question
Identify the security principle: When data must arrive at receiver exactly as it was sent
Nonrepudiation
Integrity
Confidentiality
Authentication

Question
Identify the security principle: When a sender cannot deny sending a sent message
Nonrepudiation
Integrity
Confidentiality
Authentication

Question
When an attacker performs a capture of a data unit and its subsequent retransmission, which attack he is performing?
Denial of service
Disruption
Spoofing
Replay

Question
What is the block cipher structure in DES?
RSA
Feistel
Shannon
Diffie-Hellman

Question
What does it mean that a hash function H is “collision resistant”?
It is easy to compute h = H(M) for any message M
Given h, it is infeasible to find x such that H(x) = h
Given x, it is infeasible to find y such that H(x) = H(y)
It is infeasible to find any x, y such that H(y) = H(x)

Question
Company XYZ wants to elect their new president by electronic voting. Which security principle will be applicable if only employees are allowed to vote.
Authentication
Integrity
Non-repudiation
Confidentiality

Question
Company XYZ wants to elect their new president by electronic voting. Which security principle will be applicable if No one should be able to see who the other voted for.
Authentication
Integrity
Non-repudiation
Confidentiality

Question
Company XYZ wants to elect their new president by electronic voting. Which security principle will be applicable if An employee should be able to verify that his vote was not changed.
Authentication
Integrity
Non-repudiation
Confidentiality

Question
Company XYZ wants to elect their new president by electronic voting. Which security principle will be applicable if The employee cannot deny having voted
Authentication
Integrity
Non-repudiation
Confidentiality

Question
Alice and Bob share a common secret password, P. Using this, they want to authenticate each other. Which of the following is the correct way to do so?
Alice sends P to Bob. Bob verifies P to authenticate Alice.
Alice sends the message encrypted with P. If Bob is able to decrypt it successfully, Alice is authenticated.
Alice sends a random number encrypted with P. Bob decrypts the number and authenticates Alice.
Bob sends Alice a random challenge. Alice returns the challenge encrypted with P.
Bob sends Alice a random challenge encrypted with P. Alice returns the challenge+1 encrypted with P.

Question
In which algorithmic mode does the corresponding cipher text block repeat if a plain text block repeats in the original message? Select all correct options
ECB
CBC
CFB
OFB

Question
In which algorithmic mode can the ciphering operation be performed in parallel? Select all correct options
ECB
CBC
CFB
OFB

Question
Consider the following scenario.A and B both share a secret key with a Key Distribution Center (KDC). We call these keys Ka-kdc and Kb-kdc respectively. A wants to establish a shared symmetric key with B using the following steps:A sends a message to the KDC encrypted by Ka-kdc. Encrypt Ka-kdc(B)KDC responds by sending Encrypt Ka-kdc(Kb-kdc)A now corresponds with B using Kb-kdc. Is this solution correct or incorrect. Justify.
The solution is correct. The KDC first verifies A since Ka-kdc is known only to A. Only the KDC and B know Kb-kdc.
The solution is incorrect. The KDC first verifies A since Ka-kdc is known only to A. Only the KDC and B know Kb-kdc.

Question
Consider the following scenario.Alice wants to send assignment grades from her home computer to Bob at work. She wants to prevent anyone from modifying the grades. So Alice sends a message M to Bob along with H = Hash(M). Bob receives M and H, and calculates H’ = Hash(M). Only if H = H', Bob accepts the message. Is this solution foolproof?
Yes because if the message is changed, the hash will also change and Bob will be able to detect the modified
No because the intruder may replace M with M' and H with Hash(M').

Question
A class has n students. How many symmetric secret keys are needed if each students wants to send secret messages to another?
1
n
n*n
n(n-1)/2

Question
A class has n students. If they all trust the classteacher, how many symmetric secret keys are needed?
1
n
n*n
n(n-1)/2

Question
If the class teacher distributes a temporary one-time session key for a communicating pair, how many keys are needed? The temporary key is encrypted and sent to both members.
1
n
n*n
n(n-1)/2

Question
If public key cryptography is used, how many keys are needed in all?
1
2
n
2n

Question
An attack on a cipher text message where the attacker attempts to use all possible permutations and combinations is called:
Brute force attack
Man-in-the-middle
Chosen plaintext
Chosen ciphertext

Question
Which of the following is most efficient to achieve confidentiality and digital signature for message M
Use public key cryptography to hide message M by applying Encrypt-with-Kreceiverpublic(M) and sign message M applying Encrypt-with-Ksenderprivate(M)
Use public key cryptography to hide message M by applying Encrypt-with-Kreceiverpublic(M) and sign message by applying Encrypt-with-Ksenderprivate(Hash(M))
Use public key cryptography to share key by applying Encrypt-with-Kreceiverpublic(Kshared), hide message by applying Encrypt-with-Kshared(M) and sign message by applying Encrypt-with-Ksenderprivate(Hash(M))
Use private key cryptography to hide message M by applying Encrypt-with-Kshared(M) and sign message by applying Encrypt-with-Kshared(Hash(M))

Question
Key distribution often involves the use of _________ which are generated and distributed for temporary use between two parties.
Session keys
Public keys
private keys
Certificates

June 24, 2019

Network Security - Comprehensive Paper Solution


Note: This is a previous year comprehensive solutions for your reference, feel free to provide solutions by navigating Submit Question/Answer tab in case you have latest solutions.


1) Jira's password is made of up 6 alphanumeric characters only. One password attempt takes 1 millisecond, What is the time to crack it in days?
i)  If password is case-sensitive.
ii) If password is case- insensitive.

Answer:
i) Case sensitive
 total chars = 26 + 26 + 10 = 62
 possible combinations = 62 ^ 6 passwords
 total time taken = 62 ^ 6 . 1 ms
 approx. 62.62 =~ 3600 sec = 1 hour
 Total time taken = 62. 62. 62. 62 / 1000 hours
 =~ 360. 36 hours = 360.36/24 days
 =~ 360.3/2= 180.3 = 540 days
 Note: 62^4/1000/24 =~ 615 days
 So an approx. answer between 520 to 620 days is good enough.

ii) Case insensitive
 total chars = 26 + 10 = 36
 possible combinations = 36 ^ 6 passwords
 total time taken = 36 ^ 6 . 1 ms
 = 36.36.36./ 1000 . 36 ^3
 =~ 36. 36 ^ 3 seconds
 = 36. 36. 36. 36 / 3600 hours
  = 466 hours
 =~ 19 days
 So an approx. answer between 18 to 20 days is good enough.

2) What is a self-signed SSL certificate ?  Detail on the security perspective when a website is using a self-signed SSL certificate.

Answer:
A certificate not-signed by a Publicly trusted CA, but signed by a locally setup CA server is a self-signed certificate. Any entity/website/server using a self-signed SSL certificate cannot be trusted and very commonly used in phising attacks. I can setup a server to act as gmail.com fradulently by creating a self-signed certificate for www.gmail.com and deploying it in the server.

Most standard browsers – Firefox, Google Chrome, Safari, etc. throw errors when trying to browse to websites having self-signed certificates.

3) How to avoid man-in-the-middle attack in SSH sessions? Show passwordless SSH logins at work.

Answer:
Man-in-the-middle attack is at-work when a client C logs in to a server M thinking it is server S and the client C is unable to detect it. In this case, the server M has successfully duped the client C and has forged a man-in-the-middle attack. So it can be a passive two-way data forwarder between client C and the actual server S, or an active data-mangler.
Every host server in SSH have their public keys sent to the client in the Key Exchange., which gets stored in client’s .ssh/known_hosts file. So the next time, client connects to the host, the server sent public key is matched with the client’s .ssh/known_hosts file and if there is a mismatch, SSH does not connect. So this SSH behavior effectively thwarts a middle server M trying to pose as actual server S.
Password less SSH logins happen via public keys.
Consider Client C connecting to Server S. In server S side, in file .ssh/authorized_keys, there should be entry containing client C’s public key. Then the server S will use it to exchange - encrypting/signing initial key exchange material with the client C. Because of the property that any data encrypted with public key can only be decrypted using the matching private key, this mechanism automatically authenticates the client C as only client C holds the private key. Client’s private key file are usually stored in file .ssh/id_rsa or .ssh/id_dsa depending on the public key algorithm chosen.

June 14, 2019

Discrete Structures for Computer Science - MCQS


 

Note: We have tried to upload as much as we can, all the question and answers might be shuffled - Please find the answer below each question, some answers might be wrong please review on the last date(some answers might be changed) if you find any wrong answer please comment down below.

Question:
Let m be an integer with m > 1. R on the set of integers is an equivalence relation if
Select one:
a. {(a, b) | a ≡ b (mod m)}
b. {(a, b) | a ≡ a (mod b)}
c. {(a, b) | b ≡ b (mod a)}
d. {(a, b) | b ≡ a (mod m)}
The Correct answer is: {(a, b) | a ≡ b (mod m)}

Question:
Consider the statement: x,  y E Z if both xy and x + y are even, then
Select one:
a. both x and y are odd
b. both x and y are even
c. x is even and y is odd
d. x is odd and y is even
The Correct answer is:both x and y are even

Question:
If A = {0, 1}, B = {1, 2}, and C = {0, 1, 2} then what of the following isn’t in A × B × C ?
Select one:
a. (1, 1, 0)
b. (2, 2, 0)
c. (1, 1, 1)
d. (1, 2, 2)
The Correct answer is: (2, 2, 0)

Question:
Let A, B, and C be sets. Identify the the correct one among the following
Select one:
a. None of these
b. A ∩ (B ∩ C) = (C B) A
c. A (B C) = (C B) B
d. A ∩ (B C) = (C B) A
The Correct answer is:  None of these

Question:
Let f1 and f2 be functions from R to R such that f1(x) = x2 and f2(x) = x − x2. What are
the functions f1 + f2 and f1 f2?
Select one:
a. x2 and x4 – x3
b. x and x3 – x2
c. x3 and x2 – x3
d. x and x3 − x4
The Correct answer is: x and x3 − x4

Question:
Determine for what of the following for “f” is not a one-to-one function:
Select one:
a. f  for f (x) = x + 1 from the set of real numbers to itself
b. f  from {a, b, c, d} to {1, 2, 3, 4, 5} with f (a) = 4, f (b) = 5, f (c) = 1, and f (d) = 3
c. f  for f (x) = x2 from Z to the set of integers
d. f  for f (x) = x2 from Z+ to the set of integers
The Correct answer is: f  for f (x) = x2 from Z to the set of integers

Question:
Which of the following is not a logical equivalence for bi-conditional representation ?
Select one:
a. (p → q) ≡ p q
b. p ↔ q ≡ (p q) (p q)
c. p ↔ q ≡ p ↔q)
d. All mentioned
The Correct answer is: (p → q) ≡ p q

Question:
By the second law of de-Morgan (r s) is equivalent to
Select one:
a. r s
b. (r s)
c. r s
d. r s
The Correct answer is: s

Question:
Let P(x) be the statement “x + 1 > x.” For the real number domain, qualify the statement for truth value;
Select one:
a. xP(x) is true
b. xP(x) is true
c. xP(x) is true
d. xP(x) is true
The Correct answer is: xP(x) is true

Question:
For {Z+: Z+ < 5} verify if xP(x) holds good for P(x) is x2 < 10
Select one:
a. xP(x) is a conjunction
b. None of these
c. xP(x) is false
d. xP(x) holds good
The Correct answer is: xP(x) is false

Question:
Identify correct statement/s among the following
Select one:
a. The relation"Union of sets" is reflexive,but not symmetric
b. The relation"parallel of lines" is always an equivalence relation
c. The relation "Division" is Symmetric
The Correct answer is: The relation"parallel of lines" is always an equivalence relation

Question:
Which of the following is/are true ?
Select one or more:
a. p p is always a contradiction
 b. p p is always a tautology
c. p p is always a contradiction
d. p p is always a tautology
The Correct answer is:  p is always a tautology, p is always a contradiction

Question:
What of the following expressions does not imply the negation of the proposition, “there is an honest politician” if h(x) represents honesty function:
Select one:
a. xH(x)
b. xH(x)
c. xH(x)
d. All of these
The Correct answer is: xH(x)

Question:
“The sum of two positive integers is always positive” into a logical expression
Select one:
a. BOTH :xy((x > 0) (y > 0) (x +y > 0)) and xy(x +y > 0)
b. xy((x > 0) (y > 0) (x +y > 0))
c. Either xy((x > 0) (y > 0) (x +y > 0)) or xy(x +y > 0)
d. xy(x +y > 0)
The Correct answer is:  BOTH :xy((x > 0)  (y > 0)  (x +y > 0)) and xy(x +y > 0)

Question:
Which of the following is/are statement/s
Select one or more:
a. How hot the day is
b. None of these are statements
c. The temperature is 40 degrees.
d. It is raining in the summer.
The Correct answer is: The temperature is 40 degrees., It is raining in the summer.

Question:
Let P be “you can take the flight,”
Let Q be “you buy a ticket.”
What of the following notates “you can take the flight if and only if you buy a ticket”
Select one:
a. None of these
b. Q →  P
c. P →  Q
d. P ↔ Q
The Correct answer is: P ↔ Q

June 13, 2019

Digital Electronics and Microprocessors - MCQS



Note: We have tried to upload as much as we can, all the question and answers might be shuffled - Please find the answer below each question, some answers might be wrong please review on the last date(some answers might be changed) if you find any of the answer is wrong please comment down below. 

Question
How many memory chips of (64 x 2) are needed to provide a memory capacity of 2048 x 8? 
A 32
B 128
C  4
D  16

Select one:
a. A
b. D
c. B
d. C
The correct answer is : 128

Question 
In 2's complement binary representation what is the magnitude of  these two numbers 1001    & 11001 
A   -6 & 6
B   9 & 25
C   -6 & -6
D   9 & -6

Select one:
a. C
b. D
c. B
d. A
The correct answer is : -6 & -6

Question
Minimum no. of  two input NAND gate required to implement a Ex-OR function is 
(A)2 (B)3
(C)4 (D)5

Select one:
a. A
b. D
c. B
d. C 
The correct answer is : 4

Question
What is the logic function implemented by the 2X1 mux shown below






A AND logic
B OR logic
C NAND logic
D Nor Logic

Select one:
a. d
b. A
c. c
d. b 
The correct answer is : OR logic