diff --git a/Encryptext (DEBUG).exe b/Encryptext (DEBUG).exe index 297fafa..618a64b 100644 Binary files a/Encryptext (DEBUG).exe and b/Encryptext (DEBUG).exe differ diff --git a/Encryptext.pyw b/Encryptext.pyw index 6403a6e..3eb1f9e 100644 --- a/Encryptext.pyw +++ b/Encryptext.pyw @@ -11,7 +11,6 @@ import traceback import webbrowser from cryptography.fernet import Fernet - # Used for getting files when using one-file mode .exe format def getTrueFilename(filename): try: @@ -46,10 +45,10 @@ font_type = "Arial" max_font_size = 96 min_font_size = 8 -# Uses random 30 character strings to determine where formatting starts and stops -format_item_separator = "15df8933cab3df434da7d0f13ad54a" -format_separator = "97391e7d85dc6407899136965491b5" -format_string = "e2af2ac41b58bf99587e5a078e4ba3" +# Uses random random-length strings of characters to determine where formatting starts and stops# FORMAT ITEM SEPARATOR HERE +format_item_separator = ''# FORMAT ITEM SEPARATOR HERE# FORMAT SEPARATOR HERE +format_separator = ''# FORMAT SEPARATOR HERE# FORMAT STRING HERE +format_string = ''# FORMAT STRING HERE supported_file_types = [ ("Encryptext", "*.etx"), @@ -65,10 +64,9 @@ supported_file_types = [ ("Log File", "*.log"), ("All Files", "*.*"), ] - -# ENCRYPTION KEY HERE -encrypt_key = b'' # ENCRYPTION KEY HERE +encrypt_key = b''# ENCRYPTION KEY HERE + if debug: encrypt_key = Fernet.generate_key() fernet = Fernet(encrypt_key) @@ -168,7 +166,7 @@ def openFile(Event=None, current=False): else: file = file.decode() - # Look through the text and get all the formatting + # Split the formatting and the visible text file = file.split(format_string) # Go through the formats and remove duplicates diff --git a/installer.exe b/installer.exe index b09a04b..79a9584 100644 Binary files a/installer.exe and b/installer.exe differ diff --git a/installer.py b/installer.py index 42cee97..347f3b3 100644 --- a/installer.py +++ b/installer.py @@ -4,6 +4,8 @@ from time import sleep from subprocess import check_call from cryptography.fernet import Fernet as F +from random import choice, randint +from string import ascii_letters, digits import threading as t print("\nStarting installer...") @@ -34,14 +36,62 @@ def getTrueFilename(filename): key_line = "'".join(key_line) file[1] = key_line -text = "\n".join(file) +text = "".join(file) + +print("Encryption key created!") + +possible_characters = ascii_letters + digits + +# Find where the format item separator string is stored in the file +file = text.split("# FORMAT ITEM SEPARATOR HERE") + +# Create a format item separator string +format_item_separator = "".join([choice(possible_characters) for i in range(randint(15, 45))]) +# Add the format item separator string to the file +key_line = file[1] +key_line = key_line.split("'") +key_line[1] = format_item_separator +key_line = "'".join(key_line) +file[1] = key_line + +text = "".join(file) + +# Find where the format separator string is stored in the file +file = text.split("# FORMAT SEPARATOR HERE") + +# Create a format separator string +format_separator = "".join([choice(possible_characters) for i in range(randint(15, 45))]) + +# Add the format separator string to the file +key_line = file[1] +key_line = key_line.split("'") +key_line[1] = format_separator +key_line = "'".join(key_line) +file[1] = key_line + +text = "".join(file) + +# Find where the format string is stored in the file +file = text.split("# FORMAT STRING HERE") + +# Create a format string +format_string = "".join([choice(possible_characters) for i in range(randint(15, 45))]) + +# Add the format string to the file +key_line = file[1] +key_line = key_line.split("'") +key_line[1] = format_string +key_line = "'".join(key_line) +file[1] = key_line + +text = "".join(file) # Write the file back to the Encryptext.py file file = open(getTrueFilename("Encryptext-User.pyw"), "w", encoding="utf8") file.write(text) file.close() -print("Encryption key created!") +print("Format strings created!") print("Creating custom program...\n\n") # Creates an executable file