se-import: Modules import in a safe source protection, support for python module code and custom des encryption, ase decryption operation or custom decryption callback module loading
Project description
se-import: Modules import in a safe source protection, support for python module code and custom des encryption, ase decryption operation or custom decryption callback module loading
# -*- coding: utf-8 -*-
# @Time : 2021/11/10 11:22
'''
模块的安全导入,对python模块代码支持des和自定义加密,运行des解密或者自定义解密回调
'''
se_import demo:
# -*- coding: utf-8 -*-
# @Time : 2021/11/9 16:42
import sys
import se_import
print(dir(se_import))
#从内存加载模块
def test_load_mem():
s = "a = 100\nb=1000"
#自定义模块名
name = 'test_load_mem_test'
ret = se_import.load_module(name,s,name + '.py')
print(ret)
print(dir(ret))
print(ret.a)
print(ret.b)
#从内存加载模块,支持模块解密回调
def test_load_custom():
#从内存加载模块
s = "a = 100\nb=1000"
# 自定义模块名
name = 'load_module_custom_test'
ret= se_import.load_module_custom(name,s,name + '.py',lambda x:x + '\nadasdadada=1000')
print(ret)
print(dir(ret))
print(ret.a)
print(ret.b)
#从本地 ase加密文件加载模块
def test_save_load_asefile():
#模块ase 加密,保存到文件
infile = "./ase.py"
outfile = './ase.pys'
key = bytes([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15])
iv = bytes([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15])
#第一个参数类型是字符串 是文件名, bytes 则为二进制文件内容
ret = se_import.dump_module_to_asefile(infile, key, iv)
with open(outfile,mode='wb') as f:
f.write(ret)
#从文件加载加密模块
# 自定义模块名
infile = './ase.pys'
name = 'test_save_load_asefile_test'
ret2 = se_import.load_module_from_asefile(name,infile,name + '.py')
print(ret2)
print(dir(ret2))
if __name__ == '__main__':
test_save_load_asefile()
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
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file se_import-0.0.9-cp312-cp312-win_amd64.whl.
File metadata
- Download URL: se_import-0.0.9-cp312-cp312-win_amd64.whl
- Upload date:
- Size: 230.2 kB
- Tags: CPython 3.12, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.5.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.28.2 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6bf762ff4c56ef48ccda0ebae0c44470ae04b3a7b2514e57bbe67f22db5b3f99
|
|
| MD5 |
0b3d097fde111bc5524c6190ed07f491
|
|
| BLAKE2b-256 |
4b1159075de266522190077cba7f69a59e7a52b83b7d3cc540a673c6135dda10
|
File details
Details for the file se_import-0.0.9-cp312-cp312-manylinux2014_x86_64.whl.
File metadata
- Download URL: se_import-0.0.9-cp312-cp312-manylinux2014_x86_64.whl
- Upload date:
- Size: 79.1 kB
- Tags: CPython 3.12
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
925c7b5959d7e75eaa153cf4b9ebeea1ad48026f4602ea2ff4f3cd744fe76f07
|
|
| MD5 |
bba5fcb00a6cff8edac75f7b00531913
|
|
| BLAKE2b-256 |
c20d4b858628b371521e560aba764e48c4b8411cfc8011a4427f14e2f069b76b
|
File details
Details for the file se_import-0.0.9-cp312-cp312-manylinux2014_aarch64.whl.
File metadata
- Download URL: se_import-0.0.9-cp312-cp312-manylinux2014_aarch64.whl
- Upload date:
- Size: 75.7 kB
- Tags: CPython 3.12
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
43d54c5ebe8304290f524a7e5296ceae77cd88076a0f2c68c15c113cd5590fe8
|
|
| MD5 |
3cdf54556ee8a94856ec95b9ccec464c
|
|
| BLAKE2b-256 |
f32b9fd78d626f118922074137b5e06c099ebbc3517b7267edb3e350284c518c
|
File details
Details for the file se_import-0.0.9-cp311-cp311-win_amd64.whl.
File metadata
- Download URL: se_import-0.0.9-cp311-cp311-win_amd64.whl
- Upload date:
- Size: 229.5 kB
- Tags: CPython 3.11, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.5.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.28.2 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
604f62d75a9a9f39b0d545adaa96a7fb6c15712b674cca17cecda9e9efbfc8d8
|
|
| MD5 |
b1fd172323b9a4bbdb20a5b88afeee12
|
|
| BLAKE2b-256 |
58085ac84b2841dd6ec86e99168464b55610a201ce5e06d5c58a63a5e53f3360
|
File details
Details for the file se_import-0.0.9-cp311-cp311-manylinux2014_x86_64.whl.
File metadata
- Download URL: se_import-0.0.9-cp311-cp311-manylinux2014_x86_64.whl
- Upload date:
- Size: 78.6 kB
- Tags: CPython 3.11
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f9746d63d600513cf3290299fc1ada7d8cf51a7928b0af0fd006fcc21d12515b
|
|
| MD5 |
67893ec650a56266233cfedb223947ce
|
|
| BLAKE2b-256 |
edff9bab0f93e90122a5b21749b0ff89a9b86db9883aeb5cfb7d712cf2cb692c
|
File details
Details for the file se_import-0.0.9-cp311-cp311-manylinux2014_aarch64.whl.
File metadata
- Download URL: se_import-0.0.9-cp311-cp311-manylinux2014_aarch64.whl
- Upload date:
- Size: 75.4 kB
- Tags: CPython 3.11
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
21bef3d1b11a46a8dcbbb9f3d79b3b66e2e3806843d30dde89eb0f0d8ca259f9
|
|
| MD5 |
017e314e78d11b72a7e53e7b27a50cd3
|
|
| BLAKE2b-256 |
a3789c52bcae2ec8f7326aefe52183e5dcace0069edbad1267920367f1c3d5fe
|
File details
Details for the file se_import-0.0.9-cp310-cp310-win_amd64.whl.
File metadata
- Download URL: se_import-0.0.9-cp310-cp310-win_amd64.whl
- Upload date:
- Size: 229.2 kB
- Tags: CPython 3.10, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.5.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.28.2 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
69fbf779e1dea03e422a48b74701541e547368de5be6023932969ede86d660f9
|
|
| MD5 |
655ab3e1575f6102231d73397bb06462
|
|
| BLAKE2b-256 |
eaf6eb9c5d3072143ebac84a4aa71a897067671c839e8c0c91656f8466ba55c4
|
File details
Details for the file se_import-0.0.9-cp310-cp310-manylinux2014_x86_64.whl.
File metadata
- Download URL: se_import-0.0.9-cp310-cp310-manylinux2014_x86_64.whl
- Upload date:
- Size: 78.6 kB
- Tags: CPython 3.10
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f48e208f99a7a66c2a5e9055d0a7b34ad890c422a794fb9e4e6ea8d72bcac571
|
|
| MD5 |
8906bb2e8f8e1043c3d092d55422699c
|
|
| BLAKE2b-256 |
ece19ee09e58367418ecc091d67c0a4222ebd47ad31e06597a0d21aa48a76827
|
File details
Details for the file se_import-0.0.9-cp310-cp310-manylinux2014_aarch64.whl.
File metadata
- Download URL: se_import-0.0.9-cp310-cp310-manylinux2014_aarch64.whl
- Upload date:
- Size: 75.4 kB
- Tags: CPython 3.10
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6960499fd30a712445712efd68a9debed3c52e7ce6fe27aded2aff262f56b252
|
|
| MD5 |
1bed127399571dad4ab69043e8081a8a
|
|
| BLAKE2b-256 |
3954563cc1d5b25b4c1a14774245c06e0a84cf87bd7ef8ca460a28443f12dade
|
File details
Details for the file se_import-0.0.9-cp39-cp39-win_amd64.whl.
File metadata
- Download URL: se_import-0.0.9-cp39-cp39-win_amd64.whl
- Upload date:
- Size: 228.9 kB
- Tags: CPython 3.9, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.5.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.28.2 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7c131ecaaef805188cb5e43f1c658492c2eb0c4041fb1ea645e08c05355f374e
|
|
| MD5 |
29829b39b76e90f6aaa9f5bede93483e
|
|
| BLAKE2b-256 |
990ae5e03189e6acfc5da7a316e936b6658dba3fdcb7c14e474231fcf73f17bb
|
File details
Details for the file se_import-0.0.9-cp39-cp39-manylinux2014_x86_64.whl.
File metadata
- Download URL: se_import-0.0.9-cp39-cp39-manylinux2014_x86_64.whl
- Upload date:
- Size: 78.9 kB
- Tags: CPython 3.9
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2f7b7b99dee3c888d26c756f10502beccdcd79862fd5c2a269e152744a818f41
|
|
| MD5 |
3d422188e7661187011c9dbdba741950
|
|
| BLAKE2b-256 |
b8ea125694f06fed2bdf846628a34209c748bc17dff0aff406b3159d1e94839c
|
File details
Details for the file se_import-0.0.9-cp39-cp39-manylinux2014_aarch64.whl.
File metadata
- Download URL: se_import-0.0.9-cp39-cp39-manylinux2014_aarch64.whl
- Upload date:
- Size: 75.3 kB
- Tags: CPython 3.9
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
41104a8182f1f24b4b7eb73c90e0e30deb3b36d0dd2d95c17114e428d3a4cbdf
|
|
| MD5 |
a49f2918adc1d5f9375663ff5d8dc3f4
|
|
| BLAKE2b-256 |
896a32b0769b7407b9f4930d31b03e2a9a2f1c7546dce759859553ca75d6f085
|
File details
Details for the file se_import-0.0.9-cp38-cp38-win_amd64.whl.
File metadata
- Download URL: se_import-0.0.9-cp38-cp38-win_amd64.whl
- Upload date:
- Size: 229.4 kB
- Tags: CPython 3.8, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.5.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.28.2 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1ffdbbaf2cbe9b20de94c10de423ef2c5d0b6ead63116cb6237c7c8c51bf87fe
|
|
| MD5 |
a082126526cbf2cb9af1995c5dda3262
|
|
| BLAKE2b-256 |
f84ebef2187e301ea799016d935b61cb6ba5004c65f0aa91c6ec852ba3006681
|
File details
Details for the file se_import-0.0.9-cp38-cp38-manylinux2014_x86_64.whl.
File metadata
- Download URL: se_import-0.0.9-cp38-cp38-manylinux2014_x86_64.whl
- Upload date:
- Size: 78.6 kB
- Tags: CPython 3.8
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3fc5b9883fd21b19e1b8a2d73f08b4f20aa03b9317dee76e531f8edf3d8dee03
|
|
| MD5 |
df7bcbd156798024b4779d6ad004470b
|
|
| BLAKE2b-256 |
ff3d682578a074be0b2bbfaa3e533382e2100fe5ca6184ec4962f947ea1f87f9
|
File details
Details for the file se_import-0.0.9-cp38-cp38-manylinux2014_aarch64.whl.
File metadata
- Download URL: se_import-0.0.9-cp38-cp38-manylinux2014_aarch64.whl
- Upload date:
- Size: 75.1 kB
- Tags: CPython 3.8
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
adc382487bd23fff502fe9971e8129b8d37bd0309c080b9edee7b85ef00968cc
|
|
| MD5 |
84951e55c2598b03db7a6717d327658b
|
|
| BLAKE2b-256 |
6842659109149daa698b960f68b48ae9c1687ec603a7b8c8d6650b01da122429
|
File details
Details for the file se_import-0.0.9-cp37-cp37m-win_amd64.whl.
File metadata
- Download URL: se_import-0.0.9-cp37-cp37m-win_amd64.whl
- Upload date:
- Size: 229.5 kB
- Tags: CPython 3.7m, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.5.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.28.2 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fa5627a56770595a9cf02fe0a2270d046299bc162ac0a09409056e3577e3bc4d
|
|
| MD5 |
4edf7d3f960943862d8e0170391b60f2
|
|
| BLAKE2b-256 |
666937615bf5ba4bb948fe4595647dd6ad203680687e5682757ca59863d76cc8
|
File details
Details for the file se_import-0.0.9-cp37-cp37m-manylinux2014_x86_64.whl.
File metadata
- Download URL: se_import-0.0.9-cp37-cp37m-manylinux2014_x86_64.whl
- Upload date:
- Size: 81.1 kB
- Tags: CPython 3.7m
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c3c181a87dd1f7c1be3cfe59677af64db1be0fa4ab8ee87a11d9f0db2e81e6cc
|
|
| MD5 |
a76e90c38faa20527d10008555cb2ceb
|
|
| BLAKE2b-256 |
e7e6606921f61f33079541810cab7f6131e54a2944e256dd85fef9ef1ff79e6e
|
File details
Details for the file se_import-0.0.9-cp37-cp37m-manylinux2014_aarch64.whl.
File metadata
- Download URL: se_import-0.0.9-cp37-cp37m-manylinux2014_aarch64.whl
- Upload date:
- Size: 78.3 kB
- Tags: CPython 3.7m
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ff249eb040472f50b2d68833a94e8823d012be8cfaf726624e2630e19c33894c
|
|
| MD5 |
b296e22b04c909270532ae943f5d4ecb
|
|
| BLAKE2b-256 |
b77d18d05af4a9f219fb7affd1fa33de1d854b2bd149e748c497b59079d0644e
|
File details
Details for the file se_import-0.0.9-cp36-cp36m-win_amd64.whl.
File metadata
- Download URL: se_import-0.0.9-cp36-cp36m-win_amd64.whl
- Upload date:
- Size: 229.2 kB
- Tags: CPython 3.6m, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.5.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.28.2 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
54b59d5f3536c5dc6bf53995b4f6d900f56b593e60d32559674da624e0969f44
|
|
| MD5 |
bb9e7a0674d864fb3974a2b52ad63263
|
|
| BLAKE2b-256 |
81d8988185d272835cba7be6722eb2481f5b182c63beed087898bef74f0b5ac4
|
File details
Details for the file se_import-0.0.9-cp36-cp36m-manylinux2014_x86_64.whl.
File metadata
- Download URL: se_import-0.0.9-cp36-cp36m-manylinux2014_x86_64.whl
- Upload date:
- Size: 81.1 kB
- Tags: CPython 3.6m
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f7907aef49228ed333730d654776b4c00c5b94906716688e8a6dad9be5334997
|
|
| MD5 |
7cabe420f601c5665d4679b0c1b6fd33
|
|
| BLAKE2b-256 |
e94ef5a7e5be67f3fd73890bdb2fdd631b06304458785e131cd84cbc51f26a20
|
File details
Details for the file se_import-0.0.9-cp36-cp36m-manylinux2014_aarch64.whl.
File metadata
- Download URL: se_import-0.0.9-cp36-cp36m-manylinux2014_aarch64.whl
- Upload date:
- Size: 78.2 kB
- Tags: CPython 3.6m
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aae1cb097790978c51bf82ca351b9eb3371c04165347bbb86f803ffa12d5b566
|
|
| MD5 |
3f3ab78f3afd198f1e9c1cf2e94062f3
|
|
| BLAKE2b-256 |
5c590699e59b4c0fc6913fe06064ea827da306a73888d6d8167e99f743911d7d
|