Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Python data encryption

This module provides a package for encrypting Python based pipeline data. There are multiple encryption algorithms available. Each with their own strengths and weaknesses as outlined below.

Strategy Description
VaultRemoteEncryptionStrategy Leverages the Hashicorp Vault secrets as a service capabilities. This is a highly recommended strategy given it follows best practices and has the advantage of a large developer base working to secure the service.
VaultLocalEncryptionStrategy Leverages the Vault service to provide encryption keys (key rotation and secure storage) but allows for local encryption. This is a good option if you have to encrypt large data objects. It can also provide a performance boost over remote Vault encryption given there is no need for a roundtrip to the server for each data element.
AesCbcEncryptionStrategy A good basic 128 bit encryption strategy. To use this you only need to supply a single encryption key in the encrypt.properties file (128 bit or 16 character). This algorithm works well, but is less efficient than the AES GCM algorithm.
AesGcm96EncryptionStrategy This is a good strategy for most encryption needs. It is efficient and strong against most attacks. You can optionally use an encryption key retrieved from the Vault service with this strategy.

The following example illustrates how to perform encryption.

  1. Example usage

    • Add the following to your code

    VaultRemoteEncryptionStrategy

    # Uses remote Vault encryption
    from aiops_encrypt.vault_remote_encryption_strategy import VaultRemoteEncryptionStrategy
    
    vault_remote = VaultRemoteEncryptionStrategy()
    
    # encrypt plain text data using Vault
    encrypted_value = vault_remote.encrypt('SOME PLAIN TEXT')
    
    # decrypt cipher text data using Vault
    decrypted_value = vault_remote.decrypt(encrypted_value)
    

    NOTE: If you are encrypting your data through a User Defined Function (udf) in PySpark you need to use the VaultLocalEncryptionStrategy (see below). Currently the remote version causes threading issues. This issue will likely be resolved in a future update to the Hashicorp Vault client

    VaultLocalEncryptionStrategy

    # Uses an encryption key retrieved from the Vault server, but performs the encryption locally.
    from aiops_encrypt.vault_local_encryption_strategy import VaultLocalEncryptionStrategy
    
    vault_local = VaultLocalEncryptionStrategy()
    
    # encrypt plain text data using local Vault
    encrypted_value = vault_local.encrypt('SOME PLAIN TEXT')
    
    # decrypt cipher text data using local Vault
    decrypted_value = vault_local.decrypt(encrypted_value)
    

    AesCbcEncryptionStrategy

    # Uses the AES CBC encryption
    from aiops_encrypt.aes_cbc_encryption_strategy import AesCbcEncryptionStrategy
    
    aes_cbc = AesCbcEncryptionStrategy()
    
    # encrypt plain text data using AES CBC
    encrypted_value = aes_cbc.encrypt('SOME PLAIN TEXT')
    
    # decrypt cipher text data using AES CBC
    decrypted_value = aes_cbc.decrypt(encrypted_value)
    

    AesGcm96EncryptionStrategy

    # AES GCM encryption with a 96 bit initialization vector (same algorithm as Vault)
    from aiops_encrypt.aes_gcm_96_encryption_strategy import AesGcm96EncryptionStrategy
    
    aes_gcm_96 = AesGcm96EncryptionStrategy()
    
    # encrypt plain text data using AES GCM
    encrypted_value = aes_gcm_96.encrypt('SOME PLAIN TEXT')
    
    # decrypt cipher text data using AES CBC
    decrypted_value = aes_gcm_96.decrypt(encrypted_value)
    

AISSEMBLE™ Data Encryption

This package includes one security client for calling the "Secrets as a Service" encryption service.

Vault encryption

See the extensions-encryption README for more information on how to configure Vault encryption.

Metadata

Release files for aissemble-extensions-encryption-vault-python 1.7.0.dev1715243362

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

Source distribution (sdist)

Source distribution for aissemble-extensions-encryption-vault-python 1.7.0.dev1715243362
File Size Uploaded Provenance Actions
aissemble_extensions_encryption_vault_python-1.7.0.dev1715243362.tar.gz 10.0 kB Without provenance Details for aissemble_extensions_encryption_vault_python-1.7.0.dev1715243362.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for aissemble-extensions-encryption-vault-python 1.7.0.dev1715243362
File Interpreter ABI Platform Actions
aissemble_extensions_encryption_vault_python-1.7.0.dev1715243362-py3-none-any.whl Python 3 none any Details for aissemble_extensions_encryption_vault_python-1.7.0.dev1715243362-py3-none-any.whl

Total release size: 25.6 kB

Release files / aissemble_extensions_encryption_vault_python-1.7.0.dev1715243362.tar.gz

Download URL aissemble_extensions_encryption_vault_python-1.7.0.dev1715243362.tar.gz
Size 10.0 kB
Tags Source
SHA-256 checksum
How to use checksums
2bbfdad069d856ca56baa6165ff497d041b963f308f6c0a6eff7244da98435ff
BLAKE2b-256 checksum
How to use checksums
21eefa304a4cd3c5d62123035d3e16bf1ce4067c713614339026d319e3fc2e89
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.7.1 CPython/3.9.18 Linux/5.14.0-362.24.1.el9_3.x86_64

Release files / aissemble_extensions_encryption_vault_python-1.7.0.dev1715243362-py3-none-any.whl

Download URL aissemble_extensions_encryption_vault_python-1.7.0.dev1715243362-py3-none-any.whl
Size 15.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
022463f5206c355f8afe313e688714672adaec801a405313f1da0f6d8fea84e1
BLAKE2b-256 checksum
How to use checksums
dd237803716dd49eff8cce31a360e6c53346d7e500fad3eb4e54fb00a4d2e546
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.7.1 CPython/3.9.18 Linux/5.14.0-362.24.1.el9_3.x86_64

Security for aissemble-extensions-encryption-vault-python 1.7.0.dev1715243362

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.

Release history Release notifications | RSS feed

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