Skip to main content

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

Project description

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()

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 Distribution

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

se_imports-0.1.1-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

Details for the file se_imports-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: se_imports-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 7.0 kB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for se_imports-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0f2905cf98f931ebe68ff33556e8f26ed67b917c2926867d0e0fcab38f0e38ec
MD5 2f3fc21d28301cb04cb10299eca386f0
BLAKE2b-256 05502f8ce342544275845e0fc580a809a9d1df42d5fb21c7f7391028ff4a1910

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