-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathPlanet Life Base64 Tool.py
146 lines (131 loc) · 5.35 KB
/
Planet Life Base64 Tool.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
import base64
import os
from time import sleep
from datetime import date
today = date.today()
textfile_exist = os.path.exists('Input_Base64.txt')
data = "Q3JlYXRlZCBCeTogQ3JhY2tvMjk4"
dat_check = "VGhlIFNjcmlwdCBXYXMgVGFtcGVyZWQgV2l0aC4gUGxlYXNlIEdldCBUaGUgT3JpZ2luYWwgU2NyaXB0IGF0ICdodHRwczovL2dpdGh1Yi5jb20vQ3JhY2tvMjk4L1BsYW5ldC1MaWZlLUNoZWF0Jy4="
data1 = base64.b64decode(data)
data0 = data1.decode('utf-8')
dat_check_succes = base64.b64decode(dat_check)
dat_check_success = dat_check_succes.decode('utf-8')
num0 = 2 ; num1 = -1 ; num2 = dat_check
def Start():
if dat_check != "VGhlIFNjcmlwdCBXYXMgVGFtcGVyZWQgV2l0aC4gUGxlYXNlIEdldCBUaGUgT3JpZ2luYWwgU2NyaXB0IGF0ICdodHRwczovL2dpdGh1Yi5jb20vQ3JhY2tvMjk4L1BsYW5ldC1MaWZlLUNoZWF0Jy4=":
os.system('clear')
print(dat_check_success)
print(" ")
input("Press The 'Enter' Key To Exit.")
exit()
os.system('clear')
print(" ")
print(data0)
print(" ")
print("0 = Convert 'Base64' String To '.planet' File.")
print("1 = Convert '.planet' File To 'Base64 String.")
print(" ")
choice = int(input("Type 0/1 For Your Choice: "))
if choice == 0:
os.system('clear')
print(" ")
create = "Q3JlYXRlZCBCeTogQ3JhY2tvMjk4"
with open('Input_Base64.txt', 'rb') as fileX:
base64toStr1 = fileX.read()
with open('Save-'+str(today)+'.planet', 'wb') as file1:
base64toStr2 = base64.b64decode(base64toStr1)
file1.write(base64toStr2)
file1.close()
if create != data:
if data != "Q3JlYXRlZCBCeTogQ3JhY2tvMjk4":
print(dat_check_success)
print(" ")
input("Press The 'Enter' Key To Exit.")
exit()
sleep(1)
os.system('clear')
print(" ")
print("The Script Was Successful At Decrypting The Base64 Key.")
print(" ")
input("Press the 'Enter' To Continue To The Menu.")
Start()
if choice == 1:
os.system('clear')
print(" ")
user_input = input("What Is The '.planet' File's Name (Do NOT Include The Extension): ")
with open(user_input +'.planet', 'rb') as fileA:
StrToBase64_1 = fileA.read()
with open('BASE64 - '+ str(today)+'.txt', 'wb') as fileB:
StrToBase64_2 = base64.b64encode(StrToBase64_1)
fileB.write(StrToBase64_2)
fileB.close()
sleep(1)
os.system('clear')
print(" ")
print("The Script Was Successful At Encrypting To A Base64 Key.")
print(" ")
input("Press the 'Enter' To Continue To The Menu.")
Start()
if choice >= num0:
os.system('clear')
print(" ")
print("The Script Didn't Seem To Understand Your Input of " + str(choice))
sleep(2.5)
Start()
def check():
if num2 != "VGhlIFNjcmlwdCBXYXMgVGFtcGVyZWQgV2l0aC4gUGxlYXNlIEdldCBUaGUgT3JpZ2luYWwgU2NyaXB0IGF0ICdodHRwczovL2dpdGh1Yi5jb20vQ3JhY2tvMjk4L1BsYW5ldC1MaWZlLUNoZWF0Jy4=":
os.system('clear')
print(dat_check_success)
print(" ")
input("Press The 'Enter' Key To Exit.")
exit()
bytes_of_text = [48,48,48,48]
bytes_of_text1 = b'\x30\x30\x30\x30'
with open('Input_Base64.txt', 'rb') as text_file:
byte_chosen1 = text_file.read(4)
byte_chosen = list(text_file.read(4))
if bytes_of_text <= byte_chosen:
Start()
else:
print(" ")
print("An Error Has Occurred. Whoops! Here's Some Information...")
print(" ")
print("Required Base64 Data Was 'NOT' Found.")
print(" ")
print("= = = = = = = = = = = = = = = = = = = = = = = = = = = = =")
print(" ")
print("Data Below Is The Bare Minimium (Not Actual Base64 Code)")
print(" ")
print("Decimals Codes Needed: " + str(bytes_of_text))
print("Hexadecimal Codes Needed: " + str(bytes_of_text1))
print(" ")
print("= = = = = = = = = = = = = = = = = = = = = = = = = = = = =")
print(" ")
print("Data Given To Script Is Listed Below.")
print(" ")
print("Decimals Codes Found: " + str(byte_chosen))
print("Hexadecimal Codes Found: " + str(byte_chosen1))
print(" ")
print("= = = = = = = = = = = = = = = = = = = = = = = = = = = = =")
print(" ")
input("Press The 'Enter' Key To Exit.")
exit()
def if_text():
if textfile_exist == True:
check()
else:
file10 = open('Input_Base64.txt', 'w')
file10.close
os.system('clear')
print(" ")
print("The Script Has Created A New File. Please Paste Your 'Base64' String Into It. (And Yes, You Have Save It)")
print(" ")
input("Press The 'Enter' Key To Exit.")
exit()
if data != "Q3JlYXRlZCBCeTogQ3JhY2tvMjk4":
os.system('clear')
print(dat_check_success)
print(" ")
input("Press The 'Enter' Key To Exit.")
exit()
if_text()