-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfinal-project.sh
executable file
·76 lines (63 loc) · 1.76 KB
/
final-project.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#!/bin/bash
echo
echo "Script to run CS457 Final Project: Needham-Schroeder Protocol"
echo "By: Adam Slattum"
echo
rm -f dispatcher kdc/kdc kdc/logKDC.txt amal/amal amal/logAmal.txt basim/basim basim/logBasim.txt basim/bunny.mp4
rm -f kdc/amal_key.iv kdc/amal_iv.bin kdc/basim_key.bin kdc/basim_iv.bin
echo "=============================="
echo "Compiling all source"
gcc amal/amal.c myCrypto.c -o amal/amal -lcrypto
gcc basim/basim.c myCrypto.c -o basim/basim -lcrypto
gcc kdc/kdc.c myCrypto.c -o kdc/kdc -lcrypto
gcc genKey.c -o genKey -lcrypto
gcc wrappers.c dispatcher.c -o dispatcher
echo "=============================="
echo "Generating Amal and Basim Keys"
./genKey
echo
echo "Amal's Key Material:"
hexdump -C kdc/amal_key.bin
echo "Amal's IV Material:"
hexdump -C kdc/amal_iv.bin
echo
echo "Basim's Key Material:"
hexdump -C kdc/basim_key.bin
echo "Basim's IV Material:"
hexdump -C kdc/basim_iv.bin
echo
echo "=============================="
echo "Sharing keys from KDC to Amal"
cd amal
rm -f amal_key.bin amal_iv.bin
ln -s ../kdc/amal_key.bin amal_key.bin
ln -s ../kdc/amal_iv.bin amal_iv.bin
cd ..
echo "=============================="
echo "Sharing keys from KDC to Basim"
cd basim
rm -f basim_key.bin basim_iv.bin
ln -s ../kdc/basim_key.bin basim_key.bin
ln -s ../kdc/basim_iv.bin basim_iv.bin
cd ..
echo "=============================="
echo "Starting the dispatcher"
./dispatcher
echo
echo
echo "====== KDC's LOG ========="
cat kdc/logKDC.txt
echo
echo
echo "====== Amal's LOG ========="
cat amal/logAmal.txt
echo
echo
echo "====== Basim's LOG ========="
cat basim/logBasim.txt
echo
echo
echo "====== Verifying file transmission ========="
echo
diff -s amal/bunny.mp4 basim/bunny.mp4
echo