Skip to main content

Python bindings for self-encryption library

Project description

self_encryption

Self encrypting files (convergent encryption plus obfuscation)

Crate Documentation
Documentation
MaidSafe website SAFE Dev Forum SAFE Network Forum

Overview

A version of convergent encryption with an additional obfuscation step. This pattern allows secured data that can also be de-duplicated. This library presents an API that takes a set of bytes and returns a secret key derived from those bytes, and a set of encrypted chunks.

Important Security Note: While this library provides very secure encryption of the data, the returned secret key requires the same secure handling as would be necessary for any secret key.

image of self encryption

Documentation

Usage

The library can be used through either Rust or Python interfaces.

Rust Usage

Installation

Add this to your Cargo.toml:

[dependencies]
self_encryption = "0.30"

Example Using Basic Encryptor

# Encrypt a file
cargo run --example basic_encryptor -- -e <full_path_to_any_file>

# Decrypt a file
cargo run --example basic_encryptor -- -d <full_path_to_secret_key> <full_destination_path_including_filename>

Python Usage

Installation

pip install self-encryption

Basic In-Memory Example

from self_encryption import encrypt_bytes, decrypt_chunks

# Create test data (must be at least 3 bytes)
data = b"Hello World" * 1024  

# Encrypt the data
data_map, chunks = encrypt_bytes(data)

# Decrypt and verify
decrypted = decrypt_chunks(data_map, chunks)
assert data == decrypted

File-Based Example with Chunk Storage

from self_encryption import encrypt_file, decrypt_from_files

# Encrypt file and store chunks
data_map, chunk_files = encrypt_file("input.txt", "chunks_dir")

# Decrypt from stored chunks
decrypt_from_files("chunks_dir", data_map, "output.txt")

Streaming Interface Example

from self_encryption import StreamSelfEncryptor, StreamSelfDecryptor

# Stream encryption
encryptor = StreamSelfEncryptor("input_file.dat", chunk_dir="chunks_dir")
chunks = []
data_map = None

while True:
    chunk, maybe_data_map = encryptor.next_encryption()
    if chunk is None:
        data_map = maybe_data_map
        break
    chunks.append(chunk)

# Stream decryption
decryptor = StreamSelfDecryptor("output_file.dat", data_map)
for chunk in chunks:
    is_complete = decryptor.next_encrypted(chunk)
    if is_complete:
        break

License

