#!/bin/bash

cd 1520_lab3_jrmuraka

rm ecb.bmp
rm cbc.bmp
rm ecb.bin
rm cbc.bin



head -c 54 iu.bmp > cbc.bmp
head -c 54 iu.bmp > ecb.bmp


openssl enc -aes-128-cbc -e -in iu.bmp -out cbc.bin -k jacks
openssl enc -aes-128-ecb -e -in iu.bmp -out ecb.bin -k jacks


tail -c 3858000 cbc.bin >> cbc.bmp
tail -c 3858000 ecb.bin >> ecb.bmp

echo Lindley_026Lab | sudo -S mv ecb.bmp /var/www/html/ecb.bmp
echo Lindley_026Lab | sudo -S mv cbc.bmp /var/www/html/cbc.bmp


