Skip to content

Instantly share code, notes, and snippets.

@uyjulian
Created November 30, 2024 23:38
Show Gist options
  • Save uyjulian/bd8acb32188245c7822e7af42ba20293 to your computer and use it in GitHub Desktop.
Save uyjulian/bd8acb32188245c7822e7af42ba20293 to your computer and use it in GitHub Desktop.
# Install deps:
# python3 -m pip install pycryptodome
# This script decrypts
# pack:psml1/0.1.0/psml1script/system/serverlist.enc
# pack:psml1/0.1.0/psml1script/system/hostname_keypair.enc
from Crypto.Cipher import AES
import sys
key = b'\xD8\xFE\xBE\xA6\xF5\xDB\x92\x9D\xCC\xD4\xD8\xBF\xA3\x45\xC6\x14'
iv = b'\xA1\xE9\x74\xCC\x35\xE9\xC9\xBD\x94\x01\x1C\x82\xB3\x5A\x47\x3A'
msg = b""
with open(sys.argv[1], "rb") as f:
msg = f.read()
cipher = AES.new(key, AES.MODE_CBC, iv=iv)
msg_de = cipher.decrypt(msg)
with open(sys.argv[2], "wb") as wf:
wf.write(bytes(msg_de))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment