-
Notifications
You must be signed in to change notification settings - Fork 0
/
talk.py
117 lines (117 loc) · 3.83 KB
/
talk.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
print("Can you read this?")
import pyttsx
a = pyttsx.init()
a.say("Hello everyone. Can you hear and read this?")
a.runAndWait()
a.say("Hello everyone. Can you hear and read this?")
a.runAndWait()
a.say("Good afternoon. I am the Doctor, Mister valdez.")
a.runAndWait()
a.say("I will be giving a beginner's guide to encyption.")
a.runAndWait()
a.say("Question: What is encryption?")
a.say("Who was the one who answered earlier?")
a.runAndWait()
a.say("correct. to hide information")
a.runAndWait()
a.say("Let's imagine two people: alice and bob")
a.runAndWait()
a.say("Question: What is ASCII?")
a.runAndWait()
a.say("Correct.")
a.runAndWait()
a.say("What is the ASCII code for 'A'?")
a.runAndWait()
a.say("I also don't know")
a.say("Good thing, I have a programming language in my hands")
a.runAndWait()
print(ord("A"))
a.say("The ASCII code for A is {}".format(ord("A")))
a.runAndWait()
a.say("For the simple example, let's say Alice wants to say A to Bob")
a.runAndWait()
a.say("That is normal")
a.runAndWait()
a.say("in this example, a bad guy changed Alice's message")
a.runAndWait()
a.say("Bob is unhappy now. :(")
a.runAndWait()
a.say("Just a check. Did I get the spelling right?")
a.say("Oh well")
a.runAndWait()
a.say("I am a bad speller")
a.runAndWait()
a.say("Let's try to encrypt using a semetricalllyie encryption")
a.runAndWait()
a.say("This encryption is called the \"Caesar\" encryption")
a.runAndWait()
a.say("Question: What is a key?")
a.runAndWait()
a.say("Y'all only converted to Filipino")
a.runAndWait()
a.say("Question: What is a key?")
a.runAndWait()
a.say("Yes. it is a device or way to enter a locked door/message")
a.runAndWait()
a.say("In this example, our key is 16")
a.say("We add 16 to our message. and we give to Bob")
a.say("Bob will now decrypt the message using the key of 16")
a.runAndWait()
a.say("In this example, Bob got the correct message. Notice that the bad guy only see the number 80 and not the original message of 64")
a.runAndWait()
a.say("This is a simple example. But y'all can see the disadvantage of semetricall encryption")
a.runAndWait()
a.say("Question. what is the problem of this encryption?")
a.runAndWait()
a.say("Answer: The key is PUBLIC")
a.runAndWait()
a.say("A common fix to this is to send the key also. but how can you do that??")
a.runAndWait()
a.say("So, mathematicians invented assymetrical encryption")
a.runAndWait()
a.say("Question: What is public and private key?")
a.runAndWait()
a.say("Anyone?")
a.runAndWait()
a.say("But the question is: What is public and private keys?")
a.runAndWait()
a.say("So, in this example, both Alice and Bob has public and private keys")
a.runAndWait()
a.say("Question. What are the numbers 3, 5, 7?")
a.runAndWait()
a.say("What are prime numbers?")
a.runAndWait()
a.say("In mathematics, prime keys are used in encryption")
a.runAndWait()
a.say("How to use it? Let's go back to the example of Alice sending the message 64 to Bob")
a.runAndWait()
a.say("Alice should multiply her number with her private and public key")
a.runAndWait()
a.say("What is 64 * 3? Its {}".format(64*3))
a.runAndWait()
a.say("192 multiplied by 5 (the private key) is:")
a.runAndWait()
print(192*5)
a.say("The number 960 is sent over the network. To the bad guy, that means NOTHING")
a.runAndWait()
a.say("Once Bob gets the number, he divide the message by Alice's Public key")
a.runAndWait()
print(960/3)
a.say("Then, Bob multiply HIS Private key with the message")
a.runAndWait()
print(320*13)
a.say("Notice that the original number, 64, was never sent. The messages sent was 960 and 4160")
a.runAndWait()
a.say("Next, Alice divide the number by her private key")
a.runAndWait()
print(4160/5)
print(832/13)
a.say("Finnaly, Bob divides the number by HIS public key")
a.runAndWait()
print(832/13)
a.say("I can't draw. :(")
a.runAndWait()
a.say("And that is the basics of encryption. Any questions?")
a.runAndWait()
a.say("Thank you")
a.runAndWait()