eggcrypt 1.1.0__tar.gz → 1.2.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.
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: eggcrypt
3
- Version: 1.1.0
4
- Summary: A pretty secure (yet inneficient) encryption program.
3
+ Version: 1.2.0
4
+ Summary: A pretty secure (yet inneficient) encryption program. Has key(), hash(), encrypt() and decrypt().
5
5
  Author: Egglord
6
6
  License: MIT
7
7
  Requires-Python: >=3.7
@@ -24,6 +24,8 @@ eggcrypt.decrypt("") # 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
28
+
27
29
  # !NB!
28
30
 
29
31
  Use: pip install eggcrypt
@@ -12,6 +12,8 @@ eggcrypt.decrypt("") # 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
16
+
15
17
  # !NB!
16
18
 
17
19
  Use: pip install eggcrypt
@@ -0,0 +1 @@
1
+ from .egg import encrypt, decrypt, key
@@ -46,3 +46,28 @@ def key():
46
46
  a=int(a)
47
47
  seed=int(seed*a+(round(seed^a)))
48
48
  return seed
49
+ def hash(inp):
50
+ inp=str(inp)
51
+ tot=0
52
+ for i in inp:
53
+ tot+=ord(i)
54
+ key=key()
55
+ out=""
56
+ for i in str(key):
57
+ out+=str(int(i)+((tot*int(i))%256))
58
+ o=""
59
+ for i in out:
60
+ o+=ascii(int(i)+tot)
61
+ out=""
62
+ for i in range(len(o)-1):
63
+ out+=ascii(i*tot+int(o[i]))
64
+ for n in map(int,[out[i:i+2] for i in range(0, len(out),2)]):o+=chr(n+32)
65
+ if len(out)%2:o+=chr(int(out[-1])*21)
66
+ o=o.lstrip("0123456789")
67
+ h=0
68
+ for c in o:h=(h*31+ord(c))&((1<<256)-1)
69
+ chars="0123456789abcdefghijklmnopqrstuvwxyz"
70
+ x=""
71
+ while h:x=chars[h%36]+x;h//=36
72
+ out=x.zfill(50)
73
+ return out
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: eggcrypt
3
- Version: 1.1.0
4
- Summary: A pretty secure (yet inneficient) encryption program.
3
+ Version: 1.2.0
4
+ Summary: A pretty secure (yet inneficient) encryption program. Has key(), hash(), encrypt() and decrypt().
5
5
  Author: Egglord
6
6
  License: MIT
7
7
  Requires-Python: >=3.7
@@ -24,6 +24,8 @@ eggcrypt.decrypt("") # 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
28
+
27
29
  # !NB!
28
30
 
29
31
  Use: pip install eggcrypt
@@ -4,8 +4,8 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "eggcrypt"
7
- version = "1.1.0"
8
- description = "A pretty secure (yet inneficient) encryption program."
7
+ version = "1.2.0"
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"
11
11
  authors = [
@@ -2,9 +2,9 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name="egg",
5
- version="1.1.0",
5
+ version="1.2.0",
6
6
  packages=find_packages(),
7
7
  description="A pretty secure (yet inneficient) encryption program.",
8
- author="",
8
+ author="Egglord",
9
9
  python_requires=">=3.7",
10
10
  )
@@ -1 +0,0 @@
1
- from .egg import encrypt, decrypt
File without changes
File without changes