mirror of
https://github.com/pvlnes/homelab.git
synced 2026-06-03 18:33:49 +00:00
add comments
This commit is contained in:
parent
1a27b1a074
commit
bf59eb51a4
@ -1,13 +1,10 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
"""
|
|
||||||
Generates data.enc from data.json using AES-256-GCM + PBKDF2.
|
|
||||||
Re-run whenever you change data.json or rotate the password.
|
|
||||||
|
|
||||||
Usage on the server:
|
|
||||||
nix-shell -p python3Packages.cryptography --run "python3 encrypt.py"
|
|
||||||
"""
|
|
||||||
import json, os, base64, getpass
|
import json, os, base64, getpass
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
# Скрипт который мы шифруем наш файл с proxy (data.json)
|
||||||
|
# Зачем? Да все просто. Оч впадлу писать какой-то бэк, да я и не программист и не ебу за бэстпрактики
|
||||||
|
# Отдаем пользователю на фронте шифрованный файл с прокси, пользак вводит пароль и JS его расшифровывает
|
||||||
|
# Добавился новый прокси? Пересоздаем файл - готово. Также можно легко менять пароль
|
||||||
from cryptography.hazmat.primitives.kdf.pbkdf2 import PBKDF2HMAC
|
from cryptography.hazmat.primitives.kdf.pbkdf2 import PBKDF2HMAC
|
||||||
from cryptography.hazmat.primitives import hashes
|
from cryptography.hazmat.primitives import hashes
|
||||||
from cryptography.hazmat.primitives.ciphers.aead import AESGCM
|
from cryptography.hazmat.primitives.ciphers.aead import AESGCM
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user