These are chat archives for ellisonbg/phys202-2015

11th
Apr 2015
brettavedisian
@brettavedisian
Apr 11 2015 01:10
If anyone is stuck and needs help on Problem 59, post questions here
My trouble figuring out how to create the simple encode and decode function
Noah Sutton-Smolin
@telthien
Apr 11 2015 03:11
@brettavedisian I can help if you'd like. What have you tried so far/what are your thoughts?
Noah Jan Miller
@millernj
Apr 11 2015 03:11
I made one that doesn't have any errors but it creates a <generator object at 0x7f52f2266750>
Noah Sutton-Smolin
@telthien
Apr 11 2015 03:15
@millernj you can call list(gen) on a generator
Noah Jan Miller
@millernj
Apr 11 2015 03:15
Oh?
Now I get an error. Perfect XD
Noah Sutton-Smolin
@telthien
Apr 11 2015 03:19
ehehe, it happens : P
brettavedisian
@brettavedisian
Apr 11 2015 03:22
I'm not on my computer right now but I have a piece of code that takes the text of the file, converts the numbers to their respective ASCII characters and prints them. I've thought about using a for loop to go through the list and find lowercase letters and filter them
Noah Sutton-Smolin
@telthien
Apr 11 2015 03:27
Alright! Is the list still encrypted?
brettavedisian
@brettavedisian
Apr 11 2015 03:31
Uh, I think so. It is just a bunch of characters in a list. I don't know how to decrypt the list
Noah Sutton-Smolin
@telthien
Apr 11 2015 03:54
@brettavedisan Hm, maybe reread the question? Is what it's asking you to do clear?
brettavedisian
@brettavedisian
Apr 11 2015 04:06
Honestly, I think I understand what it's asking, I just don't know how implement it
Brian E. Granger
@ellisonbg
Apr 11 2015 04:12
What have you tried?
brettavedisian
@brettavedisian
Apr 11 2015 04:18
A for loop that tries to look through the list of characters for lower case letters, as stated above. After that, I'm just at a loss of how to proceed
Noah Sutton-Smolin
@telthien
Apr 11 2015 04:32
Hm, well, why do you want to search the encrypted text for lowercase letters?
brettavedisian
@brettavedisian
Apr 11 2015 04:33
The question states the key is lowercase
Noah Sutton-Smolin
@telthien
Apr 11 2015 04:34
Ahh, I see!
The key is different than the encrypted text - it's not actually in the text at all.
The key is three characters that you need to determine. Then, you can apply that key to the text.
brettavedisian
@brettavedisian
Apr 11 2015 04:41
Oh... Okay. Do I need to use the XOR operator on the characters to determine the key?
Noah Sutton-Smolin
@telthien
Apr 11 2015 04:46
Mm, check the problem description. [unencrypted character] XOR [character from key] = [encrypted character], and [encrypted character] XOR [key character] = [unencrypted character]
Here's something to get you started, which is a simplification of the problem.
[24, 53, 60, 60, 63] is the string "Hello" that has been encrypted with a single character: P
brettavedisian
@brettavedisian
Apr 11 2015 04:49
Okay thank you. I'll look at the problem when I get to my computer tomorrow
Noah Sutton-Smolin
@telthien
Apr 11 2015 04:49
Sure, sounds good!
Patrick Steffanic
@CalPolyPat
Apr 11 2015 10:37
@millernj the 0x75blahblahblah is ascii character 127, or the delete character
SJSlavin
@SJSlavin
Apr 11 2015 22:45
I think I managed to create a function that uses the key to decrypt the file, but i'm stumped as to how to get Python to recognize which key is the right answer by whether the output makes sense. Do I have to import a dictionary to identify english words? Maybe check for regular use of spaces, or how common the vowels are?
Noah Jan Miller
@millernj
Apr 11 2015 22:47
It's a pretty long message, so I'm probably going to have a code search for the word " the " with multiple keys combinations on the assumption that " the " won't appear randomly with the wrong keys.
SJSlavin
@SJSlavin
Apr 11 2015 22:50
That sounds like a good idea, i'll try something like that
SJSlavin
@SJSlavin
Apr 11 2015 23:20
I'm going to start by checking for a reasonable amount of spaces, then if that ends up with too many results, I'll look for common words
Noah Sutton-Smolin
@telthien
Apr 11 2015 23:58
That's what I did, and it works well. You also might try excluding characters you think won't be in the text.