0% found this document useful (0 votes)
16 views6 pages

Cryptography of question answer

Cryptography is the science of securing communication through encryption, ensuring data confidentiality, integrity, and authenticity. Various techniques such as Caesar Cipher, Vernam Cipher, and RSA algorithm are used for encryption and decryption, with principles like confidentiality, authentication, and integrity guiding their implementation. Digital signatures and hash functions play crucial roles in verifying identities and ensuring data integrity in cryptographic systems.

Uploaded by

djagannath033
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)
16 views6 pages

Cryptography of question answer

Cryptography is the science of securing communication through encryption, ensuring data confidentiality, integrity, and authenticity. Various techniques such as Caesar Cipher, Vernam Cipher, and RSA algorithm are used for encryption and decryption, with principles like confidentiality, authentication, and integrity guiding their implementation. Digital signatures and hash functions play crucial roles in verifying identities and ensuring data integrity in cryptographic systems.

Uploaded by

djagannath033
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/ 6

Q. What is cryptography ?

Ans : Cryptography is the science of securing communication and information by converting it into an unreadable format
(encryption) to prevent unauthorized access, ensuring data confidentiality, integrity, and authenticity.

Q. What is Caesar Cipher ?


Ans : In the substitution-cipher technique, the characters of a plain-text message are replaced by other characters,
numbers or symbols.

The process shown above will reveal the original plain text. Cipher text L O R Y H B R X
Thus, given a cipher-text message L ORYH BRX, it is easy to Plain text I L O V E Y O U
Fig. 1 : Example of breaking Caesar cipher
work backwards and obtain the plain text I LOVE YOU as
shown in Fig.1

Q. What is Vernam Cipher ?


Ans : The Vernam cipher, whose specific subset is called one-time pad, is implemented using a random set of non-repeating
characters as the input cipher text.

Let us apply the Vernam cipher algorithm to a plain-text message HOW ARE YOU using a one-time pad NCBTZQARX
to produce a cipher-text message UQXTRUYFR as shown in Fig. 2

Fig. 2 : Example of Vernam cipher

Q. Principles of cryptography.
Ans : Security principles are rules to keep systems, networks, and data safe from threats. They help create strong and secure systems.
• Confidentiality : The principle of confidentiality specifies that only the sender and the intended recipient(s) should
be able to access the contents of a message. Confidentiality gets compromised if an unauthorized person is able to
access a message. This type of attack is called interception.
• Authentication : Authentication mechanisms help establish proof of identities. The authentication process ensures
that the origin of an electronic message or document is correctly identified. This type of attack is called fabrication.
• Integrity : When the contents of a message are changed after the sender sends it, but before it reaches the
intended recipient, we say that the integrity of the message is lost. This type of attack is called modification.
• Non-repudiation : There are situations where a user sends a message, and later on refuses that she had sent that
message.
• Access control : Access control is broadly related to two areas: role management and rule management. Role
management concentrates on the user side (which user can do what), whereas rule management focuses on the
resources side (which resource is accessible, and under what circumstances).
• Availability : The principle of availability states that resources (i.e. information) should be available to authorized
parties at all times. Such an attack is called interruption.
Q. What do you mean by hash function ?
Ans : A hash value h is generated by a function H of the form, ℎ = H(𝑀) where 𝑀 is a variable-length message and 𝐻(𝑀) is the
fixed length hash value.

A hash function is a mathematical algorithm that takes an input (or message) and returns a fixed-size string of characters,
which is typically a sequence of numbers and letters. The output, called a hash value or digest, is unique for each unique
input, making it practically impossible to reverse-engineer the original input from the hash.

Key Features:

• Deterministic: Same input always produces the same output.


• Fast: Computes quickly for any input size.
• Collision-resistant: Different inputs produce different hashes.

Q. What is the meaning of ‘digital signature’ to use in public key


cryptosystem ?
Ans : A digital signature is analogous to the handwriten. It must have the following properties :
★ It must verify the author and the date and time of the signature.
★ It must authenticate the contents at the time of the signature.
★ It must be verifiable by third parties, to resolve disputes.

Following the requirements for digital signature :


★ The signature must be white pattern that depends on the message being signed.
★ The signature must use some information unique to the sender, to prevent both forgery and denial.
★ It must be relatively easy to produce the digital signature.
★ It must be computationally infeasible to forge a digital signature, either by constructing a new message for
an existing digital
signature or by constructing a fraudulent digital signature for a given message.
★ It must be practical to retain a copy of the digital signature in storage.

Q. Algorithm of Diffie-Hellman key-exchange with example.


Ans :
1. Firstly, Alice and Bob agree on two large prime numbers, 𝑛 and 𝑔. These two integers need not be kept secret.
Alice and Bob can use an insecure channel to agree on them.

Let 𝑛 = 11, 𝑔 = 7.

2. Alice chooses another large random number 𝑥, and calculates 𝐴 such that: 𝐴 = 𝑔 𝑥 mod 𝑛

Let 𝑥 = 3. Then, we have, 𝐴 = 73 mod 11 = 343 mod 11 = 2.

3. Alice sends the number 𝐴 to Bob.

Alice sends 2 to Bob.

4. Bob independently chooses another large random integer 𝑦 and calculates 𝐵 such that: 𝐵 = 𝑔 𝑦 mod 𝑛

Let 𝑦 = 6. Then, we have, 𝐵 = 76 mod 11 = 117649 mod 11 = 4.

5. Bob sends the number 𝐵 to Alice.

Bob sends 4 to Alice.

6. 𝐴 now computes the secret key 𝐾1 as follows: 𝐾1 = 𝐵 𝑥 mod 𝑛

We have, 𝐾1 = 43 mod 11 = 64 mod 11 = 9.

7. 𝐵 now computes the secret key 𝐾2 as follows: 𝐾2 = 𝐴 𝑦 mod 𝑛

We have, 𝐾2 = 26 mod 11 = 64 mod 11 = 9.


Q. Explain RSA algorithm, perform encryption and decryption to the
system with p = 7 q = 11 , e = 17 M = 8
Ans :

1. Choose two large prime numbers 𝒑 and 𝒒.

Let 𝑝 = 7, 𝑞 = 11

2. Calculate 𝑁 = 𝑝 × 𝑞

we have, 𝑁 = 7 × 11 = 77

3. Select the public key 𝑒 such that it is not a factor of (𝒑 − 𝟏) × (𝒒 − 𝟏)

(7 − 1) × (11 − 1) = 60 = 22 × 31 × 51
Since 𝐺𝐶𝐷 (60,17) = 1 so, 𝑒 = 17 is valid.

4. Select the private key 𝑑 such that the following equation is true : 𝒅 × 𝒆 ≡ 𝟏 (𝒎𝒐𝒅 (𝒑 − 𝟏)(𝒒 − 𝟏) )

17 × 𝑑 ≡ 1(𝑚𝑜𝑑60) Find 𝑑 using Euclid algorithm.


60 = 17 × 3 + 9
17 = 9 × 1 + 8
9 =8×1+1
Now, 1 = 9 − 8 = 9 − (17 − 9) = 9 × 2 − 17 = (60 − 17 × 3) × 2 − 17 = 60(2) + 17(−7)
So, 17 × 𝑑 ≡ 60(2) + 17(−7) (𝑚𝑜𝑑 60) ≡ 17(−7)(𝑚𝑜𝑑60) or, 𝑑 ≡ −7 (𝑚𝑜𝑑 60) ≡ 53 (𝑚𝑜𝑑 60)
we find 𝑑 = 53.

5. For encryption, calculate the ciphertext 𝑪 from the plane text 𝑴 as follows: 𝑪 ≡ 𝑴𝒆 (𝒎𝒐𝒅𝑵)

Let us find 𝐶 as follows : 𝐶 ≡ 817 ( 𝑚𝑜𝑑 77)


now, 8 ≡ 8 (𝑚𝑜𝑑 77)
𝑜𝑟, 82 ≡ 64 (𝑚𝑜𝑑 77)
𝑜𝑟, 84 ≡ 642 (𝑚𝑜𝑑 77) ≡ 15 (𝑚𝑜𝑑 77)
𝑜𝑟, 88 ≡ 152 (𝑚𝑜𝑑 77) ≡ −6(𝑚𝑜𝑑 77)
𝑜𝑟, 816 ≡ (−6)2 (𝑚𝑜𝑑 77) ≡ 36 (𝑚𝑜𝑑 77)
𝑜𝑟, 816+1 ≡ 36 × 8 (𝑚𝑜𝑑 77) ≡ 57 (𝑚𝑜𝑑 77)
𝑜𝑟, 817 ≡ 57 (𝑚𝑜𝑑 77)
or, 57 ≡ 817 (𝑚𝑜𝑑 77)
we find 𝐶 = 57.

6. Send 𝐶 as the ciphertext to receiver.

send 57 as the ciphertext to the receiver.

7. For decryption, calculate the plaintext 𝑀 from the ciphertext 𝐶 as follows: 𝑴 ≡ 𝑪𝒅 (𝒎𝒐𝒅 𝑵)

Let us find 𝐶 as follows 𝑀 ≡ 5753 (𝑚𝑜𝑑 77)


Now, 57 ≡ −20 (𝑚𝑜𝑑 77)
𝑜𝑟, 572 ≡ 400 (𝑚𝑜𝑑 77) ≡ 15(𝑚𝑜𝑑 77)
𝑜𝑟, 574 ≡ 152 (𝑚𝑜𝑑 77) ≡ −6 (𝑚𝑜𝑑 77)
𝑜𝑟, 578 ≡ (−6)2 (𝑚𝑜𝑑 77) ≡ 36 (𝑚𝑜𝑑 77)
𝑜𝑟, 5716 ≡ 362 (𝑚𝑜𝑑 77) ≡ −13 (𝑚𝑜𝑑 77)
𝑜𝑟, 5732 ≡ (−13)2 (𝑚𝑜𝑑 77) ≡ 15 (𝑚𝑜𝑑 77)
𝑜𝑟, 5732+16+4+1 ≡ 15 × (−13)(−6)(−20) (𝑚𝑜𝑑 77) ≡ −23400 (𝑚𝑜𝑑 77) ≡ 8 + 77(−304) (𝑚𝑜𝑑 77)
𝑜𝑟, 5753 ≡ 8 (𝑚𝑜𝑑 77)
or, 8 ≡ 5753 (𝑚𝑜𝑑 77)
we find 𝑀 = 8.
Q. Explain simplified DES scheme encryption details.
Ans :

IP : Initial Permutation
E/P : Extension Permutation
S0 and S1 : 4×4 substitution matrix
P4 : Permutation of 4-bit
IP-1 : Inverse Initial Permutation
K1 and K2 : Sub keys
F : Mapping from 4-bit string to 4-bit string
fk : most complex component of DES, which consist of a combination of permutation and substitution function
Q. Explain simplified DES example.
Ans :

We can consciously express the encryption algorithm as a composition of functions : IP−1 ∘ fk2 ∘ SW ∘ fk1 ∘ IP

Which can also be written as, ciphertext = IP−1 (fk 2 (SW (fk1 (IP(plaintext)))))

plaintext = IP−1 (fk 1 (SW (fk2 (IP(ciphertext)))))

Where, K1 = P8 (Shift(P10(key))) 𝑎𝑛𝑑 K2 = P8 (Shift(P10(key)))


Q. How S-DES Key generation occurs ?
Ans : S-DES depends on the use of a 10-bit key shared for use in particular stages and receiver. From this key, two 8-bit sub key are the are
produced for use in particular stages of the encryption and decryption algorithm.

P10 : permutation of 10-bit


LS-1 and LS-2 : circular left shift
P8 : permutation of 8-bit
K1 and K2 : Sub keys

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy