semvec/pypi-packages huggingface dataset:
se-import 0.0.9
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
License: Apache 2.0
Requires Python: >=3, <4
Keywords: se_import,se import,se-import

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

```py
# -*- coding: utf-8 -*-
# @Time    : 2021/11/10 11:22
'''
    模块的安全导入，对python模块代码支持des和自定义加密，运行des解密或者自定义解密回调
'''
```
se_import demo:
```py
# -*- 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()
```
fastcrypto 0.0.3
fastcrypto 加密库, 支持aes加密解密"
License: Apache 2.0
Requires Python: >=3, <4
Keywords: fastcrypto,crypto,aes,des

fastcrypto 加密库, 支持aes加密解密"

fastcrypto aes加密解密库

```py
# -*- coding: utf-8 -*-
import sys
#from fastcrypto import fastcrypto
import fastcrypto

data = bytes([125,2,3,4])
#,key,iv  length must 16
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])

ret = fastcrypto.aes_encode(data,key,iv)
print(ret)
if ret[0] == 0:
    crypt_data = ret[1]
    ret = fastcrypto.aes_decode(crypt_data,key,iv)
    print(ret)

```