Skip to main content

Encrypt Python scripts and execute decrypted code.

Project description

ixi

ixi 用于加密 Python 脚本,并生成可执行的加密启动脚本。运行时只在内存中解密并执行,不落盘明文。

安装

pip install --only-binary=:all: ixi

命令

  • ixi -v:输出当前版本号
  • ixi -e script.py:以默认 compat 模式加密脚本并输出 script_<timestamp>.py
  • ixi -e script.py --mode bytecode:以 bytecode 强保护模式加密脚本,运行时不恢复源码文本,但产物绑定加密时的 CPython cache tag 和 magic number(会导致加密后脚本只能在同版本Python上才能运行...一般不建议使用)

明文配置区

  • 加密时会检查明文脚本前 200 行。
  • 若检测到成对出现的配置标记行,就会把整段配置区从加密主体中移出,并保留在产物脚本中明文显示,方便最终用户直接修改。
  • 标记行需要以 # 开头,并以连续的 =- 作为装饰边界;下一条同类标记行会被视为结束标记。例如:
# ===== 自定义配置 =====
FEATURE_FLAG = True
TIMEOUT = 300
# ==========
  • 运行加密脚本时,这段明文配置会先执行,再执行后面的加密主体,因此修改后的值会立即生效。
  • 若只找到开始标记、没找到结束标记,会打印警告并回退为“完整加密”,不会移动这段配置区。

运行时行为

  • 启动脚本会先尝试 import ixi
  • 若导入失败,自动按 python -m pip、当前解释器目录下的 pip/pip3uv pip install --python 当前解释器 的顺序尝试安装,并依次尝试默认源、中科大官方 simple 源、旧跳转兼容地址与官方 PyPI simple 源。
  • 若本地 ixi 低于云端最新版,启动脚本会用同样的 pip/uv 兼容安装方式,按默认源、中科大官方 simple 源、旧跳转兼容地址、官方 PyPI simple 源的顺序尝试自动升级;升级成功后重启当前脚本以加载新版运行时。
  • 解密前会优先请求中科大官方 simple API 检查版本:
    • GET https://mirrors.ustc.edu.cn/pypi/simple/ixi/
    • 若官方地址不可用,会回退兼容旧地址 https://pypi.mirrors.ustc.edu.cn/simple/ixi/
    • Accept: application/vnd.pypi.simple.v1+json
    • TLS 信任根固定为 certifi(Mozilla CA Bundle),不使用系统证书库。
    • 运行时额外要求对端证书签发组织为 Let's Encrypt
  • 若版本检查请求失败(包括 404、网络错误或镜像拒绝访问),打印警告后继续按当前脚本要求的最低运行时版本执行。
  • 本地版本低于最新版且自动升级失败时,打印告警并终止执行。
  • 自动安装失败时会输出 machine/libc/python 诊断信息,便于定位 wheel 标签不匹配问题(例如 Alpine/musl 环境缺少 musllinux 产物)。

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

ixi-1.0.106-cp310-abi3-win_amd64.whl (9.3 MB view details)

Uploaded CPython 3.10+Windows x86-64

ixi-1.0.106-cp310-abi3-win32.whl (9.0 MB view details)

Uploaded CPython 3.10+Windows x86

ixi-1.0.106-cp310-abi3-musllinux_1_2_x86_64.whl (9.4 MB view details)

Uploaded CPython 3.10+musllinux: musl 1.2+ x86-64

ixi-1.0.106-cp310-abi3-musllinux_1_2_aarch64.whl (9.3 MB view details)

Uploaded CPython 3.10+musllinux: musl 1.2+ ARM64

ixi-1.0.106-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (9.4 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ x86-64

ixi-1.0.106-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (9.3 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ ARM64

File details

Details for the file ixi-1.0.106-cp310-abi3-win_amd64.whl.

File metadata

  • Download URL: ixi-1.0.106-cp310-abi3-win_amd64.whl
  • Upload date:
  • Size: 9.3 MB
  • Tags: CPython 3.10+, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.1

File hashes

Hashes for ixi-1.0.106-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 f859d707f3ab6103b2dde649b57c78faaf96dbebdd479c437e08236a56b9e08a
MD5 2b25130bcfa15f8ff48e0c844ab7a11c
BLAKE2b-256 d5935e32212a6d3316826332f600ae6be37e7fb5544b2255f4e82c3bd779a938

See more details on using hashes here.

File details

Details for the file ixi-1.0.106-cp310-abi3-win32.whl.

File metadata

  • Download URL: ixi-1.0.106-cp310-abi3-win32.whl
  • Upload date:
  • Size: 9.0 MB
  • Tags: CPython 3.10+, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.1

File hashes

Hashes for ixi-1.0.106-cp310-abi3-win32.whl
Algorithm Hash digest
SHA256 8df5f97810195165b271e07087795755bc26ca5f3b2a7bd7102385b74258d6d4
MD5 a873f6db348b73a9096d281e60ec0416
BLAKE2b-256 bda75c418dfa0bc9240c6144bb5a7eefde18b7601cb8fa94d7883150a0b66982

See more details on using hashes here.

File details

Details for the file ixi-1.0.106-cp310-abi3-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for ixi-1.0.106-cp310-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 f745f87d470f7ff2e60cdc00d983df45aa2e217b99ab2be43178fd074e629c65
MD5 54b1265f8083ae4ef75808b4fdf3c05c
BLAKE2b-256 0bf1fe2afb0cdc33fe6eae3d74391a12bff6a2cae810d812067041bc9161307e

See more details on using hashes here.

File details

Details for the file ixi-1.0.106-cp310-abi3-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for ixi-1.0.106-cp310-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 e47af884023c1b7888b549b28a7ab1ac0670baa3b95e29a00ce8e0d329af23e9
MD5 abaeb0bd5b7691d02ceb0c8d69caecbc
BLAKE2b-256 ae50362966ad1bb49c5c15c2ff8ddabe832b135e4139566f8c172b3799c43970

See more details on using hashes here.

File details

Details for the file ixi-1.0.106-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for ixi-1.0.106-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e80df52335494378f48d122a6b5900887fcb1e28a7788c3ebce45acdfab363a9
MD5 8c5d0d9ca37fa9cb69f361d52cf594f5
BLAKE2b-256 48fe70e6ec293e8f684ec6605330c9eacc5f696d847617a36600723aeb459437

See more details on using hashes here.

File details

Details for the file ixi-1.0.106-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for ixi-1.0.106-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 0b689021463fcbc3da19d9499454030af622296bd97421c3a8a9a4387873c5c3
MD5 5927ef8151d10e92387a9b79bcbdc06b
BLAKE2b-256 0efd6a565f65d00c1a97edf3d3ac5cbd7f649ed880ebd3d9f2f8dd0185f58439

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page