rclone_crypt_py
Python implementation of encryption/decryption for rclone (crypt storage)
Usage
from rclone import Crypt
# Initialize
# Pass in passwd1 and passwd2
# The password here is the password for creating the crypt, not the password in the rclone configuration file
# If passwd2 is not set, the second parameter can be omitted
crypt = Crypt('PvrhK9lOaJMdJO2', 'bjnW66SNkUuV4hX')
# To use passwords directly in the rclone configuration file(obscured password), you should set the passwd_obscured parameter to True.
# crypt = Crypt('SpnX0yEFxpNJjo9bxd3xAlVoXA7F4cr3C0SA-zmfzw', 'ziWH7jKYerB6o5vHnaXAvISTguFD6ZFJFbhT3BlLVQ', True)
# File encryption/decryption
crypt.File.file_decrypt(input_file_path, output_file_path)
crypt.File.file_encrypt(input_file_path, output_file_path)
# File path encryption/decryption
# obfuscate
crypt.Name.obfuscate_encrypt('Hello,Word')
crypt.Name.obfuscate_decrypt('188.Nkrru,cuxj')
#standard
crypt.Name.standard_encrypt('Hello,Word/你好,世界')
crypt.Name.standard_decrypt('tj0ivgsmd9vh4ccfov7f739in0/lb8g1ak1849smj6mlmpv2c5aio')
from rclone import Crypt
crypt = Crypt('PvrhK9lOaJMdJO2', 'bjnW66SNkUuV4hX')
# bytes decryption
with open('test.bin', 'rb') as f:
f.seek(8) # Skip the fixed file header b'RCLONE\x00\x00'
init_nonce = f.read(24) # Read the nonce
f.seek(5 * (1024 * 64 + 16), 1) # Skip 5 data blocks
input_bytes = f.read(10 * (1024 * 64 + 16)) # Read 10 data blocks
output_bytes = crypt.File.bytes_decrypt(input_bytes, init_nonce, 5) # Decrypt the data blocks
# bytes encryption
import nacl
with open('test.bin', 'wb') as f:
f.write(b'RCLONE\x00\x00') # Write the standard header
init_nonce = nacl.utils.random(24) # Generate a random nonce (24 bits)
f.write(init_nonce) # Write the nonce
with open('origin.bin', 'rb') as fl:
origin_bytes = fl.read(1024 * 64 * 10) # Read 10 data blocks
i = 0
while origin_bytes:
f.write(crypt.File.bytes_encrypt(origin_bytes, init_nonce, i))
origin_bytes = fl.read(1024 * 64 * 10)
i = i + 10
Metadata
Release files for rclone-crypt 1.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| rclone_crypt-1.2.0.tar.gz | 14.8 kB | Without provenance | Details for rclone_crypt-1.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| rclone_crypt-1.2.0-py3-none-any.whl | Python 3 | none | any | Details for rclone_crypt-1.2.0-py3-none-any.whl |
Total release size: 27.0 kB
Release files / rclone_crypt-1.2.0.tar.gz
| Download URL | rclone_crypt-1.2.0.tar.gz |
|---|---|
| Size | 14.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3d0769ba655a790a1e411a661d40199165eeef2d78398c45be4e2b92a31c5635
|
|
BLAKE2b-256 checksum How to use checksums |
d69cbe1ba095553c85df34e4d65737f3b5c0ac82cac33da42bec42718fb22d81
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.9.21
|
Release files / rclone_crypt-1.2.0-py3-none-any.whl
| Download URL | rclone_crypt-1.2.0-py3-none-any.whl |
|---|---|
| Size | 12.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
516258ede5aae7d04bd4757987ae747003364c7b01970d198adcc52f7558c074
|
|
BLAKE2b-256 checksum How to use checksums |
14c8b0418305b52076ffd8c1dfb31d19b7312e0699e78dec9ec3e2dc5e52af2e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.9.21
|
Security for rclone-crypt 1.2.0
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.