eggcrypt 1.2.5__tar.gz → 1.3.1__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,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: eggcrypt
3
- Version: 1.2.5
3
+ Version: 1.3.1
4
4
  Summary: A pretty secure (yet inneficient) encryption program. Has key(), hash(), encrypt() and decrypt().
5
5
  Author: Egglord
6
6
  License: MIT
@@ -48,18 +48,23 @@ def key():
48
48
  return seed
49
49
  def hash(inp):
50
50
  inp=str(inp)
51
- h_s=2166136261
52
- for c in inp:
53
- h_s^=ord(c)
54
- h_s=(h_s*16777619)&0xFFFFFFFF
55
- key=h_s
56
- tot=h_s%10000
51
+ H=[0x243f6a8885a308d3,0x13198a2e03707344,0xa4093822299f31d0,0x082efa98ec4e6c89]
52
+ for i,c in enumerate(inp):
53
+ x=ord(c)+(i<<8)
54
+ j=i%4
55
+ H[j]^=x
56
+ H[j]=(H[j]*0x100000001b3)&0xffffffffffffffff
57
+ H[(j+1)%4]^=H[j]>>17
58
+ key_str=''.join(f'{x:016x}' for x in H)
59
+ tot=sum(map(ord,key_str))%10000
57
60
  out=""
58
- for i in str(key):out+=str(int(i)+((tot*int(i))%256))
61
+ for i in key_str:
62
+ v=int(i,16)
63
+ out+=str(v+((tot*v)%256))
59
64
  o=""
60
- for i in out:o+=ascii(int(i)+tot)
65
+ for i in out:o+=chr((int(i)+tot)%256)
61
66
  out=""
62
- for i in range(len(o)-1):out+=ascii(i*tot+int(o[i]))
67
+ for i in range(len(o)-1):out+=ascii(i*tot+ord(o[i]))
63
68
  for n in map(int,[out[i:i+2] for i in range(0,len(out),2)]):o+=chr(n+32)
64
69
  if len(out)%2:o+=chr(int(out[-1])*21)
65
70
  o=o.lstrip("0123456789")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: eggcrypt
3
- Version: 1.2.5
3
+ Version: 1.3.1
4
4
  Summary: A pretty secure (yet inneficient) encryption program. Has key(), hash(), encrypt() and decrypt().
5
5
  Author: Egglord
6
6
  License: MIT
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "eggcrypt"
7
- version = "1.2.5"
7
+ version = "1.3.1"
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"
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name="egg",
5
- version="1.2.5",
5
+ version="1.3.1",
6
6
  packages=find_packages(),
7
7
  description="A pretty secure (yet inneficient) encryption program.",
8
8
  author="Egglord",
File without changes
File without changes
File without changes
File without changes