0% found this document useful (0 votes)
20 views5 pages

hw1 2024 1

hw1-2024-1

Uploaded by

rula mohammad
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views5 pages

hw1 2024 1

hw1-2024-1

Uploaded by

rula mohammad
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

1) Decrypt the following ciphertext C into its original plaintext

P using Ceaser cipher (key=5):


C = ymnx nx hfjxfw hnumjwnsl
Plaintext= this is caesar ciphering
2) Encrypt the Plain text P=” system attacked successfully”
using the Monoalphabetic Cipher based on the following
mapping:

Plain text P=” system attacked successfully”


Plain text = LNLZTDQZZQEATRLXEETLLYXSSN
3) Encipher the message “message encryption” using Rail Fence cipher with a
Rail Fence of depth 3

m a n p n
e s g e c y t o
s e r i

cipher text= manpnesgecytoseri

4) 4) Encrypt the following plaintext P = "Cybersecurity cryptographic" using


Row transposition cipher using the Key: 52413
5 2 4 1 3

c y b e r

s e c u r

i t y c r

y p t o g

r a p h I

c - - - -

eucoh-yetpa-rrrgi-bcytp-Csiyrc

Question 2:
Using the S-DES, as described in Lecture L3,
and the key: 1 0 1 0 0 0 0 0 1 0
Encrypt step by step the plaintext P = 0 1 1 1 0 0 1 0
Decrypt step by step the ciphertext C = 0 1 1 1 0 1 1 1
Key Generation: For S-DES, the key is 10 bits. It's split into two
5-bit parts:
• K1: 10100
• K2: 00010
Encryption Steps:
1. Initial Permutation (IP):
o The plaintext is permuted according to the IP table.
o IP(P) = 0 1 0 0 1 1 1 0
2. Round 1:
o Left Shift (LS): The left half (0100) is shifted left by one
bit, becoming 1000.
o Key Generation: K1 is used.
o Function f: The right half (1110) is combined with K1
and passed through the function f.
o XOR: The output of f is XORed with the left half.
o Swap: The left and right halves are swapped.
3. Round 2:
o Left Shift (LS): The left half (1110) is shifted left by one
bit, becoming 1111.
o Key Generation: K2 is used.
o Function f: The right half (1000) is combined with K2
and passed through the function f.
o XOR: The output of f is XORed with the left half.
o Swap: The left and right halves are swapped.
4. Final Permutation (IP^-1):
o The ciphertext is permuted according to the inverse IP
table.
Encryption Example
Key: 10100 00010 Plaintext: 01110010 IP(P): 01001110 Round
1:
• Left Shift: 1000
• f(1110, K1): 1010
• XOR: 0010
• Swap: 1010 0010 Round 2:
• Left Shift: 1111
• f(0010, K2): 0101
• XOR: 1011
• Swap: 1011 1111 IP^-1: 0111 0111
Ciphertext: 01110111
Decryption Steps
Decryption is similar to encryption, but the keys are used in
reverse order.
Key: 10100 00010 Ciphertext: 01110111 IP(C): 10111110
Round 1:
• Left Shift: 1111
• f(1110, K2): 0101
• XOR: 1011
• Swap: 1011 1111 Round 2:
• Left Shift: 1110
• f(1111, K1): 1010
• XOR: 0100
• Swap: 0100 1110 IP^-1: 0111 0010
Plaintext: 01110010

You might also like