Assignment Network and Security
Assignment Network and Security
Show how a 128-bit message authentication code CK (M) with 64-bit key K can be constructed
for an n-bit long message M using
i. A secure hash function H:{0,1}∗ → {0,1}256, such as SHA-256;
answer
ii. ii. A block cipher E : {0,1}128 × {0,1}256→ {0,1}256
Answer
We say that H: Keys(H) × D → R is keyless if Keys(H) = {ε} consists of just one key, the empty
string. In this case we write H(x) in place of H(ε, x) or Hε(x). Practical hash functions like MD5,
SHA1, SHA256, SHA512, SHA3, ... are keyless.
SHA256
Alg SHA1(M) // |M| < 264
return V
y ← shapad(M)
for i = 1, . . . , n do V ← shf1(K, Mi k V)
return V
return y
QUESTION TWO
Your colleague wants to use a secure one-way hash function h in order to store h (password) as
password-verification information in a user database for which confidentiality might become
compromised. For h, she suggests using an existing CBC-MAC routine based on AES with all
bits of the initial vector and the 128-bit AES key set to zero. Is this construct a suitable one-way
hash function for this application? Explain why
Answer
One-way hash function is appropriate for this application because of the following reasons
listed below
Hashing algorithms like modern(SHAn)are a mostly used in databases to verify that the
hash of the submitted password matches the stored hash. This also means that if a hacker
gains unauthorised access to the database they do not get passwords themselves but rather
their hashes which cannot be used to log in directly.
Non-reversibility, or one-way function .A one-way hash function is a mathematical
function that generates a fingerprint of the input, but there is no way to get back to the
original message
It is a one-way function, that is, a function which is practically infeasible to invert.
Diffusion, or avalanche effect. If the input is the same then the hash is always the same,
if it changes at all, even by one character the output hash is completely different
Non-predictable. The hash value should not be predictable from the message
A hash is ideal for verifying that two things are identical, this has two main uses.
“Integrity verification” is used to verify that a file that has been downloaded is identical
to the one on the server by comparing a known hash of the server file to a hash of the
downloaded file.
One-way hash functions are used to protect data against intentional or unintentional
modifications.
QUESTION THREE
Explain the purpose of a digital signature and how digital certification is achieved. It is not
necessary to write out the entire content of a digital signature, but your answer should include
explanations of the use of a hash function, public key cryptography and a certificate authority
(CA) to achieve its purpose.
Answer
A digital signature is a mathematical technique used to validate the authenticity and integrity of
a message, software or digital document. It's the digital equivalent of a
handwritten signature or stamped seal, but it offers far more inherent security.
Digital certificate
To protect the integrity of the signature, PKI requires that the keys be created, conducted, and
saved in a secure manner, and often requires the services of a reliable Certificate Authority
(CA). Digital signature providers, like DocuSign, meet PKI requirements for safe digital signing.
QUESTION FOUR
In electronic payment services, why might public key cryptography not be good enough on its own, and
how might public key cryptography be coupled with symmetric encryption to provide the required data
privacy?
Answer
Public-key cryptosystems are convenient in that they do not require the sender and receiver to
share a common secret in order to communicate securely (among other useful properties).
However, they often rely on complicated mathematical computations and are thus generally
much more inefficient. The use of both asymmetric and symmetric cryptography & keys are part
of a well-rounded solution for securing electronic payment or digital transactions. Asymmetric
encryption is often used to establish a secure connection between two parties, e.g. when
connecting to an online web portal / secure website. The extra overhead of the public/private key
operation is only incurred at the beginning of the exchange to ensure a trusted relationship.
Typically, once a secure connection is established, the two entities will then use faster
symmetrical encryption to share multiple transactions of sensitive data. The combination of
using both symmetric and asymmetric algorithms together is known as hybrid encryption.