Skip to main content

Data protection SDK — format-preserving encryption (FF1/FF3), AES-GCM, data masking, and hashing.

Project description

cyphera

CI Security PyPI Python License

Data protection SDK for Python — format-preserving encryption (FF1/FF3), AES-GCM, data masking, and hashing.

pip install cyphera

Usage

from cyphera import Cyphera

# Auto-discover: checks CYPHERA_CONFIG_FILE env, ./cyphera.json, /etc/cyphera/cyphera.json
c = Cyphera.load()

# Or load from a specific file
c = Cyphera.from_file("./config/cyphera.json")

# Or inline config
c = Cyphera({
    "configurations": {
        "ssn": {"engine": "ff1", "key_ref": "my-key", "header": "T01"},
    },
    "keys": {
        "my-key": {"material": "2B7E151628AED2A6ABF7158809CF4F3C"},
    },
})

# Protect
encrypted = c.protect("123-45-6789", "ssn")
# → "T01i6J-xF-07pX" (DPH-prefixed, dashes preserved)

# Access (header-based, no configuration name needed)
decrypted = c.access(encrypted)
# → "123-45-6789"

Configuration File (cyphera.json)

{
  "configurations": {
    "ssn": { "engine": "ff1", "key_ref": "my-key", "header": "T01" },
    "ssn_mask": { "engine": "mask", "pattern": "last4", "header_enabled": false }
  },
  "keys": {
    "my-key": { "material": "2B7E151628AED2A6ABF7158809CF4F3C" }
  }
}

The header (Data Protection Header, DPH) is a short prefix prepended to protected output that identifies the configuration used. It lets access() reverse a value without the caller naming the configuration.

Cross-Language Compatible

All SDKs produce identical output for the same inputs:

Input:       123-45-6789
Java:        T01i6J-xF-07pX
Rust:        T01i6J-xF-07pX
Node:        T01i6J-xF-07pX
Python:      T01i6J-xF-07pX
Go:          T01i6J-xF-07pX
.NET:        T01i6J-xF-07pX

Status

Alpha. API is unstable. Cross-language test vectors validated against Java, Rust, Node, Go, and .NET implementations.

License

Apache 2.0 — Copyright 2026 Horizon Digital Engineering LLC

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

cyphera-0.0.1a7.tar.gz (18.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cyphera-0.0.1a7-py3-none-any.whl (14.5 kB view details)

Uploaded Python 3

File details

Details for the file cyphera-0.0.1a7.tar.gz.

File metadata

  • Download URL: cyphera-0.0.1a7.tar.gz
  • Upload date:
  • Size: 18.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for cyphera-0.0.1a7.tar.gz
Algorithm Hash digest
SHA256 855c1e82730bcc8aed26a9155ce03ed34eabcf6288952986723b50d1524fd492
MD5 71c0e2d89e35fa0121450473005b8034
BLAKE2b-256 4035d276f778874364b1c3a004d41a2344db8734b5d1fb24d0df5c69182a41a8

See more details on using hashes here.

Provenance

The following attestation bundles were made for cyphera-0.0.1a7.tar.gz:

Publisher: publish.yml on cyphera-labs/cyphera-python

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

File details

Details for the file cyphera-0.0.1a7-py3-none-any.whl.

File metadata

  • Download URL: cyphera-0.0.1a7-py3-none-any.whl
  • Upload date:
  • Size: 14.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for cyphera-0.0.1a7-py3-none-any.whl
Algorithm Hash digest
SHA256 7e821c06c78ce15fc32d53e0e8a4b375bbcbd74a817c7b35e4e4a8cc11754574
MD5 5e38a2a2c1d13bb4032332defadcb8ad
BLAKE2b-256 f31211affc98ec4c660e9b1fc59b7f65a34b04c77f948bfbaab557ae0d6d0ce8

See more details on using hashes here.

Provenance

The following attestation bundles were made for cyphera-0.0.1a7-py3-none-any.whl:

Publisher: publish.yml on cyphera-labs/cyphera-python

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 Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page