Skip to main content

Pydlock

Description

pydlock is a simple Python package for encrypting and decrypting files. It can be used either as a package imported into other Python modules or as a command line script.

Installation

pydlock is available on the Python Package Index (PyPI) at https://pypi.org/project/pydlock. To install pydlock, simply use the Python pip installer:

pip install pydlock

Usage

From the command line

To access the help method of the script:

user@computer:~$ python -m pydlock -h
usage: __main__.py [-h] [--arguments ARGUMENTS] [--encoding ENCODING]
                   {lock,unlock,python,run} file

positional arguments:
    {lock,unlock,python,run}
    file

optional arguments:
    -h, --help            show this help message and exit
    --arguments ARGUMENTS
    --encoding ENCODING

To encrypt a file, use python -m pydlock lock [file]:

user@computer:~$ cat secret.txt
Shh! It's a secret!

user@computer:~$ python -m pydlock lock secret.txt
Enter password:
Re-enter password:

user@computer:~$ cat secret.txt
gAAAAABeqx971nHtXHi4dJYw8A_m_1mRYT8V2Sy4XPLqdg0t4mp9ooN-aTU1fuPQwEpwnuFiAfbJ6oPaN9IB1gzFT5-Tb4gFXQMw5uQUXDYV2Pvso6E5lXQ=

To decrypt a file, use python -m pydlock unlock [file]:

user@computer:~$ cat secret.txt
gAAAAABeqx971nHtXHi4dJYw8A_m_1mRYT8V2Sy4XPLqdg0t4mp9ooN-aTU1fuPQwEpwnuFiAfbJ6oPaN9IB1gzFT5-Tb4gFXQMw5uQUXDYV2Pvso6E5lXQ=

user@computer:~$ python -m pydlock unlock secret.txt
Enter password:

user@computer:~$ cat secret.txt
Shh! It's a secret!

To run an encrypted Python file, use python -m pydlock python [file]:

user@computer:~$ cat hello_world.py
print("Hello world!")

user@computer:~$ python -m pydlock lock hello_world.py
Enter password:
Re-enter password:

user@computer:~$ cat hello_world.py
gAAAAABeq6fM4Qxm0TB9cGIg6G-uNprWIAyPmuciugNGIvPxudmBgkIWGhlV3Lg7RyMRdUVODRCehxWXnS5zhSm6fDZ0Ct57XYPztYi_9DZHp0sO1rXuyCE=

user@computer:~$ python -m pydlock python hello_world.py
Enter password:
Hello world!

user@computer:~$ cat hello_world.py
gAAAAABeq6fM4Qxm0TB9cGIg6G-uNprWIAyPmuciugNGIvPxudmBgkIWGhlV3Lg7RyMRdUVODRCehxWXnS5zhSm6fDZ0Ct57XYPztYi_9DZHp0sO1rXuyCE=

In other Python modules

import pydlock

filename = "secret.txt"

with open(filename, "w+") as file:

    print("Shh! It's a secret!", file = file)

pydlock.lock(filename)

Metadata

Release files for pydlock 1.2.0.14

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pydlock 1.2.0.14
File Size Uploaded Provenance
pydlock-1.2.0.14.tar.gz 6.6 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for pydlock 1.2.0.14
File Interpreter ABI Platform
pydlock-1.2.0.14-py3-none-any.whl Python 3 none any Details

Total release size: 16.7 kB

Release files / pydlock-1.2.0.14.tar.gz

Download URL pydlock-1.2.0.14.tar.gz
Size 6.6 kB
Tags Source
SHA-256 checksum
How to use checksums
1dfc9e6ec4f6a9b78d1fcb0563d6254c3c5c22576f869560bde9097464f02944
BLAKE2b-256 checksum
How to use checksums
e27cd3986926ab0205b7775c551d8492ebb324cfd4c980b36b0c343f0c56a5dc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/2.0.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3.post20200330 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.7

Release files / pydlock-1.2.0.14-py3-none-any.whl

Download URL pydlock-1.2.0.14-py3-none-any.whl
Size 10.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e9e3ce548a41616fa47567b408897c38a347bd4c68a799329ba301d01193f353
BLAKE2b-256 checksum
How to use checksums
2bc3a79fd320ef761399983ea4b7597e504873de25ab40f9c9d953ea1f8024dc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/2.0.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3.post20200330 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.7

Security for pydlock 1.2.0.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page