Q3
Encrypt: Write a program to encrypt RGB image data using a simple block cipher. Encryption is performed on each pixel in two steps. First swap the nibbles in the high and low bytes as shown in figure 4.
Next, each bit position is inverted by subtracting the swapped data from OxFFFF, as shown in the example in figure 5. The resulting encrypted data is then written to memory.
This program must be named: encrypt.asm and submitted as a plain text file. Again, the memory model ram_4Kx16_sim has already been configured to automatically load the tested image: bug24x24.ppm and store it at base address 1024. When your program has finished processing this image it must store the value Ox00 to address OxFFF to trigger the generation of the output image file: output.ppm.
To test if your encryption program has worked correctly the python program decrypt.py can be downloaded from the VLE. This will decrypt the encrypted PPM image output.ppm to produce a new file call new.ppm.
Your program must be capable of processing an image in 15 ms, programs not meeting this minimum requirement will be awarded a zero mark. Full marks will only be awarded if the program is capable of processing an image in less than 1.22 ms.
The maximum execution time can be achieved using software only solutions. To achieve higher processing speeds new instructions and supporting hardware components will need to be added to the processor, as outlined in practical 9.
Students succeed in their courses by connecting and communicating with an expert until they receive help on their questions
Consult our trusted tutors.