Getting Started
===============
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):
* ``hive{1-32}.cs.berkeley.edu`` (330 Soda)
* ``s271-{1-35}.cs.berkeley.edu`` (271 Soda)
* ``s273-{1-34}.cs.berkeley.edu`` (273 Soda)
* ``s275-{1-34}.cs.berkeley.edu`` (275 Soda)
* ``s277-{1-30}.cs.berkeley.edu`` (277 Soda)
Note that ``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
``python3 --version``.
An example workflow for developing on your personal machine is as follows:
* Copy the framework code into a folder named ``project2``.
* Sync changes to your class account using ``scp``:
``scp -r project2/ cs161-xx@hiveXX.cs.berkeley.edu:~/project2``
This will copy the ``project2`` folder and its contents to your home directory.
* SSH into a Hive machine with your class account.
* Do all Python console work using ``python3`` or ``ipython3`` in your SSH session.
* Run all Python code using python3, e.g. ``python3 client.py``.
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.
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 :mod:`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 ``StorageServer`` and
``PublicKeyServer`` implementations.
* ``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.
* ``run_part3_tests.py``, a Python script to run the provided tests for
Part 3.