Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

加密Python代码&动态导入(encrypt Python source code and import dynamically).

License

NotificationsYou must be signed in to change notification settings

ZhaoQi99/pyencrypt-pye

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

95 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


Python packagePython versionPyPI package PyPI downloadHitsGitHub GitHub last commit (by committer) 

encrypt python source code and import module dynamically.

                                                      _         _ __  _   _  ___ _ __   ___ _ __ _   _ _ __ | |_        | '_ \| | | |/ _ \ '_ \ / __| '__| | | | '_ \| __|        | |_) | |_| |  __/ | | | (__| |  | |_| | |_) | |_        | .__/ \__, |\___|_| |_|\___|_|   \__, | .__/ \__|        |_|    |___/                      |___/|_|        encrypt python source code and import dynamically.                    VERSION 0.3.0

How to do

https://github.com/ZhaoQi99/pyencrypt-pye/wiki#how-to-do

Install

pip install pyencrypt-pye✨🍰✨

Or you can usepip install git+https://github.com/ZhaoQi99/pyencrypt-pye.git install latest version.

Examples

View examples in theexamples directory.

Usage

Usage: pyencrypt [OPTIONS] COMMAND [ARGS]...Options:  --version   Show the version and exit.  -h, --help  Show this message and exit.Commands:  decrypt   Decrypt encrypted pye file  encrypt   Encrypt your python code  generate  Generate loader file using specified key  license   Generate license file using specified key

Encrypt

~$ pyencrypt encrypt -hUsage: pyencrypt encrypt [OPTIONS] PATHNAME  Encrypt your python codeOptions:  -i, --in-place                  make changes to filesin place  -k, --key 🔑                     Your encryption key.If you don‘t specify                                  key, pyencrypt will generate encryption key                                  randomly.  --with-license                  Add license to encrypted file  -m, --bind-mac 01:23:45:67:89:AB                                  Bind mac address to encrypted file  -4, --bind-ipv4 192.168.0.1     Bind ipv4 address to encrypted file  -b, --before [%Y-%m-%dT%H:%M:%S %z|%Y-%m-%d %H:%M:%S|%Y-%m-%d]                                  License is invalid before this date.  -a, --after [%Y-%m-%dT%H:%M:%S %z|%Y-%m-%d %H:%M:%S|%Y-%m-%d]                                  License is invalid after this date.  -y, --yes                       Automatically answer yesfor confirm                                  questions.  -h, --help                      Show this message and exit.

Entry File

In your entry file, you must importloader firstly, and then you can import encrypted modules as usual.

importloaderfromtestimport*

Decrypt

~$ pyencrypt decrypt -hUsage: pyencrypt decrypt [OPTIONS] PATHNAME  Decrypt encrypted pye fileOptions:  -i, --in-place  make changes to filesin place  -k, --key 🔑     Your encryption key.  [required]  -h, --help      Show this message and exit.

Generate

~$ pyencrypt generate -hUsage: pyencrypt generate [OPTIONS]  Generate loader file using specified keyOptions:  -k, --key 🔑  Your encryption key.  [required]  -h, --help   Show this message and exit.

License

pyencrypt's loader will search for the license file in the following manner:

  1. ~/.licenses/license.lic file in your home directory.

  2. licenses/license.lic file inloader file's directory.

  3. licenses/license.lic file in the current working directory.

~$ pyencrypt license -h   Usage: pyencrypt license [OPTIONS]   Generate license file  using specified keyOptions:  -h, --help                      Show this message and exit.  -k, --key 🔑     Your encryption key.  [required]  -m, --bind-mac 01:23:45:67:89:AB                                  Bind mac address to encrypted file  -4, --bind-ipv4 192.168.0.1     Bind ipv4 address to encrypted file  -b, --before [%Y-%m-%dT%H:%M:%S %z|%Y-%m-%d %H:%M:%S|%Y-%m-%d]                                  License is invalid before this date.  -a, --after [%Y-%m-%dT%H:%M:%S %z|%Y-%m-%d %H:%M:%S|%Y-%m-%d]                                  License is invalid after this date.

Shell Completion

BashAdd this to ~/.bashrc:
eval"$(_PYENCRYPT_COMPLETE=bash_source pyencrypt)"
ZshAdd this to ~/.zshrc:
eval"$(_PYENCRYPT_COMPLETE=zsh_source pyencrypt)"
FishAdd this to ~/.config/fish/completions/foo-bar.fish:
eval (env _PYENCRYPT_COMPLETE=fish_source pyencrypt)

Example

Encrypt

~$ pyencrypt encrypt --in-place  -y test.py~$ pyencrypt encrypt test/~$ pyencrypt encrypt test.py -y --with-license\    --before="2000-01-01T00:00:00 +0800" --after="2030-01-01T00:00:00 +0800"\    --bind-mac="AC:DE:48:00:11:22" --bind-ipv4="192.168.0.1"

Decrypt

~$ pyencrypt decrypt -k xxx test.pye

Generate

~$ pyencrypt generate -k xxx

License

~$ pyencrypt license -k xxx\    --before="2000-01-01T00:00:00 +0800" --after="2030-01-01T00:00:00 +0800"\    --bind-mac="AC:DE:48:00:11:22" --bind-ipv4="192.168.0.1"

Development

Format Code

black pyencrypt isort pyencrypt

License

GNU General Public License v3.0

Author

About

加密Python代码&动态导入(encrypt Python source code and import dynamically).

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp