Cryptography of question answer
Cryptography of question answer
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.
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
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
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:
Let 𝑛 = 11, 𝑔 = 7.
2. Alice chooses another large random number 𝑥, and calculates 𝐴 such that: 𝐴 = 𝑔 𝑥 mod 𝑛
4. Bob independently chooses another large random integer 𝑦 and calculates 𝐵 such that: 𝐵 = 𝑔 𝑦 mod 𝑛
Let 𝑝 = 7, 𝑞 = 11
2. Calculate 𝑁 = 𝑝 × 𝑞
we have, 𝑁 = 7 × 11 = 77
(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 : 𝒅 × 𝒆 ≡ 𝟏 (𝒎𝒐𝒅 (𝒑 − 𝟏)(𝒒 − 𝟏) )
5. For encryption, calculate the ciphertext 𝑪 from the plane text 𝑴 as follows: 𝑪 ≡ 𝑴𝒆 (𝒎𝒐𝒅𝑵)
7. For decryption, calculate the plaintext 𝑀 from the ciphertext 𝐶 as follows: 𝑴 ≡ 𝑪𝒅 (𝒎𝒐𝒅 𝑵)
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)))))