Skip to main content

se-imports: python source code encryption protection, it will decode in memrory and load module

se-imports

encode code

import shutil


def test_se_project(src_dir = '/home/project',dst_dir = '/home/project_se' , package_name='serving'):
    from se_imports import se_project_crypto
    #目标文件夹存在则自动删除
    autoremove_dst_exists = False
    #删除空目录
    autoremove_dst_empty_dir = True
    #忽略复制文件,文件对工程运行没有用
    ignore = shutil.ignore_patterns('test','.git','.idea','setup.py')

    #package_name
    # 如果是pypi包,package_name 需要设置包名,否则可以设置None

    #加密接受规则
    accept_rules = ['serving/utils/*', 'serving/run*', 'serving/http_client/http*']


    se_project_crypto(
        src_dir,
        dst_dir,
        is_use_root_name=False,
        autoremove_dst_exists=False,
        autoremove_dst_empty_dir=True,
        ignore = ignore,
        rules = accept_rules,
        key=bytes([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]),
        iv=bytes([1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15])
    )
    
test_se_project()

run code

import shutil

   
def run():

    import sys,os
    from se_imports import se_register_module

    root_dir = os.path.abspath(os.path.join(os.path.dirname(__file__),os.pardir))
    se_register_module(root_dir=root_dir)


    from serving.runner import main
    main()

Metadata

Release files for se-imports 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for se-imports 0.1.1
File Interpreter ABI Platform Actions
se_imports-0.1.1-py3-none-any.whl Python 3 none any Details for se_imports-0.1.1-py3-none-any.whl

Release files / se_imports-0.1.1-py3-none-any.whl

Download URL se_imports-0.1.1-py3-none-any.whl
Size 7.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0f2905cf98f931ebe68ff33556e8f26ed67b917c2926867d0e0fcab38f0e38ec
BLAKE2b-256 checksum
How to use checksums
05502f8ce342544275845e0fc580a809a9d1df42d5fb21c7f7391028ff4a1910
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.5.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.9

Security for se-imports 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page