Key Exchange Implementation

Spring 2019

The questions below are due on Sunday April 07, 2019; 11:59:00 PM.
You are not logged in.

If you are a current student, please Log In for full access to the web site.
Note that this link will take you to an external site ( to authenticate, and then you will be redirected back to this page.

1) Overview

This Design Exercise involves the actual implementation of an asymmetric cryptography system based on Diffie-Helman. The math/work you did on the key exchange problem of this weeks Exercises.

The order of processes will need to be as follows:

  1. Microcontroller initiates unencrypted contact with server to get p and m values (generated/hardcoded by server code...your choice)
  2. Server responds with p and m values as well as with its t_{server} value (of the same type as those t_1 and t_2 values )
  3. Microcontroller uses the response from server to generate a key as well as generate its own t_{mcu} value.
  4. Microcontroller encrypts its message/request to the server using key and then sends back to the server its encrypted request along with its t_{mcu} value.
  5. Server code receives both encrypted query and t_{mcu} value. Uses t_{mcu} to generate the shared key and uses that key to decrypt the query. It does what the query asks for, generates a response, encrypts it, and sends it back to the microcontroller.
  6. The microcontroller decrypts the response and displays it.
  7. The system should then repeat as needed.

What exactly you request/encrypt is up to you in this assignment. Some suggestions might be number facts (maybe you don't want anyone knowing what numbers you're interested in), a wikipedia query, or something else. You do not need to go crazy with that part, and you're free to build on an already existing service/application we've developed. However, you must use Diffie-Helman for your key exchange, and Vigenere cipher of length 6 or greater for your encryption scheme for your query/response transfer. In your submission, make sure you clearly explain to the grading staff what is going on in terms of encryption scheme, what is being requested/responded with, etc... These specifications are for a "toy" example...if you'd like to go more in-depth with a more complex example, by all means please feel free.

This is going to possibly involve a state machine on both sides of the communication. If we remember, our server code is run in a stateless form (no persistent connections), so you may need a way to store information in a database (depending on how you approach this problem) for it to remember what state it currently is in. If you need a database, we'd recommend the following format:

  • time - auto-generated timestamp of when that record is submitted
  • user_id - Text
  • value1 - A field you can store numbers in
  • value2 - A field you can store numbers in

This isn't how asymetric key-exchange is actually implemented in real-life, but it fits within the confines of our 6.08 sandbox for right now.

Upload a video of your system working including full as well as all of your code and any necessary comments below.

Any late factors are based on the timestamp for the last time that the URL is entered on the page or when the code is uploaded or when a comment is added/changed. If you change your URL after the deadline you will incur a late penalty. If you upload code after the deadline, you will incur a late penalty. If you comment after the deadline, you will incur a late penalty. One-Week Extensions DO NOT APPLY Design Exercises.

You must upload ALL CODE that you used in your design in one compressed folder This includes both server-side and embedded side. IN ONE COMPRESSED FOLDER. The system only takes the most recent upload, so if you upload a server file and then your embedded file, that will cause issues. Failure to upload code will result in signifcant point loss. This includes if you just forgot. Screenshots of your file's last modified date in My Computer are not evidence that the file has not been changed. They must be uploaded.

Problem Status:
A Python Error Occurred:

Error on line 2 of python tag (line 48 of file /S19/ex08/keimplement):
    kerberos = cs_user_info['username']

KeyError: 'username'

Enter the url for the video


 No file selected

Enter any comments you may want us to know about. For example, if you started this exercise but don't want it graded, make a note here. Please hit submit on this question even if you don't have any comments.

Back to Exercise 08

This page was last updated on Sunday April 14, 2019 at 09:55:32 AM (revision 3932c33).
Course Site powered by CAT-SOOP 14.0.4.dev5.
CAT-SOOP is free/libre software, available under the terms
of the GNU Affero General Public License, version 3.
(Download Source Code)
CSS/stryling from the Outboxcraft library Beauter, licensed under MIT
Copyright 2017