Projects

Hints and Details for SkyNet Part 1

Diffie-Hellman

You'll primarily be using RFC 2631 and RFC 3526 to implement Diffie-Hellman (DH).
The PyCrypto library does not contain an implementation of DH itself, so you'll be implementing it.
Two additional hints to assist you.

First, A = g**a % p is slow in most languages as it calculates g**a and then performs the modulus calculation.
Instead, use A = pow(g, a, p) which speeds up the process by performing modular exponentiation.

Second, bytes(shared_secret, "ascii") should be bytes(str(shared_secret), "ascii"), bytes(hex(shared_secret), "ascii") or similar as the bytes function can't handle coversion directly from large integers to bytes.

Cyphers and HMACs

For improving the cypher and ensuring the messages aren't vulnerable to tampering or replay attacks, you'll be using the PyCrypto library.
Refer to the PyCrypto API guide for guidance on using and justifying the use of these tools.

Code Submission

So that code submission is done sensibly, we will be using git and phabricator to submit code.
This platform will be used to both submit and review code, and is good practice for being in industry.

Please see this document for a run-down on how git and phabricator will be used for this project.