A simple and fast asynchronous file encryption library for large files and data streams.
Project description
The Fast File Encryption is an open, very simple and well-designed file encryption solution for medium and large files (up to terabytes). It uses asymmetric RSA keys to encrypt and decrypt the files, in order to store the public key for encryption on the server, with no worries.
Quick Usage Overview
Create a new key pair:
>>> import fast_file_encryption as ffe
>>> from pathlib import Path
>>> ffe.save_key_pair(public_key=Path('public.pem'), private_key=Path('private.pem'))
Encrypt a file:
>>> original_file = Path('original_file.txt')
>>> original_file.write_text('Hello world!')
>>> encryptor = ffe.Encryptor(ffe.read_public_key(Path('public.pem')))
>>> encrypted_file = Path('encrypted_file.ffe')
>>> encryptor.copy_encrypted(original_file, encrypted_file, meta={'my-meta': 1}, add_source_metadata=True)
Decrypt a file and read its meta data:
>>> decryptor = ffe.Decryptor(ffe.read_private_key(Path('private.pem')))
>>> decryptor.load_decrypted(encrypted_file)
b'Hello world!'
>>> decryptor.read_metadata(encrypted_file)
{'my-meta': 1, 'file_path': '.../original_file.txt', ...}
Installation
Install Fast File Encryption using pip:
$ pip install fast_file_encryption
Documentation
You find all details about the library, it’s design and file format in the documentation.
License
Copyright © 2021-2024 Tobias Erbsland https://erbsland.dev/ and EducateIT GmbH https://educateit.ch/
According to the copyright terms specified in the file “COPYRIGHT.md”.
Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file fast-file-encryption-1.2.6.tar.gz
.
File metadata
- Download URL: fast-file-encryption-1.2.6.tar.gz
- Upload date:
- Size: 21.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 477faad89f7706e68407b72593cb0d0c4290b132e309c7fa7d1be5fbc694de3a |
|
MD5 | 6393030348b447a408ce52c63ddaeb3c |
|
BLAKE2b-256 | be9c042e457bac53efbb8f8aba1fe8424c7fd1bcca8f27f251c9ca5c2d9029d9 |
File details
Details for the file fast_file_encryption-1.2.6-py3-none-any.whl
.
File metadata
- Download URL: fast_file_encryption-1.2.6-py3-none-any.whl
- Upload date:
- Size: 20.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f95fdb4e7498a6503b0773b5bcdd967b80be8a0a0bfd2be4610e7c45ca0bf5fa |
|
MD5 | 0d974137c775afeed7e139460a7f93f7 |
|
BLAKE2b-256 | 41119d42b2586f783972cbb15da5d1e01703963abde5f0dd0bbbf99909914b7f |