0% found this document useful (0 votes)
163 views

Assignment Network and Security

i. A 128-bit message authentication code can be constructed using a SHA-256 hash function or a block cipher like AES with a 128-bit key. The hash or cipher output is combined with the message to create the authentication code. ii. Using a CBC-MAC with AES and all zeros for the initialization vector and key would not be suitable as a one-way hash function for password verification. One-way hash functions need to be non-reversible and produce different outputs even for small changes in the input. iii. Digital signatures combine public key cryptography and hash functions. A document is hashed then signed with a private key. The signature and public key can be verified using the hash and public key

Uploaded by

Tryson Sikanyika
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
163 views

Assignment Network and Security

i. A 128-bit message authentication code can be constructed using a SHA-256 hash function or a block cipher like AES with a 128-bit key. The hash or cipher output is combined with the message to create the authentication code. ii. Using a CBC-MAC with AES and all zeros for the initialization vector and key would not be suitable as a one-way hash function for password verification. One-way hash functions need to be non-reversible and produce different outputs even for small changes in the input. iii. Digital signatures combine public key cryptography and hash functions. A document is hashed then signed with a private key. The signature and public key can be verified using the hash and public key

Uploaded by

Tryson Sikanyika
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

QUESTION ONE

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

V ← SHF1( 5A827999 k 6ED9EBA1 k 8F1BBCDC k CA62C1D6 , M )

return V

Alg SHF1(K, M) // |K| = 128 and |M| < 264

y ← shapad(M)

Parse y as M1 k M2 k · · · k Mn where |Mi | = 256 (1 ≤ i ≤ n)

V ← 67452301 k EFCDAB89 k 98BADCFE k 10325476 k C3D2E1F0

for i = 1, . . . , n do V ← shf1(K, Mi k V)

return V

Alg shapad(M) // |M| < 264

d ← (447 − |M|) mod 512

Let ` l be the 64-bit binary representation of |M|

y ← M k 1 k 0 d k ` // |y| is a multiple of 512

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

A digital certificate is an electronic document issued by a Certificate Authority (CA). It contains


the public key for a digital signature and specifies the identity associated with the key, such as
the name of an organization. The certificate is used to confirm that the public key belongs to the
specific organization. The CA acts as the guarantor. Digital certificates must be issued by a
trusted authority and are only valid for a specified time. They are required in order to create a
digital signature. When a signer electronically signs a document, the signature is created using
the signer’s private key, which is always securely kept by the signer. The mathematical
algorithm acts like a cipher, creating data matching the signed document, called a hash, and
encrypting that data is converted into hash value or message digest.

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.

 a key encapsulation scheme, which is a public-key cryptosystem, and


 a data encapsulation scheme, which is a symmetric-key cryptosystem.

You might also like