CSCI3383 Cryptography

Assignment 0 : Install Python

Assigned: January 17, 2017
Due: Thursday, January 19, 2017 at 11:59PM.


This assignment is due right away, but there is not that much to hand in.  However, you need to follow the submission instructions precisely.  That means creating the file and folder that you submit at the end in exactly the specified format, with the specified names.  I am not requesting this simply because I am a fussy person (I'm not, really.)  However, in order to make the grading of assignments as smooth as possible, I want to be able to automate some of the busywork of downloading, and extracting, and displaying your work, and this requires a uniform format.

If you already have Python and IDLE installed on your computer, you do not need to complete step 1.  If you have a Mac, then Python already is installed, and you can use it as is, but you might find it easier to do an installation that includes the interactive development environment IDLE, which is what you will see me demonstrating in class.

We will use Python 2.7 in this course.  (The latest version of Python is Python 3, but Python 2.7 and Python 3 are not compatible. Python 2.7 is still in very wide use, and will be around for another four years or so.)

1. Install Python

Install Python 2.7 from the appropriate link on this page.  The installation is very simple; just click on the link corresponding to your computer's operating system, and then follow the instructions. (For Windows and Mac, you have a choice between a 32-bit version and a 64-bit version.  You probably want to select the 64-bit version, but if any part of this installation does not work, you can drop back to 32 bits.)

2. Use Python to decode a message, and test your installation.

Make a folder  in which you will store all your work.

Download the file conversions.py from the course website and save it to your course folder.

Open the file conversions.py from the File menu in IDLE, and select Run Module from the Run menu.  Then at the prompt in the Python Shell window, type

import conversions
conversions.as_to_hex('xyz')

You should see

'78797a'

appear.  This is the hexadecimal encoding of the three-byte representation of the ASCII string 'xyz'.  If you followed the directions and everything went smoothly, you've completed the installation.  There is one more thing to do to complete the assignment.

3. Decode a base-64 message, and send a hex response.

Here is a personal welcome message from me to you.  I've encoded it in base 64 so you will have to use the conversion tools to decode it. (You do not have to understand how base64 encoding works to do this assignment, but it's worth knowing about.) And please, just copy and paste this line of text, don't try to type it all!

V2VsY29tZSB0byBDU0NJMzM4MS4gV3JpdGUgYmFjayB0byBtZS0taW5jbHVkZSB5b3VyIG5hbWUsIHllYXIgaW4gc2Nob29sLCBhbmQgbWFqb3IgaW4geW91ciByZXBseS4=

Type a response to this message, and encode your response as a sequence of hex digits.

4. Submit your result

Prepare a text file (.txt) containing two lines of text.  The first line will be the ordinary ASCII representation of my welcome message.  The second line will be the sequence of hex digits encoding your answer.  You can use Notepad on Windows for this, TextPad on a Mac, or Microsoft Word, but make sure you save your result in plain text format.  Your file should be called xxxHW0.txt, where xxx is your first initial followed by your last name.  For example, if I were a student in the course, I would call my file HStraubingHW0.txt.

Place the file in a folder named xxxHW0 and compress the folder to produce a .zip file, then submit it through Canvas.  (What, you might ask, is the point of even creating a folder, much less compressing it, when the entire assignment consists of one tiny text file?  This is the way you will hand in all your homework assignments, so I want you to get used to the process.)