Skip to content

Commit da13a6b

Browse files
committed
pilot commit2.0
1 parent 10d81c9 commit da13a6b

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
sample.*
1+
sample.*
2+
sandbox.*

mono.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,20 @@
88
import os
99

1010
#func creates a random key value pair for encryption
11-
def buildCipher():
11+
def buildKey():
1212
keyPool = string.ascii_letters + string.digits + string.punctuation + string.whitespace #contains all printable characters;
1313
alpha = list(keyPool) # list of all printable chara. e.g ['a','b','c','d',...'8','9',...,'\n','\r',...]
1414
alphaCopy = list(keyPool) # creates another list same as alpha above
1515
random.shuffle(alphaCopy) # shuffles cipher list ['z','c','5','l',....,'6','k']
1616
encCipher = dict(zip(alpha, alphaCopy)) #creates a {alpha:cipher} dictionary {'a':'z','b':'c',...,'8':'6','9':'k'}
1717
return encCipher #returning encryption key
1818

19-
encryption_key_pair = buildCipher() # returned dict of buildCipher is the encryption key
19+
encryption_key_pair = buildKey() # returned dict of buildCipher is the encryption key
2020
decryption_key_pair = dict(map(reversed, encryption_key_pair.copy().items())) #copies encryption key and reverses it
2121

22+
def encrypt2_0(text_to_encrypt, eKey):
23+
plain_text_counter = Counter(text_to_encrypt)
24+
2225
#function to encrypt ascii passed in the argument
2326
def encrypt(text_to_encrypt, eKey): #takes a text and the encryption key
2427
encrypted_text = []

0 commit comments

Comments
 (0)