All Projects → cckuailong → Py2sec

cckuailong / Py2sec

Licence: mit
🐍 py2sec is a Cross-Platform, Fast and Flexible tool to change the .py to .so(Linux and Mac) or .pyd(Win).

Programming Languages

python
139335 projects - #7 most used programming language
python3
1442 projects

Projects that are alternatives of or similar to Py2sec

Web Client
Cryptee's web client source code for all platforms.
Stars: ✭ 174 (-6.95%)
Mutual labels:  encryption
Seal
Microsoft SEAL is an easy-to-use and powerful homomorphic encryption library.
Stars: ✭ 2,424 (+1196.26%)
Mutual labels:  encryption
Hive
Lightweight and blazing fast key-value database written in pure Dart.
Stars: ✭ 2,681 (+1333.69%)
Mutual labels:  encryption
Ksprefs
🚀⚡ Kotlin SharedPreferences wrapper & cryptographic preferences android library.
Stars: ✭ 176 (-5.88%)
Mutual labels:  encryption
Spring Vault
Provides familiar Spring abstractions for HashiCorp Vault
Stars: ✭ 179 (-4.28%)
Mutual labels:  encryption
Easyrsa
Simple and Secure Wrapper for phpseclib
Stars: ✭ 183 (-2.14%)
Mutual labels:  encryption
Authorizer
Authorizer is a Password Manager for Android. It emulates an HID keyboard over USB and enters your credentials on your target device. Additionally it supports OTP 🔑📴
Stars: ✭ 172 (-8.02%)
Mutual labels:  encryption
Pagecrypt
Client-side password-protection for HTML
Stars: ✭ 186 (-0.53%)
Mutual labels:  encryption
Sboot stm32
Secure USB DFU1.1 bootloader for STM32
Stars: ✭ 181 (-3.21%)
Mutual labels:  encryption
Openssl For Iphone
A script for compiling OpenSSL for iOS Devices (iPhone, iPad, iPod Touch, AppleTV, MacCatalyst)
Stars: ✭ 2,190 (+1071.12%)
Mutual labels:  encryption
Cypher
Pythonic ransomware proof of concept.
Stars: ✭ 178 (-4.81%)
Mutual labels:  encryption
Cidlib
The CIDLib general purpose C++ development environment
Stars: ✭ 179 (-4.28%)
Mutual labels:  encryption
Re Whatsapp
Reverse engineering WhatsApp. Documentation and protocols.
Stars: ✭ 184 (-1.6%)
Mutual labels:  encryption
Laravel Source Encrypter
Laravel and Lumen Source Code Encrypter
Stars: ✭ 175 (-6.42%)
Mutual labels:  encryption
Staticrypt
Password protect a static HTML page
Stars: ✭ 2,280 (+1119.25%)
Mutual labels:  encryption
Magicpad
MagicPad is an encryption suite for beginners. It is designed to be run standalone via the browser or executable (Electron).
Stars: ✭ 174 (-6.95%)
Mutual labels:  encryption
Etesync Web
An EteSync web client
Stars: ✭ 183 (-2.14%)
Mutual labels:  encryption
Jncryptor
Java implementation of RNCryptor
Stars: ✭ 187 (+0%)
Mutual labels:  encryption
Gun
An open source cybersecurity protocol for syncing decentralized graph data.
Stars: ✭ 15,172 (+8013.37%)
Mutual labels:  encryption
Android
EteSync - Secure, end-to-end encrypted, and privacy respecting sync for your contacts, calendars and tasks.
Stars: ✭ 184 (-1.6%)
Mutual labels:  encryption

py2sec

English Readme

py2sec 一款轻量的脚本工具,基于 Cython 将 .py 编译成 run-time libraries 文件:.so (Linux && Mac),或 .pyd (Win)。一定程度上实现了“加密”保护源代码的需求。

系统支持

Linux && MacOS && Windows

注意:Windows用户运行时可能会遇到如下错误

error: command 'cl.exe' failed: No such file or directory

请安装对应Win系统版本的Visual C++ Build Tools

py2sec 特性

  1. .so / .pyd 文件可以像 .py 模块一样正常调用。例如:importfrom module import * "
  2. py2sec 可以指定编译单个 .py 文件,也可以指定一个 python 项目目录
  3. py2sec 还可以提升代码运行速度,至多提升30倍
  4. py2sec 自动识别项目中的 .py 文件,且只编译 .py 类型文件
  5. 可以指定不需要编译的文件或子目录
  6. py2sec 不影响源文件,加密后的文件或项目将被存放在 result 文件夹
  7. 兼容多平台:macOS、Linux、Windows、
  8. 兼容 Python 版本:python2 and python3, 可使用 -p(--py) 参数来指定版本
  9. 支持多线程(待改进)

环境配置

pip install requirements.txt

使用说明

使用

请将要加密的目录或文件存放在py2sec根目录下

python py2sec.py [选项] ...

选项

-v,  --version    显示 py2sec 版本
-h,  --help       显示帮助菜单
-p,  --pyth       Python的版本, 默认为 你的 "python" 命令绑定的python版本
                  例: -p 3  (比如你使用python3)
-d,  --directory  Python项目路径 (如果使用-d参数, 将编译整个Python项目)
-f,  --file       Python文件 (如果使用-f, 将编译单个Python文件)
-m,  --maintain   标记你不想编译的文件或文件夹路径
                  注意: 文件夹需要以路径分隔符号(`/`或`\\`,依据系统而定)结尾,并且需要和-d参数一起使用 
                  例: -m setup.py,mod/__init__.py,exclude_dir/
-x  --nthread     编译启用的线程数
-q  --quiet       静默模式,默认False
-r  --release     Release 模式,清除所有中间文件,只保留加密结果文件,默认False
python py2sec.py -f test.py
python py2sec.py -f example/test1.py -r
python py2sec.py -d example/ -m test1.py,bbb/

# 一些操作系统使用 "python3" 命令来执行python3,如Ubuntu,这里可以使用 -p 参数来运行
python3 py2sec.py -p 3 -d example/

项目结构

  • build/ 临时文件夹, .o, .so/.pyd 文件
  • tmp_build/ 临时文件夹, .c 文件
  • result/ 编译最终结果存放目录
  • result/log.txt 编译过程日志
  • py2sec.py 主函数文件
  • py2sec_build.py.template 用于生成 py2sec_build.py 的模板文件
  • requirements.txt 依赖库的清单

协议

本项目遵循MIT协议

示例

整个Python项目编译前:

demo1

py2sec 编译后效果:

demo2

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].