Question1Hash & MAC Security In a Certain Network Protocol, Each Datagram Consists of a 256-bit Header and a 256-bit Payload Cryptography Theory & Applications Assignment, UOY, UKUK

Question 1: Hash & MAC Security

In a certain network protocol, each datagram consists of a 256-bit header and a 256-bit payload. An organization decides to store hashed datagrams for analytic purposes. These hash values need to be calculated on resource-limited devices that can only process data in 256-bit chunks. Thankfully, the devices have hardware implementations of the following cryptographic algorithms:

  • SHACAL, a block cipher with 256-bit keys, 256-bit input blocks, and 256-bit outputs, and
  • H, a secure internal hash function with 256-bit inputs and 128-bit outputs.

Since the internal hash function H cannot process entire datagrams, it is necessary to design a hashing method that can compute datagram hashes based on the internally implemented algorithms. The engineers come up with the following designs for hashing datagrams:

Save your time - order a paper!

Get your paper written from scratch within the tight deadline. Our service is a reliable solution to all your troubles. Place an order on any task and we will take care of it. You won’t have to worry about the quality and deadlines

Order Paper Now

Design A: Hash separately, then XOR, i.e.,

Hash(datagram) := H(header) _ H(payload) .

Design B: Hash separately, then hash the concatenated results, i.e.,

Hash(datagram) := H( H(header) k H(payload) ) .

Design C: Apply SHACAL to the payload (as input block) using the header as key, then XOR the result with the header, i.e.,

Hash(datagram) := SHACALheader(payload) _ header .

In these designs, _ denotes the bit-wise exclusive-or operation and k denotes string concatenation. The designed datagram-hashing method is called Hash to distinguish it from the internal hash function H.


(i) .The organization needs to develop a program that looks at the stored datagram hash values and for any two hashed datagrams reliably distinguishes if the original datagrams were identical or not. Identify the security requirement on datagram hashing in this case, and briefly justify your answer.

(ii)Consider the three candidate designs A, B, and C above. For each design, discuss whether or not it satisfies the security requirement identified in part (i). In each case, provide a convincing argument or an attack to support your answer.

Now assume that besides calculating datagram hash values, the devices are to transmit the datagrams to a central monitoring platform over a public network. The devices apply a message-authentication code MAC to hashed datagrams and send the following information to the monitoring platform.

datagram, MACK( Hash(datagram) )

Assume that MAC is secure and the MAC key K is securely pre-shared between a device and the monitoring platform. Since datagrams are not required to remain confidential, no encryption is used, and the above information is sent in the clear over the network. Hence, the network communication might be observed, blocked, or modified by third parties. The monitoring platform performs MAC verification upon receiving any communication and only accepts the incoming communication if MAC verification succeeds.


(iii). The authenticity and integrity of the received communication are important to the monitoring platform. In other words, the platform needs to make sure any communication it accepts is indeed from the device and that the information has not been tampered with in transit. Identify the security requirement on the MAC component for the above protocol to provide authenticity and integrity guarantees. Briefly justify your answer.

(iv). Consider Designs B and C only. For each design when used in the protocol above, discuss if the required goals of authenticity and integrity are met. In each case, provide a convincing argument or an attack to support your answer.

Question 2: Encryption at ITCrypt

You were recently hired as a Cryptography Engineer at ITCrypt, a local start-up company who is specializing in building solutions to secure IoT devices. You are interested in securing the communication between two small, resource-constrained IoT devices. Your goal is to secure the communication between two parties who have already shared a private key, for example via a key-exchange protocol.


(i). What cryptographic primitive should you implement to secure the communication channel between the devices? What notion of security should this primitive achieve?

(ii). A former colleague had recommended using AES-CBC (i.e., CBC with AES as the underlying block cipher), and incrementing the IV by a constant value D at each invocation. The latter choice was made in order to save on random-number generation.

Thus, in this construction initially, a random IV is chosen; subsequently, at each new invocation, the IV is updated via IV-IV + D and then used in AES-CBC to encrypt data. Show that this is not a sound design by presenting a chosen-plaintext attack. (The encryption scheme keeps IV as an internal state so that it can increment it by D at each new invocation.)

(iii). After long discussions, the implementers at ITCrypt finally agreed to use fresh random IVs at each invocation. Does AES-CBC with fresh random IVs provide an adequate level of security? Briefly justify your answer.

(iv). Since the implementers at ITCrypt have developed their own in-house implementation of AES-CBC, they are reluctant to switch to another mode of operation. How can you transform AES-CBC (without modifying its internals) to a scheme that provides the levels of security required in practice, and as identified in part (i)?

(v). Had ITCrypt originally hired you for the Cryptography Engineer position, which off-the-shelf solution would you have recommended ITCrypt to use? Justify your answer

by discussing various parameters that need to be considered when choosing a cryptographic solution for this setting. (Consider security, efficiency and other aspects in comparison to modified AES-CBC in part (iv).)

Question 3: Digital Documents

Consider the following scenario. Two law firms used to manually exchange signed contracts. Now they are deciding to “go digital.” Their requirement is that any document sent from one firm (say, firm A) to the other (say, firm B) needs to be legally binding; that is, in case of a dispute, firm B should be able to prove to a court that a document has been sent to them from firm A in its exact form. In other words, if firm A sends a document to firm B, then firm A should not be able to later deny sending the document.

The firms are looking to adopt a cryptographic solution to satisfy their requirement. They were advised to choose a (nationally or internationally) standardized solution. Due to the nature of the documents, the firms require that the solution they adopt is secure for up to 5 years. The firms are based in the United States and the European Union; hence they were advised to follow NIST 2020 and ECRYPT-CSA 2018 recommendations for security levels and key sizes.


(i). Identify the security property required by the firms and the cryptographic primitive (algorithm) that would provide this property.

(ii). Propose a standardized scheme to be adopted by the firms, citing the specific standard recommending the algorithm.

(iv) .Considering the duration requirement of the firms, recommend a level of security for the firms that satisfies both the NIST 2020 and ECRYPT-CSA 2018 recommendations, and briefly justify your answer. Determine the recommended key sizes and hash digest lengths for the algorithm proposed in part (ii).

(v)Considering the proposed solution, explain what preparations need to be made in terms of generating and sharing cryptographic information between the two firms before the proposed algorithm can be used for exchanging documents.

Question 4: Weak Keys in the Wild

Read the following papers and write a summary of your understanding.

  • “Ron was wrong, Whit is right” by Lenstra et al. presented at Crypto 2012. Available at:
  • “Mining Your Ps and Qs: Detection of Widespread Weak Keys in Network Devices” by Heninger et al. presented at USENIX Security 2012. Available at: