Assignment_2
Assignment_2
4. Use your name as plain text (lowercase, remove spaces). Use the following
one time pad based to generate the cipher text using one time pad:
"thequickbrownfoxjumpsoverthelazydog". Show all of your work (i.e., name in
one row, letter values in the following row, one time pad in the following row,
letter values of one time pad in the following row, results of applying the one
time pad in the following row, and the corresponding cipher text in the final
row). (10 points)
Ans : Certainly, let's encrypt the plaintext "vamsiasa" using a one-time pad
based on the key "thequickbrownfoxjumpsoverthelazydog".
Here's the step-by-step process:
• Plaintext: vamsiasa (lowercase, no spaces)
• Letter Values (a=0, b=1, c=2, ..., z=25):
• v: 21
• a: 0
• m: 12
• s: 18
• i: 8
• a: 0
• s: 18
• a: 0
• One-Time Pad (Key): thequickbrownfoxjumpsoverthelazydog
• Letter Values of One-Time Pad:
• t: 19
• h: 7
• e: 4
• q: 16
• u: 20
• i: 8
• c: 2
• k: 10
• b: 1
• r: 17
• o: 14
• w: 22
• n: 13
• f: 5
• o: 14
• x: 23
• j: 9
• u: 20
• m: 12
• p: 15
• s: 18
• o: 14
• v: 21
• e: 4
• r: 17
• t: 19
• h: 7
• e: 4
• l: 11
• a: 0
• z: 25
• y: 24
• d: 3
• o: 14
• g: 6
• Results of Applying the One-Time Pad (Plaintext Value + Key
Value % 26):
• v + t = 21 + 19 = 40 % 26 = 14 (letter value: o)
• a + h = 0 + 7 = 7 (letter value: h)
• m + e = 12 + 4 = 16 (letter value: q)
• s + q = 18 + 16 = 34 % 26 = 8 (letter value: i)
• i + u = 8 + 20 = 28 % 26 = 2 (letter value: c)
• a + i = 0 + 8 = 8 (letter value: i)
• s + c = 18 + 2 = 20 (letter value: u)
• a + k = 0 + 10 = 10 (letter value: k)
• Cipher Text: ohticiuk
So, the corresponding ciphertext for the plaintext "vamsiasa" using the one-
time pad "thequickbrownfoxjumpsoverthelazydog" is "ohticikt".
5. Ecila and Selrahc are exchanging messages over an insecure line. Yrollam
is listening in between and has the ability to modify, delete, or insert
messages. How can Ecila and Serahc ensure each of the following? Explain
the process and the technique(s) for each of the problems below:
a. If Selrahc receives a message from Ecila, the contents have not been
modified by Yrollam. (5 points)
c. If Ecila sends three messages to Selrahc, Yrollam cannot delete the second
message without getting detected by Ecila. (5 points)
d. Yrollam cannot insert a fake message from Ecila to Selrahc (i.e., Yrollam
sends the fake message to Selrahc and pretend that this is actually fro Ecila).
(5 points)
Ans : Ecila and Selrahc can utilize cryptographic methods like digital
signatures and message authentication codes (MACs), as well as methods for
spotting replay attacks and preventing message deletion, to guarantee
message integrity, authenticity, and detection of alterations or insertions.
They may accomplish each of the needed security features by following
these steps:
a. Message Integrity (Yrollam Has Not Modified):
Digital signatures as a technique :
Ecila uses her private key to sign each correspondence with a digital
signature.
She sends Selrahc the original message as well as the digital signature.
The message and the digital signature are delivered to Selrahc.
Ecila's public key is used by Selrahc to validate the signature. If the signature
is genuine, Yrollam has not altered the message in any way.
Since only Ecila's private key was capable to producing a legitimate
signature, Selrahc may have confidence in the message's integrity.
b. Maintaining Message Freshness (Preventing Replay Attacks): Process using
Timestamps or Nonces:
Each communication sent by Ecila contains a timestamp or a one-of-a-kind
random integer (nonce).
Selrahc records the timestamps or nonces for messages that are received.
Selrahc determines whether a message's timestamp or nonce is fresh (i.e.,
hasn't been seen previously or is within a reasonable time limit) when it gets
it.
Selrahc accepts the message if the timestamp or nonce is current; otherwise,
it is viewed as a replay attack and is deleted.
c. Message Deletion Detection: