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. A reverse function is provided, where the pair returned from encryption (secret key and encrypted chunks) is passed in, returning the original bytes. There is also the possibility to seek the original bytes in the contents of the encrypted chunks, by calling the seek helper function to produce information used to locate the relevant chunks, and then call the decrypt_range api with the chunks, the secret key and seek information from the previous step.

There is an important aspect to note:

This library provides very secure encryption of the data, and the returned encrypted chunks can be considered as safe as if encrypted by any other modern encryption algorithm. However the returned secret key requires the same secure handling as would be necessary for any secret key.

image of self encryption

Video of the process

self_encryption process and use case video

Whitepaper

Self Encrypting Data, David Irvine, First published September 2010, Revised June 2015.

Python

Installation and example use for python

pip install self-encryption

'''python from self_encryption import ( encrypt_bytes, decrypt_chunks, encrypt_file, decrypt_from_files, StreamSelfEncryptor, StreamSelfDecryptor, DataMap, EncryptedChunk )

Basic encryption/decryption

data = b"Hello World" * 1024 # Must be at least 3 bytes data_map, chunks = encrypt_bytes(data) decrypted = decrypt_chunks(data_map, chunks)

File-based with chunk storage

data_map, chunk_files = encrypt_file("input.txt", "chunks_dir") decrypt_from_files("chunks_dir", data_map, "output.txt")

Streaming encryption

encryptor = StreamSelfEncryptor("large_file.dat", "chunks_dir") while True: chunk, data_map = encryptor.next_encryption() if chunk is None: break # Process chunk...

Streaming decryption

decryptor = StreamSelfDecryptor("output.dat", data_map) for chunk in chunks: is_complete = decryptor.next_encrypted(chunk) if is_complete: break '''

Rust - Using self_encryptor (Rust)

This library splits a set of bytes into encrypted chunks and also produces a secret key for the same. This secret key allows the file to be reconstituted. Instructions to use the 'basic_encryptor' example are as follows:

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

You should now have the example binary in ../self_encryption/target/debug/examples/. The secret_key for the given file and it's encrypted chunks will be written to the current directory.

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

This will restore the original file to the given destination path.

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.262.tar.gz (1.1 MB view details)

Uploaded Source

Built Distributions

self_encryption-0.30.262-cp312-none-win_amd64.whl (916.5 kB view details)

Uploaded CPython 3.12 Windows x86-64

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

Uploaded CPython 3.12 macOS 11.0+ ARM64

self_encryption-0.30.262-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.262-cp311-none-win_amd64.whl (915.9 kB view details)

Uploaded CPython 3.11 Windows x86-64

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

Uploaded CPython 3.11 macOS 11.0+ ARM64

self_encryption-0.30.262-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.262-cp310-none-win_amd64.whl (915.9 kB view details)

Uploaded CPython 3.10 Windows x86-64

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

Uploaded CPython 3.10 macOS 11.0+ ARM64

self_encryption-0.30.262-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.262-cp39-none-win_amd64.whl (916.5 kB view details)

Uploaded CPython 3.9 Windows x86-64

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

Uploaded CPython 3.9 macOS 11.0+ ARM64

self_encryption-0.30.262-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.262-cp38-none-win_amd64.whl (916.2 kB view details)

Uploaded CPython 3.8 Windows x86-64

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

Uploaded CPython 3.8 macOS 11.0+ ARM64

self_encryption-0.30.262-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.262-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.262.tar.gz.

File metadata

  • Download URL: self_encryption-0.30.262.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.262.tar.gz
Algorithm Hash digest
SHA256 23e08bf83e8c9b495c8a55ae5424af2c0963d7b9aab50d42f6150e0a2853e710
MD5 2b01e226ab7fab26049cf8ddc7f15f81
BLAKE2b-256 3ca4ced272bd978d8dad2a5406ecd53121161285e366cb0a9571acb0819b66eb

See more details on using hashes here.

Provenance

The following attestation bundles were made for self_encryption-0.30.262.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.262-cp312-none-win_amd64.whl.

File metadata

File hashes

Hashes for self_encryption-0.30.262-cp312-none-win_amd64.whl
Algorithm Hash digest
SHA256 cca2bac0ae3b9b0e7b9e150321b51f3cda553b8078dff7a4a6523a53b3f4fdd5
MD5 31791ad4baf1b2a6a6ceb2d17fd51e22
BLAKE2b-256 541a35edfe503971ac15697975984891b4e55ba64e472b26713e229745da6bd5

See more details on using hashes here.

Provenance

The following attestation bundles were made for self_encryption-0.30.262-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.262-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for self_encryption-0.30.262-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 86511200e6e09719005c07de91aabc33e30c3cc97b347c996461cae58e879e5d
MD5 bd836767d26e1ab4b9d2d658d2bda8fd
BLAKE2b-256 3dbc96813764bcb60167267867c90fe81589c72a9670790ff831ac944ae36062

See more details on using hashes here.

Provenance

The following attestation bundles were made for self_encryption-0.30.262-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.262-cp312-cp312-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for self_encryption-0.30.262-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 a9d887113e4ed2ad4c09f10ee8069a3e18141bb8698e4f9ef54181ac5d50e776
MD5 8f48b0b23de6d4d108fc9cd9cf2ba218
BLAKE2b-256 49d3efe2fe37791515af07d820d3abac3aa49143c70abb37e6c83f4c6d874a02

See more details on using hashes here.

Provenance

The following attestation bundles were made for self_encryption-0.30.262-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.262-cp311-none-win_amd64.whl.

File metadata

File hashes

Hashes for self_encryption-0.30.262-cp311-none-win_amd64.whl
Algorithm Hash digest
SHA256 7d7058fadb8eca5234bc00aa9a296498fa51971878d04981e0ed43622b09be19
MD5 f1f374e0cbbf00337571af3ce5ade5c9
BLAKE2b-256 c25c88a05d95c18f71ee253958d7539474db8ebd76e30f4409e15bdbfd66721c

See more details on using hashes here.

Provenance

The following attestation bundles were made for self_encryption-0.30.262-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.262-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for self_encryption-0.30.262-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 bd59a1b6bdb6f132bc2373fdaa164887d75bd2702c53b0f561eee18353a6e405
MD5 731129868040ee8cc802c26a5ab8f318
BLAKE2b-256 c62e9cdb36d6652e0d6ef02a40ceec89fc1402b53df2ee9b5dcbf74d9a07e896

See more details on using hashes here.

Provenance

The following attestation bundles were made for self_encryption-0.30.262-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.262-cp311-cp311-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for self_encryption-0.30.262-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 66945264de8ec3cf00a932fb32ee9b3cf35db1f377f24b79344b6047f7310f9a
MD5 7240124f05e51d102689de3cd57f7234
BLAKE2b-256 91cd63b8516f2f1569d54ddc64979cd5bca18b58ef317683d82f369f0ae50014

See more details on using hashes here.

Provenance

The following attestation bundles were made for self_encryption-0.30.262-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.262-cp310-none-win_amd64.whl.

File metadata

File hashes

Hashes for self_encryption-0.30.262-cp310-none-win_amd64.whl
Algorithm Hash digest
SHA256 fd8cb031b9820a219b5feb0312adb3d8bd0d4dae95a6f1472853c314367ec602
MD5 b757a7a818db21b96af37225573ea817
BLAKE2b-256 e0e95ec3541b0b6b8b8565355ec993b84b9a0cfddd4a43b865d3a9c2b70c98ee

See more details on using hashes here.

Provenance

The following attestation bundles were made for self_encryption-0.30.262-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.262-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for self_encryption-0.30.262-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 2dadf33a8cbc9d2da0da8a2d1719b9f1a34b1c400ac1f66b7d04374ab185cf5d
MD5 b58588e0c65ca5d73981efa881d5706c
BLAKE2b-256 e211b9f89fff1eb532f9b1e5d858f5d9536aa9c610b81530424ded380cdaea09

See more details on using hashes here.

Provenance

The following attestation bundles were made for self_encryption-0.30.262-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.262-cp310-cp310-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for self_encryption-0.30.262-cp310-cp310-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 ee520600c66f7e4602867f121509f11a3c3ce4934aaba0d5d8fa34d9ca341bbc
MD5 c573e8a7d1c35446b310450fa76a0d91
BLAKE2b-256 21462aa1dfd0d46de6f785ac35ca13f28fc802a0f8644144f6dc5a9c8b30f27a

See more details on using hashes here.

Provenance

The following attestation bundles were made for self_encryption-0.30.262-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.262-cp39-none-win_amd64.whl.

File metadata

File hashes

Hashes for self_encryption-0.30.262-cp39-none-win_amd64.whl
Algorithm Hash digest
SHA256 002e522fa22e05061018dc6dd88395106fb6d6e7978e042448baabdc11474d62
MD5 b80eb31ca644bd86f17c420b33dcc55c
BLAKE2b-256 5e4d6c456e3d5836ab4218a7d8374d5a44490dae4d8ec5f6d5b012ae1d9a8e69

See more details on using hashes here.

Provenance

The following attestation bundles were made for self_encryption-0.30.262-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.262-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for self_encryption-0.30.262-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ecd3190c910338b7923af1ed07105b1c30b4b6117dfa7d7ba20af20ad4b28f22
MD5 dbd8b1a9251b3072ddfb2320640d5208
BLAKE2b-256 5646fb9b54b626ca3896988a8e59cab8fe9444dc5cdd83f8996f9662f833305a

See more details on using hashes here.

Provenance

The following attestation bundles were made for self_encryption-0.30.262-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.262-cp39-cp39-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for self_encryption-0.30.262-cp39-cp39-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 4fa3d2bfc727aa07c7ad482766a4faf74c801f91cb0a77d248c2927b6e87b955
MD5 79fb2c0f4f872362b8b30ed95a1b316f
BLAKE2b-256 9d3d480c863c7add4ec7b18431c88244cca035c864e97c6f2057a43ecbaaac09

See more details on using hashes here.

Provenance

The following attestation bundles were made for self_encryption-0.30.262-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.262-cp38-none-win_amd64.whl.

File metadata

File hashes

Hashes for self_encryption-0.30.262-cp38-none-win_amd64.whl
Algorithm Hash digest
SHA256 84b4a363338952e3090e636809b9b3904ab15469574067e40b8cde7cb9b57819
MD5 170ada5929f06d15caece709f52adbb2
BLAKE2b-256 22b66e6150be0d7d6a1abf8ef9592de09d374c2ce85ef4bce4f733df5e174c59

See more details on using hashes here.

Provenance

The following attestation bundles were made for self_encryption-0.30.262-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.262-cp38-cp38-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for self_encryption-0.30.262-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 883d983903b5367f468343831366f7ad6fe27082cbe388c2e2039b4fee955097
MD5 e474b40f01411ae79c97af829889e10a
BLAKE2b-256 5b24b8ca54e5af1ba7c5f951adf19c1d06220e6bc46b01f95d56d23bded90d56

See more details on using hashes here.

Provenance

The following attestation bundles were made for self_encryption-0.30.262-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.262-cp38-cp38-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for self_encryption-0.30.262-cp38-cp38-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 b3237b29e777cfe2da942d6d1a0bc611cd296e53ceff7026dbf87236f2427725
MD5 f75f1c3dc9f66c0f029ca61b203cd0e5
BLAKE2b-256 724841950673e82c855761eeaa0380e707171e9339a069807b51d2d8100570d9

See more details on using hashes here.

Provenance

The following attestation bundles were made for self_encryption-0.30.262-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.262-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for self_encryption-0.30.262-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c8196827962e3a487af7bd528f78fd59fe3dfdceb1c3075528cc29984070ca88
MD5 78f0d49747bd79dac84d0388d7beeaaf
BLAKE2b-256 273b8526028326d0680b67f16a676dba1e64147c3407a4251f53d7b12789bd92

See more details on using hashes here.

Provenance

The following attestation bundles were made for self_encryption-0.30.262-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