{"action":"created","comment":{"url":"https://api.github.com/repos/stanfordpython/assign1-submissions-spr1617/pulls/comments/114936906","pull_request_review_id":36439887,"id":114936906,"diff_hunk":"@@ -0,0 +1,339 @@\n+#!/usr/bin/env python3 -tt\n+\"\"\"\n+File: crypto.py\n+---------------\n+Assignment 1: Cryptography\n+Course: CS 41\n+Name: Xinlan Emily Hu\n+SUNet: xehu\n+\n+Implements the Crypto Suite assignment for CS41.\n+\n+\"\"\"\n+import utils\n+import random\n+\n+# Caesar Cipher\n+\n+def encrypt_caesar(plaintext):\n+    \"\"\"Encrypt plaintext using a Caesar cipher.\"\"\"\n+    encrypted_word = []\n+    for letter in plaintext:\n+\n+        num = ord(letter)\n+        if(num >= 65 and num <= 90):\n+            num = 65+((num+3)%65)%26\n+        elif(num >=97 and num <= 122):\n+            num = 97+((num+3)%97)%26\n+    \n+        newChar = chr(num)\n+        encrypted_word.append(newChar)\n+\n+    return ''.join(encrypted_word)\n+\n+    \n+def decrypt_caesar(ciphertext):\n+    \"\"\"Decrypt a ciphertext using a Caesar cipher.\"\"\"\n+    decrypted_word = []\n+\n+    for letter in ciphertext:\n+\n+        num = ord(letter)\n+        #wraps forward\n+        if(num >= 65 and num <= 90):\n+            if num - 3 >= 65:\n+                num = 65+((num-3)%65)%26\n+            elif num - 3 < 65:\n+                diff = num-64\n+                key = 3-diff\n+                num = 90-key\n+\n+        #wraps backwards\n+        elif(num >= 97 and num <= 122):\n+            if num - 3 >= 97:\n+                num = 97+((num-3)%97)%26\n+            elif num - 3 < 97:\n+                diff = num-96\n+                key = 3-diff\n+                print(key)\n+                num = 122-key\n+\n+        newChar = chr(num)\n+        decrypted_word.append(newChar)\n+\n+    return ''.join(decrypted_word)\n+\n+\n+# Vigenere Cipher\n+\n+def encrypt_vigenere(plaintext, keyword):","path":"crypto.py","position":69,"original_position":69,"commit_id":"f7544e0779db9145516d05469765d233860a06e0","original_commit_id":"f7544e0779db9145516d05469765d233860a06e0","user":{"login":"14meenac","id":13427202,"avatar_url":"https://avatars1.githubusercontent.com/u/13427202?v=3","gravatar_id":"","url":"https://api.github.com/users/14meenac","html_url":"https://github.com/14meenac","followers_url":"https://api.github.com/users/14meenac/followers","following_url":"https://api.github.com/users/14meenac/following{/other_user}","gists_url":"https://api.github.com/users/14meenac/gists{/gist_id}","starred_url":"https://api.github.com/users/14meenac/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/14meenac/subscriptions","organizations_url":"https://api.github.com/users/14meenac/orgs","repos_url":"https://api.github.com/users/14meenac/repos","events_url":"https://api.github.com/users/14meenac/events{/privacy}","received_events_url":"https://api.github.com/users/14meenac/received_events","type":"User","site_admin":false},"body":"try using list comprehensions, python methods like zip, and lambdas to shorten this code","created_at":"2017-05-05T06:19:45Z","updated_at":"2017-05-05T06:19:45Z","html_url":"https://github.com/stanfordpython/assign1-submissions-spr1617/pull/16#discussion_r114936906","pull_request_url":"https://api.github.com/repos/stanfordpython/assign1-submissions-spr1617/pulls/16","_links":{"self":{"href":"https://api.github.com/repos/stanfordpython/assign1-submissions-spr1617/pulls/comments/114936906"},"html":{"href":"https://github.com/stanfordpython/assign1-submissions-spr1617/pull/16#discussion_r114936906"},"pull_request":{"href":"https://api.github.com/repos/stanfordpython/assign1-submissions-spr1617/pulls/16"}}},"pull_request":{"url":"https://api.github.com/repos/stanfordpython/assign1-submissions-spr1617/pulls/16","id":119113088,"html_url":"https://github.com/stanfordpython/assign1-submissions-spr1617/pull/16","diff_url":"https://github.com/stanfordpython/assign1-submissions-spr1617/pull/16.diff","patch_url":"https://github.com/stanfordpython/assign1-submissions-spr1617/pull/16.patch","issue_url":"https://api.github.com/repos/stanfordpython/assign1-submissions-spr1617/issues/16","number":16,"state":"open","locked":false,"title":"Assignment 1 submission for xehu-1","user":{"login":"14meenac","id":13427202,"avatar_url":"https://avatars1.githubusercontent.com/u/13427202?v=3","gravatar_id":"","url":"https://api.github.com/users/14meenac","html_url":"https://github.com/14meenac","followers_url":"https://api.github.com/users/14meenac/followers","following_url":"https://api.github.com/users/14meenac/following{/other_user}","gists_url":"https://api.github.com/users/14meenac/gists{/gist_id}","starred_url":"https://api.github.com/users/14meenac/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/14meenac/subscriptions","organizations_url":"https://api.github.com/users/14meenac/orgs","repos_url":"https://api.github.com/users/14meenac/repos","events_url":"https://api.github.com/users/14meenac/events{/privacy}","received_events_url":"https://api.github.com/users/14meenac/received_events","type":"User","site_admin":false},"body":"","created_at":"2017-05-05T05:52:21Z","updated_at":"2017-05-05T06:19:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/stanfordpython/assign1-submissions-spr1617/pulls/16/commits","review_comments_url":"https://api.github.com/repos/stanfordpython/assign1-submissions-spr1617/pulls/16/comments","review_comment_url":"https://api.github.com/repos/stanfordpython/assign1-submissions-spr1617/pulls/comments{/number}","comments_url":"https://api.github.com/repos/stanfordpython/assign1-submissions-spr1617/issues/16/comments","statuses_url":"https://api.github.com/repos/stanfordpython/assign1-submissions-spr1617/statuses/f7544e0779db9145516d05469765d233860a06e0","head":{"label":"stanfordpython:xehu-1","ref":"xehu-1","sha":"f7544e0779db9145516d05469765d233860a06e0","user":{"login":"stanfordpython","id":13142353,"avatar_url":"https://avatars0.githubusercontent.com/u/13142353?v=3","gravatar_id":"","url":"https://api.github.com/users/stanfordpython","html_url":"https://github.com/stanfordpython","followers_url":"https://api.github.com/users/stanfordpython/followers","following_url":"https://api.github.com/users/stanfordpython/following{/other_user}","gists_url":"https://api.github.com/users/stanfordpython/gists{/gist_id}","starred_url":"https://api.github.com/users/stanfordpython/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stanfordpython/subscriptions","organizations_url":"https://api.github.com/users/stanfordpython/orgs","repos_url":"https://api.github.com/users/stanfordpython/repos","events_url":"https://api.github.com/users/stanfordpython/events{/privacy}","received_events_url":"https://api.github.com/users/stanfordpython/received_events","type":"Organization","site_admin":false},"repo":{"id":90310071,"name":"assign1-submissions-spr1617","full_name":"stanfordpython/assign1-submissions-spr1617","owner":{"login":"stanfordpython","id":13142353,"avatar_url":"https://avatars0.githubusercontent.com/u/13142353?v=3","gravatar_id":"","url":"https://api.github.com/users/stanfordpython","html_url":"https://github.com/stanfordpython","followers_url":"https://api.github.com/users/stanfordpython/followers","following_url":"https://api.github.com/users/stanfordpython/following{/other_user}","gists_url":"https://api.github.com/users/stanfordpython/gists{/gist_id}","starred_url":"https://api.github.com/users/stanfordpython/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stanfordpython/subscriptions","organizations_url":"https://api.github.com/users/stanfordpython/orgs","repos_url":"https://api.github.com/users/stanfordpython/repos","events_url":"https://api.github.com/users/stanfordpython/events{/privacy}","received_events_url":"https://api.github.com/users/stanfordpython/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/stanfordpython/assign1-submissions-spr1617","description":"Submissions for Assignment 1 for CS41 – Spring 2017","fork":false,"url":"https://api.github.com/repos/stanfordpython/assign1-submissions-spr1617","forks_url":"https://api.github.com/repos/stanfordpython/assign1-submissions-spr1617/forks","keys_url":"https://api.github.com/repos/stanfordpython/assign1-submissions-spr1617/keys{/key_id}","collaborators_url":"https://api.github.com/repos/stanfordpython/assign1-submissions-spr1617/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/stanfordpython/assign1-submissions-spr1617/teams","hooks_url":"https://api.github.com/repos/stanfordpython/assign1-submissions-spr1617/hooks","issue_events_url":"https://api.github.com/repos/stanfordpython/assign1-submissions-spr1617/issues/events{/number}","events_url":"https://api.github.com/repos/stanfordpython/assign1-submissions-spr1617/events","assignees_url":"https://api.github.com/repos/stanfordpython/assign1-submissions-spr1617/assignees{/user}","branches_url":"https://api.github.com/repos/stanfordpython/assign1-submissions-spr1617/branches{/branch}","tags_url":"https://api.github.com/repos/stanfordpython/assign1-submissions-spr1617/tags","blobs_url":"https://api.github.com/repos/stanfordpython/assign1-submissions-spr1617/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/stanfordpython/assign1-submissions-spr1617/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/stanfordpython/assign1-submissions-spr1617/git/refs{/sha}","trees_url":"https://api.github.com/repos/stanfordpython/assign1-submissions-spr1617/git/trees{/sha}","statuses_url":"https://api.github.com/repos/stanfordpython/assign1-submissions-spr1617/statuses/{sha}","languages_url":"https://api.github.com/repos/stanfordpython/assign1-submissions-spr1617/languages","stargazers_url":"https://api.github.com/repos/stanfordpython/assign1-submissions-spr1617/stargazers","contributors_url":"https://api.github.com/repos/stanfordpython/assign1-submissions-spr1617/contributors","subscribers_url":"https://api.github.com/repos/stanfordpython/assign1-submissions-spr1617/subscribers","subscription_url":"https://api.github.com/repos/stanfordpython/assign1-submissions-spr1617/subscription","commits_url":"https://api.github.com/repos/stanfordpython/assign1-submissions-spr1617/commits{/sha}","git_commits_url":"https://api.github.com/repos/stanfordpython/assign1-submissions-spr1617/git/commits{/sha}","comments_url":"https://api.github.com/repos/stanfordpython/assign1-submissions-spr1617/comments{/number}","issue_comment_url":"https://api.github.com/repos/stanfordpython/assign1-submissions-spr1617/issues/comments{/number}","contents_url":"https://api.github.com/repos/stanfordpython/assign1-submissions-spr1617/contents/{+path}","compare_url":"https://api.github.com/repos/stanfordpython/assign1-submissions-spr1617/compare/{base}...{head}","merges_url":"https://api.github.com/repos/stanfordpython/assign1-submissions-spr1617/merges","archive_url":"https://api.github.com/repos/stanfordpython/assign1-submissions-spr1617/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/stanfordpython/assign1-submissions-spr1617/downloads","issues_url":"https://api.github.com/repos/stanfordpython/assign1-submissions-spr1617/issues{/number}","pulls_url":"https://api.github.com/repos/stanfordpython/assign1-submissions-spr1617/pulls{/number}","milestones_url":"https://api.github.com/repos/stanfordpython/assign1-submissions-spr1617/milestones{/number}","notifications_url":"https://api.github.com/repos/stanfordpython/assign1-submissions-spr1617/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/stanfordpython/assign1-submissions-spr1617/labels{/name}","releases_url":"https://api.github.com/repos/stanfordpython/assign1-submissions-spr1617/releases{/id}","deployments_url":"https://api.github.com/repos/stanfordpython/assign1-submissions-spr1617/deployments","created_at":"2017-05-04T21:11:54Z","updated_at":"2017-05-05T05:11:04Z","pushed_at":"2017-05-05T06:19:11Z","git_url":"git://github.com/stanfordpython/assign1-submissions-spr1617.git","ssh_url":"git@github.com:stanfordpython/assign1-submissions-spr1617.git","clone_url":"https://github.com/stanfordpython/assign1-submissions-spr1617.git","svn_url":"https://github.com/stanfordpython/assign1-submissions-spr1617","homepage":null,"size":121,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":17,"forks":0,"open_issues":17,"watchers":0,"default_branch":"master"}},"base":{"label":"stanfordpython:master","ref":"master","sha":"ce52cee332e6c5f348a81940aed03881dc2e9877","user":{"login":"stanfordpython","id":13142353,"avatar_url":"https://avatars0.githubusercontent.com/u/13142353?v=3","gravatar_id":"","url":"https://api.github.com/users/stanfordpython","html_url":"https://github.com/stanfordpython","followers_url":"https://api.github.com/users/stanfordpython/followers","following_url":"https://api.github.com/users/stanfordpython/following{/other_user}","gists_url":"https://api.github.com/users/stanfordpython/gists{/gist_id}","starred_url":"https://api.github.com/users/stanfordpython/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stanfordpython/subscriptions","organizations_url":"https://api.github.com/users/stanfordpython/orgs","repos_url":"https://api.github.com/users/stanfordpython/repos","events_url":"https://api.github.com/users/stanfordpython/events{/privacy}","received_events_url":"https://api.github.com/users/stanfordpython/received_events","type":"Organization","site_admin":false},"repo":{"id":90310071,"name":"assign1-submissions-spr1617","full_name":"stanfordpython/assign1-submissions-spr1617","owner":{"login":"stanfordpython","id":13142353,"avatar_url":"https://avatars0.githubusercontent.com/u/13142353?v=3","gravatar_id":"","url":"https://api.github.com/users/stanfordpython","html_url":"https://github.com/stanfordpython","followers_url":"https://api.github.com/users/stanfordpython/followers","following_url":"https://api.github.com/users/stanfordpython/following{/other_user}","gists_url":"https://api.github.com/users/stanfordpython/gists{/gist_id}","starred_url":"https://api.github.com/users/stanfordpython/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stanfordpython/subscriptions","organizations_url":"https://api.github.com/users/stanfordpython/orgs","repos_url":"https://api.github.com/users/stanfordpython/repos","events_url":"https://api.github.com/users/stanfordpython/events{/privacy}","received_events_url":"https://api.github.com/users/stanfordpython/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/stanfordpython/assign1-submissions-spr1617","description":"Submissions for Assignment 1 for CS41 – Spring 2017","fork":false,"url":"https://api.github.com/repos/stanfordpython/assign1-submissions-spr1617","forks_url":"https://api.github.com/repos/stanfordpython/assign1-submissions-spr1617/forks","keys_url":"https://api.github.com/repos/stanfordpython/assign1-submissions-spr1617/keys{/key_id}","collaborators_url":"https://api.github.com/repos/stanfordpython/assign1-submissions-spr1617/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/stanfordpython/assign1-submissions-spr1617/teams","hooks_url":"https://api.github.com/repos/stanfordpython/assign1-submissions-spr1617/hooks","issue_events_url":"https://api.github.com/repos/stanfordpython/assign1-submissions-spr1617/issues/events{/number}","events_url":"https://api.github.com/repos/stanfordpython/assign1-submissions-spr1617/events","assignees_url":"https://api.github.com/repos/stanfordpython/assign1-submissions-spr1617/assignees{/user}","branches_url":"https://api.github.com/repos/stanfordpython/assign1-submissions-spr1617/branches{/branch}","tags_url":"https://api.github.com/repos/stanfordpython/assign1-submissions-spr1617/tags","blobs_url":"https://api.github.com/repos/stanfordpython/assign1-submissions-spr1617/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/stanfordpython/assign1-submissions-spr1617/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/stanfordpython/assign1-submissions-spr1617/git/refs{/sha}","trees_url":"https://api.github.com/repos/stanfordpython/assign1-submissions-spr1617/git/trees{/sha}","statuses_url":"https://api.github.com/repos/stanfordpython/assign1-submissions-spr1617/statuses/{sha}","languages_url":"https://api.github.com/repos/stanfordpython/assign1-submissions-spr1617/languages","stargazers_url":"https://api.github.com/repos/stanfordpython/assign1-submissions-spr1617/stargazers","contributors_url":"https://api.github.com/repos/stanfordpython/assign1-submissions-spr1617/contributors","subscribers_url":"https://api.github.com/repos/stanfordpython/assign1-submissions-spr1617/subscribers","subscription_url":"https://api.github.com/repos/stanfordpython/assign1-submissions-spr1617/subscription","commits_url":"https://api.github.com/repos/stanfordpython/assign1-submissions-spr1617/commits{/sha}","git_commits_url":"https://api.github.com/repos/stanfordpython/assign1-submissions-spr1617/git/commits{/sha}","comments_url":"https://api.github.com/repos/stanfordpython/assign1-submissions-spr1617/comments{/number}","issue_comment_url":"https://api.github.com/repos/stanfordpython/assign1-submissions-spr1617/issues/comments{/number}","contents_url":"https://api.github.com/repos/stanfordpython/assign1-submissions-spr1617/contents/{+path}","compare_url":"https://api.github.com/repos/stanfordpython/assign1-submissions-spr1617/compare/{base}...{head}","merges_url":"https://api.github.com/repos/stanfordpython/assign1-submissions-spr1617/merges","archive_url":"https://api.github.com/repos/stanfordpython/assign1-submissions-spr1617/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/stanfordpython/assign1-submissions-spr1617/downloads","issues_url":"https://api.github.com/repos/stanfordpython/assign1-submissions-spr1617/issues{/number}","pulls_url":"https://api.github.com/repos/stanfordpython/assign1-submissions-spr1617/pulls{/number}","milestones_url":"https://api.github.com/repos/stanfordpython/assign1-submissions-spr1617/milestones{/number}","notifications_url":"https://api.github.com/repos/stanfordpython/assign1-submissions-spr1617/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/stanfordpython/assign1-submissions-spr1617/labels{/name}","releases_url":"https://api.github.com/repos/stanfordpython/assign1-submissions-spr1617/releases{/id}","deployments_url":"https://api.github.com/repos/stanfordpython/assign1-submissions-spr1617/deployments","created_at":"2017-05-04T21:11:54Z","updated_at":"2017-05-05T05:11:04Z","pushed_at":"2017-05-05T06:19:11Z","git_url":"git://github.com/stanfordpython/assign1-submissions-spr1617.git","ssh_url":"git@github.com:stanfordpython/assign1-submissions-spr1617.git","clone_url":"https://github.com/stanfordpython/assign1-submissions-spr1617.git","svn_url":"https://github.com/stanfordpython/assign1-submissions-spr1617","homepage":null,"size":121,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":17,"forks":0,"open_issues":17,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/stanfordpython/assign1-submissions-spr1617/pulls/16"},"html":{"href":"https://github.com/stanfordpython/assign1-submissions-spr1617/pull/16"},"issue":{"href":"https://api.github.com/repos/stanfordpython/assign1-submissions-spr1617/issues/16"},"comments":{"href":"https://api.github.com/repos/stanfordpython/assign1-submissions-spr1617/issues/16/comments"},"review_comments":{"href":"https://api.github.com/repos/stanfordpython/assign1-submissions-spr1617/pulls/16/comments"},"review_comment":{"href":"https://api.github.com/repos/stanfordpython/assign1-submissions-spr1617/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/stanfordpython/assign1-submissions-spr1617/pulls/16/commits"},"statuses":{"href":"https://api.github.com/repos/stanfordpython/assign1-submissions-spr1617/statuses/f7544e0779db9145516d05469765d233860a06e0"}}}}
{"actor":{"display_login":"14meenac"}}