COMP 2108 Challenges Page
Applied Cryptography, Fall 2023

General Course Information

Class lecture videos and slide decks will be posted weekly to Brightspace along with a quiz and (when applicable) a crypto programming challenge here. Students are expected to complete the quiz and challenge prior to the next quiz/challenge being posted (typically within 1-2 weeks).

Class time will be used to provide office hours, present additional examples, and review the solutions to the programming challenges. Mondays are reserved for reviewing theory content with the instructor, while Wednesdays will be focused on working through crypto challenges with the TAs. Attendance to these sessions is not mandatory, but encouraged.

Class time:

  • Location: see Brightspace
  • Times:
    • Monday: 11:35 AM - 12:55 PM
    • Wednesday: 11:35 AM - 12:55 PM

Contact Information

Instructor: David Barrera |

Teaching Assistants (TAs):

  • Srivathsan Morkonda |
  • Huzaifa Patel |

Challenge Environment

Course challenges will require basic use of the Linux command line. Many good tutorials and cheat sheets exist that can help you review this material. All course challenges will be written in Python and to help guide you, a challenge template will be provided for each challenge.

Challenge 1 serves to introduce you to this environment. Before you submit any challenge, make sure to review and carefully follow the instructions therein.


Challenges will be done in Linux virtual machines. Each student will need an account on the SCS OpenStack platform, which is accessible only while on campus or via the Carleton VPN. Instructions for creating an account and using OpenStack are available on the SCS OpenStack Support website. The username and password for the course VM images are student and student respectively. You will be asked to choose a new password upon your first login.

To access the VM image used for all challenges on OpenStack, switch to the COMP2108A-F23 project through the drop-down menu at the top of the page. If you are unable to see COMP2108A-F23 in your projects list, please use the SCS Online Account Management tool to update your account.

Creating a Virtual Machine

  1. Ensure you're on the COMP2108A-F23 project at the top-left of the screen via the drop-down.
  2. Open the Compute menu on the left side of the screen.
  3. Select the Instances item.
  4. Click Launch Instance towards the right side of the screen (to the right of the search box).
  5. In the Launch Instance pop-up window:
  • Details: Enter an instance name (Note: please make it [First-Initial][Last-Name]-VM, without brackets).
  • Source: Under the Select Boot Source drop-down, select Instance Snapshot. Select ubuntu-22.04-minimal-headless.2023-08-23
  • Flavour: Select the up-arrow next to the flavour called: comp2108a-f23.2gram.10gdisk.2cpu
  • Security Groups: Add the ping-ssh-egress.
  1. Click the blue Launch Instance button.
  2. Find your newly-created instance in the list. On the far right, click the down-arrow next to Create Snapshot and select Associate Floating IP.
  3. Under the IP Address drop-down, select an IP address and click the blue Associate button.


When naming your VM, please include your name in the instance name (e.g., [First-Initial][Last-Name]-VM, without brackets). This makes it significantly easier for us to determine who owns each VM and get into contact with you should the need arise. We can't enforce this, but your cooperation is much appreciated.

Connecting to your VM (Option 1 - SSH Client)

The SCS OpenStack How-To document, available on the SCS OpenStack support website, provides all the necessary steps to enable SSH access to your VM. In summary, from your VM's Instance Overview page, use the drop-down menu to complete the following actions:

  1. Add the ping-ssh-egress security group to your VM instance.
  2. Associate a floating IP address with your VM instance on OpenStack.

On Mac or Linux, the standard SSH client is likely your best option for connecting to your VM. On Windows, there are a number of clients to choose from, such as PuTTY. You are welcome to setup passwordless SSH with key pairs after your first connection. Additionally, you may use the SCS External Access Host to avoid having to connect via the VPN every time.

Connecting to your VM (Option 2 - VS Code Remote-SSH)

If you prefer to use VS Code UI for writing code on your VM, setup VS Code Remote-SSH using the following instructions.


Before setting up VS Code Remote-SSH, you will first need to login to your VM using SSH to change the default password of your VM.

  1. Install VS Code (If you haven't already)
  2. Open VS Code
  3. Bring up the Extensions view by pressing Ctrl+Shift+X on Windows or Command+Shift+X on MacOS.
  4. Install the Remote-SSH VS Code extension.
  5. After successfully installing it, you will find a green icon appear on the bottom left of your VS Code window (as shown below). It may not be green on your version of VS Code, but do click on the icon that closly resembles the one below:

Remote-SSH Icon

  1. By clicking on it, a Remote-SSH prompt will appear (as shown below).

Remote-SSH Prompt

  1. Click on "Connect to Host"
  2. Click on "Configure SSH Hosts"
  3. Open the first Config file path.


The path to the ssh config file is dependent on the OS you are on.

Windows: C:\Users\PC_USER_NAME\.ssh\config

Linux: /home/PC_USER_NAME/.ssh/config

  1. Paste the following code into the config file.

  User student
  1. From the config code snippet above, replace
    - FLOATING_IP_ADDRESS with the floating IP address you chose after creating your VM
    - SCS_USERNAME with your SCS username
  2. Now, bring up the SSH Remote-SSH prompt up again (from step 6), and click on "Connect to Host", followed by your floating IP address.
  3. You will be prompted to enter your SCS password first. Followed by the VM password (set after your first login).

Copying files to/from your VM

You may use SCP to transfer files between your VM and your local machine. SCP runs over SSH, so you should configure your VM to allow SSH traffic, as described above.

If you are going to be transferring more than one file off your VM you want to consider creating a compressed archive of the files on the VM, and then copying the archive to your local machine. The Linux format of choice is a Gzipped Tarball: tar collects a bunch of files into one, and gzip compresses the collected file to produce a tar.gz file. You can do this all in one step with:

 tar -cvzf my_archive.tar.gz directory_name

This will create (-c) a gzipped (-z) archive file (-f) named my_archive.tar.gz by collecting/compressing the contents of the directory directory_name.

Linux or macOS

To copy a file (or recursively copy a directory, if the optional -r parameter is specified) from your VM to the current working directory on your local machine, launch a terminal, navigate to your desired directory, and run:

scp [-r] student@VM.IP.address:/some/path/source.file .

To copy a file from your local machine to your VM, run:

scp [-r] source.file student@VM.IP.address:/destination/path

Type man scp or visit this page for more information.


Install WinSCP, a GUI file transfer program that understands the SCP protocol. See the WinSCP documentation for more information.

Challenge Submissions

Every challenge will be required to be submitted as a Gzipped Tarball. Please review the information above and Challenge 1 for further instructions.