- My name: Haoyu Jin
- My email: jin511@purdue.edu
- Ubuntu 20.04 x86_64 GNU/Linux
- gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0
- GNU Make 4.2.1
- libgcrypt20
# working dir: SCP/
make# working dir: SCP/
make cleanpurenc <input file> [-d <output IP-addr:port>] [-l]purdec [port] [-l <input file>]# 127.0.0.1
cp data data.cpy
purenc data.cpy -l
rm data.cpy
purdec -l data.cpy.pur
diff data data.cpypurenc data -d 192.168.3.5:7777purdec 7777- This script along with files under
datadirectory helps you check the correctness and functionality for the local run - And you can directly run this script right after you download this repo to your machine and cd into it, instead of compiling first (running
make). - one parameter is needed, which is the file name (choose one from
data/)need_padis a file with 1027 bytes, which is helpful for checking the paddingan_executableis a historical verision of a binary (purenc/purdec)randomis a file of random byte sequence, and with size around10M, which aims to show the robustness of the program- All the above files are also passed for the remote tests, using two remote machines
bash ./autotest_local.sh random- see directory
src/, along withMakefile
- I build the TCP socket for the network programming
- I build the key from password
- I encrypt the data, and then add a hash suffix before sending it to the network
- on the receiver side, symmetrical actions are taken.
- I support the multithreading version of receiver, and more public-key based certification process on another branch
real. (not required in this assignment)
- Here I only explain the main content about each source file, please check the comment in source files to get the detail of each function
dec.c: main routine of receiverenc.c: main routine of sendernetwork.c: my wrapper for building and using the socketcrypto.c: functions used for crypto purpose, building on<gcrypt.h>util.c: extension fordec.candenc.c
- see the source codes for comments
- Design Decision:
- for both local and remote mode, the
encshould encrypt and append a hash before sending msg chunk, thedecshould checking the hash and decrypt after receiving msg chunk.
- for both local and remote mode, the
- I need a salt string
- It's used to protect the key, since directly mapping password to key may suffer a type of attack which uses brute force to sampling the mapping function.
- The salt is like a user-specific characteristic.
- In this project, the salt just stays constant through both sides, for the simplicity.
- 3 days, be stopped by a misfortune (delete the source code unconciously) for 1 day and more..
- workload is similar to lab2 (MiniVPN)
- see branch
realto see my progress on developing this project into more real-world-like senario.