Skip to content

Commit f25c552

Browse files
committed
hash_encrypt
1 parent 2da308e commit f25c552

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,7 @@ __pycache__/
22
piencrypt.egg-info/
33
web/data.py
44
piencrypt/__pycache__/
5+
piencrypt/data.py
56
Helper/
6-
Test/__pycache__/
7+
Test/__pycache__/
8+
Test/data.py

piencrypt/pie.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from data import pie_hash
2+
13
class PiEncrypt:
24

35
def __init__(self, loc):
@@ -13,13 +15,13 @@ def get_data(self):
1315
def hide_data(self, data):
1416
self.data = data
1517
with open(self.loc, 'ab') as f:
16-
f.write(bytes("HERE" + self.data , encoding="ascii"))
18+
f.write(bytes(pie_hash + self.data , encoding="ascii"))
1719

1820
# read the hidden data from the picture
1921
def read_data(self):
2022
with open(self.loc, 'rb') as f:
2123
content = f.read()
22-
list = content.split(b'HERE')
24+
list = content.split(bytes(pie_hash, encoding="ascii"))
2325
# print(f.read())
2426
return list[1].decode("utf-8")
2527

0 commit comments

Comments
 (0)