small corrections to readme
Python Code Quality / python-code-quality (push) Successful in 10s
Python Test / python-test (push) Successful in 13s

This commit is contained in:
Brian Bjarke Jensen
2026-01-07 18:38:04 +01:00
parent 422bad3fb8
commit a616078fa8
+10 -13
View File
@@ -55,7 +55,7 @@ export PASSWORD=your-secure-password
uv run python-encrypt-code encrypt ${MODULE_PATH} -o ${ENCRYPTED_FILE} -p ${PASSWORD} uv run python-encrypt-code encrypt ${MODULE_PATH} -o ${ENCRYPTED_FILE} -p ${PASSWORD}
``` ```
### 3. Decrypt and Extract ### 3. Decrypt an Encrypted File
```bash ```bash
uv run python-encrypt-code decrypt ${ENCRYPTED_FILE} -o ./decrypted -p ${PASSWORD} uv run python-encrypt-code decrypt ${ENCRYPTED_FILE} -o ./decrypted -p ${PASSWORD}
@@ -64,7 +64,7 @@ uv run python-encrypt-code decrypt ${ENCRYPTED_FILE} -o ./decrypted -p ${PASSWOR
### 4. Run Encrypted Module Directly ### 4. Run Encrypted Module Directly
```bash ```bash
uv run python-encrypt-code run-insecure ${ENCRYPTED_FILE} -p ${PASSWORD} --script main.py uv run python-encrypt-code run-insecure ${ENCRYPTED_FILE} --script main.py
``` ```
## Commands ## Commands
@@ -82,7 +82,7 @@ uv run python-encrypt-code generate-password
Encrypt a Python module or package directory. Encrypt a Python module or package directory.
```bash ```bash
uv run python-encrypt-code encrypt <source_path> -o <output.pec> -p <password> [-kv <key>=<value>] uv run python-encrypt-code encrypt <source_path> -o <output.pec> -p <password> [-aad <json-string>]
``` ```
**Options:** **Options:**
@@ -90,22 +90,20 @@ uv run python-encrypt-code encrypt <source_path> -o <output.pec> -p <password> [
- `source_path`: Directory containing Python files to encrypt - `source_path`: Directory containing Python files to encrypt
- `-o, --output`: Output path for encrypted file - `-o, --output`: Output path for encrypted file
- `-p, --password`: Password for encryption - `-p, --password`: Password for encryption
- `-kv, --key-value`: Key-value pair to embed in the encrypted file - `-aad, --additional-authenticated-data`: JSON-formatted string to embed metadata in the encrypted file
### `decrypt` ### `decrypt`
Decrypt a file and extract contents to disk. Decrypt a file and extract contents to disk.
```bash ```bash
uv run python-encrypt-code decrypt <encrypted_file> -o <output_dir> -p <password> [-kv <key>=<value>] uv run python-encrypt-code decrypt <encrypted_file> -o <output_dir>
``` ```
**Options:** **Options:**
- `encrypted.pec`: Path to encrypted file - `encrypted.pec`: Path to encrypted file
- `-o, --output`: Directory to extract decrypted files - `-o, --output`: Directory to extract decrypted files
- `-p, --password`: Password for decryption
- `-kv, --key-value`: Key-value pair matching what is embedded in the encrypted file
### `run-insecure` ### `run-insecure`
@@ -113,15 +111,13 @@ Decrypt and execute a Python script from an encrypted package.
**N.B. this writes decrypted files to a temporary folder on the disk before executing!** **N.B. this writes decrypted files to a temporary folder on the disk before executing!**
```bash ```bash
uv run python-encrypt-code run-insecure <encrypted.pec> -p <password> --script <script_name> [-kv <key>=<value>] uv run python-encrypt-code run-insecure <encrypted_file> --script <script_name>
``` ```
**Options:** **Options:**
- `encrypted.pec`: Path to encrypted file - `encrypted.pec`: Path to encrypted file
- `-p, --password`: Password for decryption
- `-s, --script`: Python script to execute (default: `main.py`) - `-s, --script`: Python script to execute (default: `main.py`)
- `-kv, --key-value`: Key-value pair matching what is embedded in the encrypted file
## Use Cases ## Use Cases
@@ -132,8 +128,9 @@ uv run python-encrypt-code run-insecure <encrypted.pec> -p <password> --script <
export PASSWORD=$(uv run python-encrypt-code generate-password) export PASSWORD=$(uv run python-encrypt-code generate-password)
uv run python-encrypt-code encrypt ./my_app -o my_app.pec -p ${PASSWORD} uv run python-encrypt-code encrypt ./my_app -o my_app.pec -p ${PASSWORD}
# Distribute the .pec file and password to customers # Setup your own authentication source and subclass the PasswordProvider
# They can run it without seeing the source code # Distribute the .pec file to customers and let
# them run it without seeing the source code
uv run python-encrypt-code run-insecure ./my_app.pec -p ${PASSWORD} --script main.py uv run python-encrypt-code run-insecure ./my_app.pec -p ${PASSWORD} --script main.py
``` ```
@@ -144,7 +141,7 @@ uv run python-encrypt-code run-insecure ./my_app.pec -p ${PASSWORD} --script mai
uv run python-encrypt-code encrypt ./production_code -o deployment.pec -p $DEPLOY_PASSWORD uv run python-encrypt-code encrypt ./production_code -o deployment.pec -p $DEPLOY_PASSWORD
# Deploy and run on target server # Deploy and run on target server
uv run python-encrypt-code run-insecure deployment.pec -p $DEPLOY_PASSWORD --script startup.py uv run python-encrypt-code run-insecure deployment.pec --script startup.py
``` ```
### 3. Educational Content Protection ### 3. Educational Content Protection