Licensed under the General Public License (GPL), version 3 (LICENSE http://www.gnu.org/licenses/gpl-3.0.en.html).

Linking Exception

self_encryption is licensed under GPLv3 with linking exception. This means you can link to and use the library from any program, proprietary or open source; paid or gratis. However, if you modify self_encryption, you must distribute the source to your modified version under the terms of the GPLv3.

See the LICENSE file for more details.

Contributing

Want to contribute? Great :tada:

There are many ways to give back to the project, whether it be writing new code, fixing bugs, or just reporting errors. All forms of contributions are encouraged!

For instructions on how to contribute, see our Guide to contributing.

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

self_encryption-0.30.263.tar.gz (1.1 MB view details)

Uploaded Source

Built Distributions

self_encryption-0.30.263-cp312-none-win_amd64.whl (915.9 kB view details)

Uploaded CPython 3.12 Windows x86-64

self_encryption-0.30.263-cp312-cp312-macosx_11_0_arm64.whl (1.0 MB view details)

Uploaded CPython 3.12 macOS 11.0+ ARM64

self_encryption-0.30.263-cp312-cp312-macosx_10_12_x86_64.whl (1.0 MB view details)

Uploaded CPython 3.12 macOS 10.12+ x86-64

self_encryption-0.30.263-cp311-none-win_amd64.whl (915.5 kB view details)

Uploaded CPython 3.11 Windows x86-64

self_encryption-0.30.263-cp311-cp311-macosx_11_0_arm64.whl (1.0 MB view details)

Uploaded CPython 3.11 macOS 11.0+ ARM64

self_encryption-0.30.263-cp311-cp311-macosx_10_12_x86_64.whl (1.0 MB view details)

Uploaded CPython 3.11 macOS 10.12+ x86-64

self_encryption-0.30.263-cp310-none-win_amd64.whl (915.5 kB view details)

Uploaded CPython 3.10 Windows x86-64

self_encryption-0.30.263-cp310-cp310-macosx_11_0_arm64.whl (1.0 MB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

self_encryption-0.30.263-cp310-cp310-macosx_10_12_x86_64.whl (1.0 MB view details)

Uploaded CPython 3.10 macOS 10.12+ x86-64

self_encryption-0.30.263-cp39-none-win_amd64.whl (916.1 kB view details)

Uploaded CPython 3.9 Windows x86-64

self_encryption-0.30.263-cp39-cp39-macosx_11_0_arm64.whl (1.0 MB view details)

Uploaded CPython 3.9 macOS 11.0+ ARM64

self_encryption-0.30.263-cp39-cp39-macosx_10_12_x86_64.whl (1.0 MB view details)

Uploaded CPython 3.9 macOS 10.12+ x86-64

self_encryption-0.30.263-cp38-none-win_amd64.whl (915.8 kB view details)

Uploaded CPython 3.8 Windows x86-64

self_encryption-0.30.263-cp38-cp38-macosx_11_0_arm64.whl (1.0 MB view details)

Uploaded CPython 3.8 macOS 11.0+ ARM64

self_encryption-0.30.263-cp38-cp38-macosx_10_12_x86_64.whl (1.0 MB view details)

Uploaded CPython 3.8 macOS 10.12+ x86-64

self_encryption-0.30.263-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.7m manylinux: glibc 2.17+ x86-64

File details

Details for the file self_encryption-0.30.263.tar.gz.

File metadata

  • Download URL: self_encryption-0.30.263.tar.gz
  • Upload date:
  • Size: 1.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for self_encryption-0.30.263.tar.gz
Algorithm Hash digest
SHA256 d91cf96cc5bd90bb2cabf946b0d7aff3e04f2ba4089cec3b11da5d949763b335
MD5 2ebbb62bebbeaa434b768ba5e8a3bc8b
BLAKE2b-256 819d388ace75042f97e17ee9d682ee13cbe6c1acd927b8f793f8eb03aa1452fd

See more details on using hashes here.

Provenance

The following attestation bundles were made for self_encryption-0.30.263.tar.gz:

Publisher: python-publish.yml on dirvine/self_encryption

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file self_encryption-0.30.263-cp312-none-win_amd64.whl.

File metadata

File hashes

Hashes for self_encryption-0.30.263-cp312-none-win_amd64.whl
Algorithm Hash digest
SHA256 e0cee29446f8859f916a1d924a637fe534c8651b0b1c949f47ac3f41dc221372
MD5 99b2f3cfaf9f311df35e7b6ad813abb5
BLAKE2b-256 7ab3c5b05f02600080b37821d5831f779d25236bb7cb28b07b871da880d671e1

See more details on using hashes here.

Provenance

The following attestation bundles were made for self_encryption-0.30.263-cp312-none-win_amd64.whl:

Publisher: python-publish.yml on dirvine/self_encryption

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file self_encryption-0.30.263-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for self_encryption-0.30.263-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 fc4a58cb66ba983e3a20e2fbb1dd6fada7c9f4aed26057d1a94226c44105a825
MD5 cb84018f737e3db991de74e0600cb1f2
BLAKE2b-256 d5b63eaf35b31925d009bf52ed0b38cc27ab4fef75a225bfc2e874e632fca460

See more details on using hashes here.

Provenance

The following attestation bundles were made for self_encryption-0.30.263-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: python-publish.yml on dirvine/self_encryption

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file self_encryption-0.30.263-cp312-cp312-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for self_encryption-0.30.263-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 cd01801c8b35889bbcf1d51f6f9324cfd85d841e0d5fc459e8b2270bae450285
MD5 610ed8e7f6c69bad9ce90ad35dea0361
BLAKE2b-256 91fa1388f60082ad09365e9f11d8e394a11610e6994c353429ff4670d978a9a1

See more details on using hashes here.

Provenance

The following attestation bundles were made for self_encryption-0.30.263-cp312-cp312-macosx_10_12_x86_64.whl:

Publisher: python-publish.yml on dirvine/self_encryption

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file self_encryption-0.30.263-cp311-none-win_amd64.whl.

File metadata

File hashes

Hashes for self_encryption-0.30.263-cp311-none-win_amd64.whl
Algorithm Hash digest
SHA256 c3470dc3e6d3f439a17bfbfebb3dd6dd7a840197b9a1ed8bf082dbd3409e1a23
MD5 e787fcd831c4db33fc855d3bcaafbc08
BLAKE2b-256 788836016c0135075bbcfdb1001930f3e6654c5f124018b7087934bee43c9081

See more details on using hashes here.

Provenance

The following attestation bundles were made for self_encryption-0.30.263-cp311-none-win_amd64.whl:

Publisher: python-publish.yml on dirvine/self_encryption

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file self_encryption-0.30.263-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for self_encryption-0.30.263-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 2c4e8c9832235639ca968c2685b5dc3c0b73dcf45322a7a34e21424b141b18c9
MD5 73f0db226bba2a25601d24f7085803e2
BLAKE2b-256 ed5791fa5084e008c77c589df1fb6611890cb6a96840bfe7c041df070a914cad

See more details on using hashes here.

Provenance

The following attestation bundles were made for self_encryption-0.30.263-cp311-cp311-macosx_11_0_arm64.whl:

Publisher: python-publish.yml on dirvine/self_encryption

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file self_encryption-0.30.263-cp311-cp311-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for self_encryption-0.30.263-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 5b1b085e6a14633edb625aed787c006cd1ca0af163d591555672fd1d7c763b38
MD5 d556f5326b92a8e3be0516b13948e3ec
BLAKE2b-256 dbb4e0393221e69a683c80be38463b796a058a68c6395d70e1e0b7f473562507

See more details on using hashes here.

Provenance

The following attestation bundles were made for self_encryption-0.30.263-cp311-cp311-macosx_10_12_x86_64.whl:

Publisher: python-publish.yml on dirvine/self_encryption

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file self_encryption-0.30.263-cp310-none-win_amd64.whl.

File metadata

File hashes

Hashes for self_encryption-0.30.263-cp310-none-win_amd64.whl
Algorithm Hash digest
SHA256 023d4690f3192dd16a3c38216aa4302e8d612b36d820864f749077f25100ae9f
MD5 38e22ca98a6872340a3c883241bfd596
BLAKE2b-256 61d14e991b729b000120d56bcbee853bbe6ad5eebe9b376012d1cd312ed5c94a

See more details on using hashes here.

Provenance

The following attestation bundles were made for self_encryption-0.30.263-cp310-none-win_amd64.whl:

Publisher: python-publish.yml on dirvine/self_encryption

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file self_encryption-0.30.263-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for self_encryption-0.30.263-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9ca8b86fb0c8f41b0ce6f76023a4e7ca296bebce15f2510c2bc561dcde75be1c
MD5 27342ffac32b7c5b675df97e133bd99c
BLAKE2b-256 82fe57c74ad82adc6f4a8fd19c2c5254bb2479eb5ab959125a19d919c3ac7f3c

See more details on using hashes here.

Provenance

The following attestation bundles were made for self_encryption-0.30.263-cp310-cp310-macosx_11_0_arm64.whl:

Publisher: python-publish.yml on dirvine/self_encryption

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file self_encryption-0.30.263-cp310-cp310-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for self_encryption-0.30.263-cp310-cp310-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 c6ffa8472902f543e8a2cf707423c4b2fbe38b5bcdddf4880e1c43a99a0c8466
MD5 b6feff2365286310db4100c49de2ed6b
BLAKE2b-256 c7ad75fceedfef0c95f020bd8af5039528d85696b759c3b7d1f4fc73399908e7

See more details on using hashes here.

Provenance

The following attestation bundles were made for self_encryption-0.30.263-cp310-cp310-macosx_10_12_x86_64.whl:

Publisher: python-publish.yml on dirvine/self_encryption

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file self_encryption-0.30.263-cp39-none-win_amd64.whl.

File metadata

File hashes

Hashes for self_encryption-0.30.263-cp39-none-win_amd64.whl
Algorithm Hash digest
SHA256 d299359804b638417c686d79cf118aeb7a6ac9f3f727ffb2a6f4a70b1975530a
MD5 330718df829e68addcaaa4b0e72b4e92
BLAKE2b-256 6247bd78fa6c908113dceb5f2274c3017c2a0246c562e33a153e8dfcd2be768a

See more details on using hashes here.

Provenance

The following attestation bundles were made for self_encryption-0.30.263-cp39-none-win_amd64.whl:

Publisher: python-publish.yml on dirvine/self_encryption

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file self_encryption-0.30.263-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for self_encryption-0.30.263-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ebbe33f258efd9d38e571ed5fc371f33a6f7670adc8c2aced02f7ab75f6b9457
MD5 4628a8852c5b442f715909886ab76483
BLAKE2b-256 d8768bf20ee6917db3178da6efa234d32e06add857119156e6495174fc90f512

See more details on using hashes here.

Provenance

The following attestation bundles were made for self_encryption-0.30.263-cp39-cp39-macosx_11_0_arm64.whl:

Publisher: python-publish.yml on dirvine/self_encryption

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file self_encryption-0.30.263-cp39-cp39-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for self_encryption-0.30.263-cp39-cp39-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 84767ded5cc848837b3eb65d8acb1b60d7ff4e496e9b1734ac4d765705b90c01
MD5 6670b6d9ea3a8720ed6ef4b2d1b818bf
BLAKE2b-256 c5110d41adbeb741ded403f23b38825528741e95553eb9f9ba87db2916e30a9a

See more details on using hashes here.

Provenance

The following attestation bundles were made for self_encryption-0.30.263-cp39-cp39-macosx_10_12_x86_64.whl:

Publisher: python-publish.yml on dirvine/self_encryption

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file self_encryption-0.30.263-cp38-none-win_amd64.whl.

File metadata

File hashes

Hashes for self_encryption-0.30.263-cp38-none-win_amd64.whl
Algorithm Hash digest
SHA256 d89c14e7b03b345ca5fdcb2b85dc71bc5c97c93009e8dd8fbd4477137bcf47d4
MD5 e413726201b191319e0dfb974be316e0
BLAKE2b-256 38e819ffddc663423531740e9c3e44d2f3700fb5dd6be451c6fe0d37ce74607a

See more details on using hashes here.

Provenance

The following attestation bundles were made for self_encryption-0.30.263-cp38-none-win_amd64.whl:

Publisher: python-publish.yml on dirvine/self_encryption

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file self_encryption-0.30.263-cp38-cp38-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for self_encryption-0.30.263-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9e146f722e122b225d777c670bdf61d8d48c78baf1cf05f4218d28f248c97d48
MD5 f61a194ea865c78e4f7a59979b155f87
BLAKE2b-256 efd0ea97e5d9e7cd129cb9b93703dab618611c37fcb9d6a0cc1f84700c224b3d

See more details on using hashes here.

Provenance

The following attestation bundles were made for self_encryption-0.30.263-cp38-cp38-macosx_11_0_arm64.whl:

Publisher: python-publish.yml on dirvine/self_encryption

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file self_encryption-0.30.263-cp38-cp38-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for self_encryption-0.30.263-cp38-cp38-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 3c6b055750bba550f0f83ae26b24dfe28c044294cbc455e7454629f21abab586
MD5 116aaf0bf7a00ad2d363f70c4396dad2
BLAKE2b-256 78d4850a5e9110bba4ddf4a0bdb74c7c9456e0cb6f7ae75a9e2535fe05ad0ce5

See more details on using hashes here.

Provenance

The following attestation bundles were made for self_encryption-0.30.263-cp38-cp38-macosx_10_12_x86_64.whl:

Publisher: python-publish.yml on dirvine/self_encryption

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file self_encryption-0.30.263-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for self_encryption-0.30.263-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e7c5ddbdf1e34a845a8d02faff01b2a8ed755648c73a4bcbe11ac02508eb068e
MD5 e957f8c347819e191cca53dc425038f4
BLAKE2b-256 6071bdc6ea56fc8a90bc646009c167b993beab44eba8df85d683747d750c9c78

See more details on using hashes here.

Provenance

The following attestation bundles were made for self_encryption-0.30.263-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: python-publish.yml on dirvine/self_encryption

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page