ssl part one

This commit is contained in:
2025-03-08 22:13:22 +01:00
parent 8771be760d
commit 1667682c9d
6 changed files with 143 additions and 20 deletions

39
ssl_encrypt.py Executable file
View File

@ -0,0 +1,39 @@
#!/usr/bin/python3
''' This Script encrypt Wireguardfiles for Wirepy users for more Security'''
import os
from subprocess import check_call
from pathlib import Path
import shutil
from ssl_decrypt import create_pub_key
logname = os.getlogin()
keyfile = Path('/home/', logname) / '.config/wire_py/pbwgk.pem'
dirname = Path('/tmp/tlecdcwg/')
if not keyfile.is_file():
create_pub_key()
else:
if dirname.exists():
tl = os.listdir(dirname)
print(tl)
cpth = str(keyfile)
cryptfiles = cpth[:-9]
if keyfile.exists() and len(tl) != 0:
for tunnels in tl:
sourcetl = str(dirname) + '/' + tunnels
print(source)
tlname = cryptfiles + tunnels[:-5] + '.dat'
check_call(['openssl', 'pkeyutl', '-encrypt', '-inkey', keyfile, '-pubin', '-in', sourcetl, '-out', tlname])
else:
print('im else block')
#shutil.rmtree(dirname)
else:
print('im letzen else block')