MCPcopy Create free account
hub / github.com/dedsec1121fk/DedSec / vault_decrypt

Function vault_decrypt

Scripts/Developer Base/Free Internet.py:842–853  ·  view source on GitHub ↗
(master: str, token: Optional[str])

Source from the content-addressed store, hash-verified

840
841
842def vault_decrypt(master: str, token: Optional[str]) -> str:
843 if not token:
844 return ""
845 env = os.environ.copy()
846 env["FS_PASS"] = master
847 res = subprocess.run(
848 ["openssl", "enc", "-d", "-aes-256-cbc", "-pbkdf2", "-a", "-A", "-pass", "env:FS_PASS"],
849 input=token.encode("utf-8"), capture_output=True, env=env, check=False
850 )
851 if res.returncode != 0:
852 raise RuntimeError(res.stderr.decode("utf-8", "ignore") or "Decryption failed")
853 return res.stdout.decode("utf-8", "ignore")
854
855
856def vault_master() -> Optional[str]:

Callers 3

vault_viewFunction · 0.70
vault_editFunction · 0.70
vault_settingsFunction · 0.70

Calls 1

runMethod · 0.45

Tested by

no test coverage detected