CMPS-2240 Lab-10
C and x86 (decrypt a text message)

Gordon Griesel
Department of Computer and Electrical Engineering and Computer Science
California State University, Bakersfield

Introduction

Goals:
• Write an x86 assembly program called from a C program.
• Use x86 assembly to decrypt a secret text message.

Do your work in your Odin /2240/a directory.

Lab source files

Path to files is here:
/home/fac/gordon/public_html/2240/code/lab10/ 

Copy all the sample files to your 2240/a folder please.

Assignment

Modify the lab10.s program to decrypt an encrypted text message.

The encrypted message is contained in a file named: file10
The message was encrypted with the following cypher...

Each character (byte) of the message had its bits rearranged using
a bit-rolling instruction. Bits were rolled 2 to the left.

Your C program calls an x86 decrypt function, but it is not written yet.

Your job is to write the decrypt function.

Extra

After decrypting the file10, why not try the file10x.

The x is for extra credit.

Decrypt this message for extra credit points on this lab.
Extra credit requires you to work without letting the enemy see how
you are doing the decryption.

Secret added encryption cypher...
Just before rolling the byte 2-bits-left, bits number 1 and 6
were swapped. (The least significant bit is bit 0.)

If the enemy spots your secret x86 source code, quickly reach
over and unplug their computer. These secret messages must be
kept ultra safe and confidential. Your country thanks you.

All agents decrypting this message receive extra lab points.

These files will be collected...

/2240/a/lab10.c
/2240/a/lab10.s
/2240/a/file10.txt
/2240/a/file10x.txt
/2240/a/Makefile