Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The Feistel cipher is a symmetric block cipher encryption framework which is the basis of many modern day encryption algorithms. In this coursework you will

The Feistel cipher is a symmetric block cipher encryption framework which is the basis of many modern day encryption algorithms. In this coursework you will implement a Feistel cipher system as a software implementation in Hack Assembly.
In a Feistel cipher the plaintext, P, to be encrypted is split into two equal size parts L0 and R0 such that P = L0R0. A function F is applied to one half of the plaintext, combined with a key, and the result is XORd with the other half of the plaintext. Feistel ciphers often employ multiple rounds of this scheme. In general the scheme works as follows, for all i =0,...,n,
Li+1= Ri
Ri+1=Li F(Ri,Ki)
To decrypt an encrypted message using this cipher we can apply the same procedure inreverse. Fori=n,n1,...,0,
Ri = Li+1
Li =Ri+1F(Li+1,Ki)
For this coursework we are interested in the 16-bit Feistel cipher which uses 4 rounds. The function F (A, B)= A B.
The keys are derived from a single 8-bit key K0 such that,
K0= b7b6b5b4b3b2b1b0 K1= b6b5b4b3b2b1b0b7 K2= b5b4b3b2b1b0b7b6 K3= b4b3b2b1b0b7b6b5
DO NOT USE <<,>> OR ^ AS THEY ARE NOT VALID IN HACK ASSEMBLY.
1. Write a program (XOR.asm) in HACK assembly that implements a bit-wise XOR function between two 16-bit values stored in RAM[3] and RAM[4] and stores the result in RAM[5].
2.Write a program (Rotate.asm) in HACK assembly that implements an algorithm to rotate the bits of a 16-bit number left (Least Significant bit (LSb) to Most Significant bit (MSb)). The original number should be stored in RAM[3], the number of times to rotate the bits should be in RAM[4] and the result stored in RAM[5], i.e.1010111100000000 rotated left 3 times would be 0111100000000101 where the MSb is used to replace the LSb on each rotation.
USE XOR.ASM AND ROTATE.ASM IN PART3:
3. Write a program (FeistelEncryption.asm) in HACK assembly, that implements the described Feistel encryption system. The initial key, K0, will be stored in RAM[1], and the plaintext to be encrypted will be represented by a 16-bit value stored in RAM[2]. The result of the encryption should be stored in RAM[0].

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle Database 11g SQL

Authors: Jason Price

1st Edition

0071498508, 978-0071498500

More Books

Students also viewed these Databases questions