eggcrypt 1.4.0__tar.gz → 2.0.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.
- {eggcrypt-1.4.0 → eggcrypt-2.0.0}/PKG-INFO +4 -4
- {eggcrypt-1.4.0 → eggcrypt-2.0.0}/README.md +3 -3
- {eggcrypt-1.4.0 → eggcrypt-2.0.0}/eggcrypt/egg.py +40 -37
- {eggcrypt-1.4.0 → eggcrypt-2.0.0}/eggcrypt.egg-info/PKG-INFO +4 -4
- {eggcrypt-1.4.0 → eggcrypt-2.0.0}/pyproject.toml +1 -1
- {eggcrypt-1.4.0 → eggcrypt-2.0.0}/setup.py +1 -1
- {eggcrypt-1.4.0 → eggcrypt-2.0.0}/LICENSE +0 -0
- {eggcrypt-1.4.0 → eggcrypt-2.0.0}/eggcrypt/__init__.py +0 -0
- {eggcrypt-1.4.0 → eggcrypt-2.0.0}/eggcrypt.egg-info/SOURCES.txt +0 -0
- {eggcrypt-1.4.0 → eggcrypt-2.0.0}/eggcrypt.egg-info/dependency_links.txt +0 -0
- {eggcrypt-1.4.0 → eggcrypt-2.0.0}/eggcrypt.egg-info/top_level.txt +0 -0
- {eggcrypt-1.4.0 → eggcrypt-2.0.0}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: eggcrypt
|
|
3
|
-
Version:
|
|
3
|
+
Version: 2.0.0
|
|
4
4
|
Summary: A pretty secure (yet inneficient) encryption program. Has key(), hash(), encrypt() and decrypt().
|
|
5
5
|
Author: Egglord
|
|
6
6
|
License: MIT
|
|
@@ -18,13 +18,13 @@ This is my fifth python library :D
|
|
|
18
18
|
|
|
19
19
|
Commands:
|
|
20
20
|
|
|
21
|
-
eggcrypt.encrypt("") # Returns an encrypted string.
|
|
21
|
+
eggcrypt.encrypt("text", "key") # Returns an encrypted string.
|
|
22
22
|
|
|
23
|
-
eggcrypt.decrypt("") # Returns a non-encrypted string.
|
|
23
|
+
eggcrypt.decrypt("ciphertext", "key") # Returns a non-encrypted string.
|
|
24
24
|
|
|
25
25
|
eggcrypt.key() # Returns a random key/seed.
|
|
26
26
|
|
|
27
|
-
eggcrypt.hash("") # Uses a custom method to hash a string.
|
|
27
|
+
eggcrypt.hash("") # Uses a custom method to hash a string. Input: str or int.
|
|
28
28
|
|
|
29
29
|
# !NB!
|
|
30
30
|
|
|
@@ -6,13 +6,13 @@ This is my fifth python library :D
|
|
|
6
6
|
|
|
7
7
|
Commands:
|
|
8
8
|
|
|
9
|
-
eggcrypt.encrypt("") # Returns an encrypted string.
|
|
9
|
+
eggcrypt.encrypt("text", "key") # Returns an encrypted string.
|
|
10
10
|
|
|
11
|
-
eggcrypt.decrypt("") # Returns a non-encrypted string.
|
|
11
|
+
eggcrypt.decrypt("ciphertext", "key") # Returns a non-encrypted string.
|
|
12
12
|
|
|
13
13
|
eggcrypt.key() # Returns a random key/seed.
|
|
14
14
|
|
|
15
|
-
eggcrypt.hash("") # Uses a custom method to hash a string.
|
|
15
|
+
eggcrypt.hash("") # Uses a custom method to hash a string. Input: str or int.
|
|
16
16
|
|
|
17
17
|
# !NB!
|
|
18
18
|
|
|
@@ -1,50 +1,53 @@
|
|
|
1
|
-
def encrypt(txt,rep=0):
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
return encrypt(txt,1)
|
|
19
|
-
def decrypt(txt, rep=0):
|
|
1
|
+
def encrypt(txt, key, rep=0):
|
|
2
|
+
encoded=""
|
|
3
|
+
for i, ch in enumerate(txt):
|
|
4
|
+
b=ord(ch)^ord(key[i%len(key)])
|
|
5
|
+
for digit in str(b):
|
|
6
|
+
encoded+=f"{int(digit)+200:03d}"
|
|
7
|
+
out=""
|
|
8
|
+
for i in range(0, len(encoded),2):
|
|
9
|
+
chunk=encoded[i:i+2]
|
|
10
|
+
if len(chunk)==2:
|
|
11
|
+
out+=chr(int(chunk))
|
|
12
|
+
else:
|
|
13
|
+
out+=chr(int(chunk)*10)
|
|
14
|
+
if rep:
|
|
15
|
+
return out
|
|
16
|
+
return encrypt(out,key,1)
|
|
17
|
+
def decrypt(txt, key, rep=0):
|
|
20
18
|
if rep==0:
|
|
21
|
-
txt=decrypt(txt,
|
|
22
|
-
|
|
19
|
+
txt=decrypt(txt,key,1)
|
|
20
|
+
encoded=""
|
|
23
21
|
for ch in txt:
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
22
|
+
n=ord(ch)
|
|
23
|
+
if n<100:
|
|
24
|
+
encoded+=f"{n//10}"
|
|
25
|
+
else:
|
|
26
|
+
encoded+=f"{n:02d}"
|
|
27
|
+
digits=""
|
|
28
|
+
for i in range(0,len(encoded),3):
|
|
29
|
+
part=encoded[i:i+3]
|
|
30
|
+
if len(part)==3:
|
|
31
|
+
digits+=str(int(part)-200)
|
|
32
|
+
values=[]
|
|
33
33
|
temp=""
|
|
34
|
-
for d in
|
|
34
|
+
for d in digits:
|
|
35
35
|
temp+=d
|
|
36
36
|
if int(temp)>31:
|
|
37
|
-
|
|
37
|
+
values.append(int(temp))
|
|
38
38
|
temp=""
|
|
39
|
-
|
|
39
|
+
result=""
|
|
40
|
+
for i, v in enumerate(values):
|
|
41
|
+
result+=chr(v^ord(key[i%len(key)]))
|
|
42
|
+
return result
|
|
40
43
|
def key():
|
|
41
44
|
import time
|
|
42
45
|
seed=1
|
|
43
46
|
for i in range(int(time.time()*10000)%100):
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
47
|
+
a=str(time.time()*10000)
|
|
48
|
+
a=a[0:10]
|
|
49
|
+
a=int(a)
|
|
50
|
+
seed=int(seed*a+(round(seed^a)))
|
|
48
51
|
return seed
|
|
49
52
|
def hash(inp):
|
|
50
53
|
inp=str(inp)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: eggcrypt
|
|
3
|
-
Version:
|
|
3
|
+
Version: 2.0.0
|
|
4
4
|
Summary: A pretty secure (yet inneficient) encryption program. Has key(), hash(), encrypt() and decrypt().
|
|
5
5
|
Author: Egglord
|
|
6
6
|
License: MIT
|
|
@@ -18,13 +18,13 @@ This is my fifth python library :D
|
|
|
18
18
|
|
|
19
19
|
Commands:
|
|
20
20
|
|
|
21
|
-
eggcrypt.encrypt("") # Returns an encrypted string.
|
|
21
|
+
eggcrypt.encrypt("text", "key") # Returns an encrypted string.
|
|
22
22
|
|
|
23
|
-
eggcrypt.decrypt("") # Returns a non-encrypted string.
|
|
23
|
+
eggcrypt.decrypt("ciphertext", "key") # Returns a non-encrypted string.
|
|
24
24
|
|
|
25
25
|
eggcrypt.key() # Returns a random key/seed.
|
|
26
26
|
|
|
27
|
-
eggcrypt.hash("") # Uses a custom method to hash a string.
|
|
27
|
+
eggcrypt.hash("") # Uses a custom method to hash a string. Input: str or int.
|
|
28
28
|
|
|
29
29
|
# !NB!
|
|
30
30
|
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "eggcrypt"
|
|
7
|
-
version = "
|
|
7
|
+
version = "2.0.0"
|
|
8
8
|
description = "A pretty secure (yet inneficient) encryption program. Has key(), hash(), encrypt() and decrypt()."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.8"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|