Docx
Docx
Message encryption
Message authentication code
Hash function
(a) A hash code is computed from the source message, encrypted using symmetric encryption and a secret
key, and appended to the message. At the receiver, the same hash code is computed. The incoming code is
decrypted using the same key and compared with the computed hash code.
(b) This is the same procedure as in (a) except that public-key encryption is used; the sender encrypts the
hash code with the sender's private key, and the receiver decrypts the hash code with the sender's public
key.
(c) A secret value is appended to a message and then a hash code is calculated using the message plus
secret value as input. Then the message (without the secret value) and the hash code are transmitted. The
receiver appends the same secret value to the message and computes the hash value over the message plus
secret value. This is then compared to the received hash code.
Q.4 What properties must a hash function have to be useful for message authentication?
In cryptography, a keyed-hash message authentication code (HMAC) is a specific type of message
authentication code (MAC) involving a cryptographic hash function and a secret cryptographic key. It may
be used to simultaneously verify both the data integrity and the authentication of a message, as with any
MAC. Any cryptographic hash function, such as MD5 or SHA-1, may be used in the calculation of an
HMAC; the resulting MAC algorithm is termed HMAC-MD5 or HMAC-SHA1 accordingly.
The compression function is the fundamental module, or basic building block, of a hash function. The hash
function consists of iterated application of the compression function
Encryption algorithm: The encryption algorithm performs various transformations on the plaintext.
Public and private keys: This is a pair of keys that have been selected so that if one is used for
encryption, the other is used for decryption. The exact transformations performed by the algorithm
depend on the public or private key that is provided as input.
Asymmetric algorithms rely on one key for encryption and a different but related key for decryption. These
algorithms have the following important characteristic:
It is computationally infeasible to determine the decryption key given only knowledge of the
cryptographic algorithm and the encryption key.
Either of the two related keys can be used for encryption, with the other used for decryption.
b) 1920 bits
size of padding field = 1 bit
data of padding field = 1
data of length field = 1920 as an unsigned 128-bit big
endian integer 0x0000000F0000000000000000000007AF
c) 1921 bits
4. Show the result of encrypting M = 4 using the public key (e; n) = (3; 77) in the RSA cryptosystem.
4. What is the plaintext for the following ciphertext, which was encrypted using a simple substitution
cipher: CJBT COZ NPON ZJV FTTK TWRTUYTFGT NJ DTN O XJL. Y COZ ZJV CPJVIK DTN O XJL
MYUCN.