Cencrypt 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,60 @@
1
+ import random
2
+
3
+ LETTERS = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"," ",
4
+ "A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z",".",
5
+ ",","/","[","]","`","~","\\","1","2","3","4","5","6","7","8","9","0","-","+","=","!","@","#","$","%","^","&",
6
+ "*","(",")","<",">","?","|",";",";",":","'","\"","{","}"]
7
+
8
+ def index_find(key):
9
+ j = 0
10
+ for i in LETTERS:
11
+ if key == i:
12
+ break
13
+ else:
14
+ j = j + 1
15
+ return j
16
+
17
+ def cipher(message):
18
+ striped_message = message
19
+ num = random.randint(1, (len(striped_message)-1))
20
+ key = striped_message[num]
21
+ j = index_find(key)
22
+ split_letters = [let for let in striped_message]
23
+ i = 0
24
+ for l in split_letters:
25
+ split_letters[i] = index_find(l)
26
+ i = i + 1
27
+
28
+ for i in range(len(split_letters)):
29
+ split_letters[i] = (split_letters[i] + j) % len(LETTERS)
30
+
31
+ for num in range(len(split_letters)):
32
+ split_letters[num] = LETTERS[split_letters[num]]
33
+
34
+ new_message = "".join(split_letters)
35
+ sent_key = LETTERS[j]
36
+
37
+ return new_message, sent_key
38
+
39
+ def decipher(message):
40
+ spl_message = [let for let in message]
41
+ key = spl_message[0]
42
+ spl_message.pop(0)
43
+ message = "".join(spl_message)
44
+ j = index_find(key)
45
+
46
+ split_ciphered = [let for let in message]
47
+ i = 0
48
+ for l in split_ciphered:
49
+ split_ciphered[i] = index_find(l)
50
+ i = i + 1
51
+
52
+ for i in range(len(split_ciphered)):
53
+ split_ciphered[i] = (split_ciphered[i] - j) % len(LETTERS)
54
+
55
+ for num in range(len(split_ciphered)):
56
+ split_ciphered[num] = LETTERS[split_ciphered[num]]
57
+
58
+ deciphered_message = "".join(split_ciphered)
59
+
60
+ return deciphered_message
@@ -0,0 +1 @@
1
+ from .Cencrypt import cipher, decipher
@@ -0,0 +1,7 @@
1
+ Metadata-Version: 2.4
2
+ Name: Cencrypt
3
+ Version: 0.1.0
4
+ Summary: A cool cipher library that is basically impossible to bruteforce.
5
+ Author: Joseph Alex
6
+ Requires-Python: >=3.8
7
+ Description-Content-Type: text/markdown
@@ -0,0 +1,7 @@
1
+ pyproject.toml
2
+ Cencrypt/Cencrypt.py.py
3
+ Cencrypt/__init__.py
4
+ Cencrypt.egg-info/PKG-INFO
5
+ Cencrypt.egg-info/SOURCES.txt
6
+ Cencrypt.egg-info/dependency_links.txt
7
+ Cencrypt.egg-info/top_level.txt
@@ -0,0 +1 @@
1
+ Cencrypt
@@ -0,0 +1,7 @@
1
+ Metadata-Version: 2.4
2
+ Name: Cencrypt
3
+ Version: 0.1.0
4
+ Summary: A cool cipher library that is basically impossible to bruteforce.
5
+ Author: Joseph Alex
6
+ Requires-Python: >=3.8
7
+ Description-Content-Type: text/markdown
@@ -0,0 +1,11 @@
1
+ [project]
2
+ name = "Cencrypt"
3
+ version = "0.1.0"
4
+ description = "A cool cipher library that is basically impossible to bruteforce."
5
+ authors = [{ name="Joseph Alex" }]
6
+ readme = "README.md"
7
+ requires-python = ">=3.8"
8
+
9
+ [build-system]
10
+ requires = ["setuptools", "wheel"]
11
+ build-backend = "setuptools.build_meta"
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+