Write a program to encrypt RGB image data using a simple block cipher
Ask Expert

Be Prepared For The Toughest Questions

Practice Problems

Write a program to encrypt RGB image data using a simple block cipher

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. 

Appendix

Hint
EngineeringAn RGB code is a three-digit number that represents the amount of red, green and blue color in an image. When you convert from R G B to hexadecimal notation with two digits instead of three or use its decimal equivalent (#RRGGBB), each digit corresponds to one byte: #00 for 0%,#FF for 100%. Encrypting colors can be done by inverting these values so if your original RGB was white (255 25...

Know the process

Students succeed in their courses by connecting and communicating with
an expert until they receive help on their questions

1
img

Submit Question

Post project within your desired price and deadline.

2
img

Tutor Is Assigned

A quality expert with the ability to solve your project will be assigned.

3
img

Receive Help

Check order history for updates. An email as a notification will be sent.

img
Unable to find what you’re looking for?

Consult our trusted tutors.

Developed by Versioning Solutions.