COMP 2108 Challenges Page
Applied Cryptography, Fall 2023
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.
- Location: see Brightspace
- Monday: 11:35 AM - 12:55 PM
- Wednesday: 11:35 AM - 12:55 PM
Instructor: David Barrera | firstname.lastname@example.org
Teaching Assistants (TAs):
- Srivathsan Morkonda | email@example.com
- Huzaifa Patel | firstname.lastname@example.org
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 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.
- Ensure you're on the
COMP2108A-F23project at the top-left of the screen via the drop-down.
- Open the
Computemenu on the left side of the screen.
- Select the
Launch Instancetowards the right side of the screen (to the right of the search box).
- 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 Sourcedrop-down, select
Instance Snapshot. Select
- Flavour: Select the up-arrow next to the flavour called:
- Security Groups: Add the
- Click the blue
- Find your newly-created instance in the list. On the far right, click the down-arrow next to
Create Snapshotand select
Associate Floating IP.
- Under the
IP Addressdrop-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.
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:
- Add the
ping-ssh-egresssecurity group to your VM instance.
- 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.
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.
- Install VS Code (If you haven't already)
- Open VS Code
- Bring up the Extensions view by pressing Ctrl+Shift+X on Windows or Command+Shift+X on MacOS.
- Install the Remote-SSH VS Code extension.
- 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:
- By clicking on it, a Remote-SSH prompt will appear (as shown below).
- Click on "Connect to Host"
- Click on "Configure SSH Hosts"
- Open the first Config file path.
The path to the ssh config file is dependent on the OS you are on.
- Paste the following code into the config file.
Host access.scs.carleton.ca HostName access.scs.carleton.ca User SCS_USERNAME Host FLOATING_IP_ADDRESS HostName FLOATING_IP_ADDRESS User student ProxyJump access.scs.carleton.ca
- From the config code snippet above, replace
FLOATING_IP_ADDRESSwith the floating IP address you chose after creating your VM
SCS_USERNAMEwith your SCS username
- 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.
- You will be prompted to enter your SCS password first. Followed by the VM password (set after your first login).
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 (
my_archive.tar.gz by collecting/compressing the contents of the directory
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
man scp or visit this page for more information.
Every challenge will be required to be submitted as a Gzipped Tarball. Please review the information above and Challenge 1 for further instructions.