parent
4d11387fb7
commit
caeab37fbd
@ -0,0 +1,28 @@
|
||||
import pyautogui # Enter password window
|
||||
import hashlib # Create hash of the key
|
||||
import tkinter #tkinter
|
||||
from tkinter import filedialog
|
||||
from . import Crypter
|
||||
|
||||
# Create process run
|
||||
def Run():
|
||||
# Step 1 - select folder to crypt
|
||||
lStep_1_TkinterRoot = tkinter.Tk()
|
||||
lStep_1_TkinterRoot.withdraw()
|
||||
#lStep_1_FolderPath = filedialog.askdirectory(parent=lStep_1_TkinterRoot,title='Please select a source code directory to crypt')
|
||||
|
||||
# Step 2 - set password to crypt
|
||||
lKeyHashStr_1 = hashlib.sha256(pyautogui.password('Please enter the key to protect source code').encode("utf-8")).digest()
|
||||
print(lKeyHashStr_1)
|
||||
lKeyHashStr_2 = hashlib.sha256(pyautogui.password('Please repeat the key to protect source code').encode("utf-8")).digest()
|
||||
print(lKeyHashStr_2)
|
||||
if lKeyHashStr_1 == lKeyHashStr_2:
|
||||
print("Passed - do AES encryption")
|
||||
from Crypto.Cipher import AES
|
||||
#Crypter.encrypt_file(lKeyHashStr_1, "c:\\test.png", "c:\\test.enc")
|
||||
Crypter.decrypt_file(lKeyHashStr_1, "c:\\test.enc", "c:\\testEnc2.png")
|
||||
#IV = 16 * '\x00' # Вектор инициализации: обсуждается позже
|
||||
#mode = AES.MODE_CBC
|
||||
#encryptor = AES.new(lKeyHashStr_1, mode, IV=IV)
|
||||
#text = "Text to be crypted!"
|
||||
#ciphertext = encryptor.encrypt(text)
|
@ -0,0 +1,21 @@
|
||||
#argv 0 = "RUN"/"CREATE"
|
||||
|
||||
#Import parent folder to import current / other packages
|
||||
#########################################################
|
||||
import sys
|
||||
import subprocess #start process async
|
||||
import os #path, run, remove
|
||||
import time #timer
|
||||
import importlib
|
||||
#lFolderPath = "\\".join(__file__.split("\\")[:-4])
|
||||
lFolderPath = "/".join(__file__.split("/")[:-4])
|
||||
sys.path.insert(0, lFolderPath)
|
||||
from pyOpenRPA.Tools.SafeSource import DistrRun
|
||||
from pyOpenRPA.Tools.SafeSource import DistrCreate
|
||||
#Mode RUN
|
||||
if sys.argv[1].upper() == "RUN":
|
||||
DistrRun.CryptographerInit("")
|
||||
#Mode CREATE
|
||||
if sys.argv[1].upper() == "CREATE":
|
||||
DistrCreate.Run()
|
||||
pass
|
@ -0,0 +1,4 @@
|
||||
cd %~dp0..\..\Sources
|
||||
copy /Y ..\Resources\WPy64-3720\python-3.7.2.amd64\python.exe ..\Resources\WPy64-3720\python-3.7.2.amd64\OpenRPA_SafeSource.exe
|
||||
..\Resources\WPy64-3720\python-3.7.2.amd64\OpenRPA_SafeSource.exe -m pyOpenRPA.Tools.SafeSource "CREATE"
|
||||
pause >nul
|
@ -0,0 +1,4 @@
|
||||
cd %~dp0..\..\Sources
|
||||
copy /Y ..\Resources\WPy64-3720\python-3.7.2.amd64\python.exe ..\Resources\WPy64-3720\python-3.7.2.amd64\OpenRPA_SafeSource.exe
|
||||
..\Resources\WPy64-3720\python-3.7.2.amd64\OpenRPA_SafeSource.exe -m pyOpenRPA.Tools.SafeSource "Run"
|
||||
pause >nul
|
Loading…
Reference in new issue