Skip to content

Commit

Permalink
Update v1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
PyFlat-JR committed May 19, 2023
1 parent 736060b commit 9ecf7ec
Show file tree
Hide file tree
Showing 10 changed files with 66 additions and 90 deletions.
68 changes: 66 additions & 2 deletions plant_the_bomb.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,72 @@
import functools
import hashlib
from pathlib import *
import resources.crypto as crypto
import resources.Pic_Txt as sm
from cryptography.fernet import Fernet
import base64
from PIL import Image, ImageDraw

class sm():
def num_to_pic(values, name):
ar = values
wert = (round(len(ar)/10))+1
img = Image.new('RGB', (10, wert), color = 'white')
ar.append((255,255,255))
while len(ar)%10 != 0:
ar.append((0,0,0))
for g in range(10):
ar.append((0,0,0))
i=0
p=0
while i < wert:
for j in range(0,10):
draw = ImageDraw.Draw(img)
draw.point((j, i), fill=ar[p])
p += 1
i += 1

img.save(name + '.png')

def pic_to_num(filename):
im = Image.open(filename + '.png',"r")
result = []
for j in range(im.height):
for i in range(im.width):
result.append(im.getpixel((i,j)))
r,g,b = result[len(result)-1]
if r == 255 and g == 255 and b == 255:
result.pop()
return result
return result

class crypto():
def encode(text, key):
key = hashlib.md5(key.encode()).hexdigest()
key = key.encode("ascii")
key = base64.b64encode(key)
msg = text
msg = msg.encode()
f = Fernet(key)
ciphertext = f.encrypt(msg)
ciphertext = ciphertext.decode()
return ciphertext
def decode(text, kkey):
key = hashlib.md5(kkey.encode()).hexdigest()
key = key.encode("ascii")
key = base64.b64encode(key)
msg = text
msg = msg.encode()
f = Fernet(key)
try:
cleartext = f.decrypt(msg)
except Exception as ex:
print(type(ex))
print(ex)
print("An Error has ocurred")
return None
cleartext = cleartext.decode()
return cleartext


login = None
User = "Jonas"
Pass = "Minecraft"
Expand Down
37 changes: 0 additions & 37 deletions resources/Pic_Txt.py

This file was deleted.

Binary file removed resources/__pycache__/Pic_Txt.cpython-310.pyc
Binary file not shown.
Binary file removed resources/__pycache__/Pic_Txt.cpython-311.pyc
Binary file not shown.
Binary file removed resources/__pycache__/Pic_Txt.cpython-39.pyc
Binary file not shown.
Binary file removed resources/__pycache__/crypto.cpython-310.pyc
Binary file not shown.
Binary file removed resources/__pycache__/crypto.cpython-311.pyc
Binary file not shown.
Binary file removed resources/__pycache__/crypto.cpython-39.pyc
Binary file not shown.
29 changes: 0 additions & 29 deletions resources/crypto.py

This file was deleted.

22 changes: 0 additions & 22 deletions resources/login.py

This file was deleted.

0 comments on commit 9ecf7ec

Please sign in to comment.