For this project, you can work in teams of up to 2 people. We want you to actively get your hands dirty designing and implementing your system.
You should strive to write clean, secure code. Follow general Python best practices. One of us particularly likes the Hitchhiker’s Guide to Python, which has a good section on Python Style. Another good resource is the CS61a Style Guide.
You must use Python 3 and PyCrypto 2.6.1 for this project. These are already provided for you on all the following instructional machines (and possibly others):
python defaults to Python2 on most machines, including Hive.
You can invoke Python3 using the
python3 command. If you aren’t sure what
version of Python you have, check the output of
python --version and
An example workflow for developing on your personal machine is as follows:
Copy the framework code into a folder named
Sync changes to your class account using
scp -r project2/ cs161-xx@hiveXX.cs.berkeley.edu:~/project2
This will copy the
project2folder and its contents to your home directory.
SSH into a Hive machine with your class account.
Do all Python console work using
ipython3in your SSH session.
Run all Python code using python3, e.g.
You can also do all of this while seated at a machine in the instructional labs, or inside an SSH session using vim or emacs (the course staff designing this project have differing opinions in the editor wars....).
While not officially supported by course staff, it is also possible to set up Python3 and install PyCrypto on your own machine. One easy way to do this is to use the Anaconda Python distribution for your platform (choosing the Python 3.5 version). This will include the PyCrypto package.
This should be compatible with the instructional machines’ setup, but you should double check your code by re-running the functionality tests against your code on Hive. Remember to follow all of the steps in the submission instructions for each part of this project!
The provided framework code includes:
client.py, where you will write your Client implementation. Put all of your code in this file.
base_client.py, containing the base class you will base your client on.
insecure_client.py, containing a baseline implementation which is functionally correct, but does not have any security built-in. It is described in the documentation for
insecure_client. It is very simple (at only 50 lines).
crypto.py, containing the provided cryptographic API you must use. Your client will be passed a Crypto object which you will use to access this API.
servers.py, containing the
util.py, containing potentially useful utility functions.
run_part1_tests.py, a Python script to run the provided tests for Part 1.
run_part2_tests.py, a Python script to run the provided tests for Part 2.