Skip to main content

Ephemeral-First Security Framework - Security through transience

Project description

EFSF Python SDK

The official Python SDK for the Ephemeral-First Security Framework.

Installation

# Basic installation
pip install efsf

# With Redis backend support
pip install efsf[redis]

# With all optional dependencies
pip install efsf[all]

Quick Start

from efsf import EphemeralStore, DataClassification

# Create a store (defaults to in-memory for development)
store = EphemeralStore()

# Store sensitive data with automatic TTL and encryption
record = store.put(
    data={"user_id": "123", "ssn": "xxx-xx-xxxx"},
    ttl="30m",  # Destroyed in 30 minutes
    classification=DataClassification.PII,
)

print(f"Stored record: {record.id}")
print(f"Expires at: {record.expires_at}")

# Retrieve while valid
data = store.get(record.id)
print(f"Retrieved: {data}")

# Check remaining time
remaining = store.ttl(record.id)
print(f"Time remaining: {remaining}")

# Manually destroy early
certificate = store.destroy(record.id)
print(f"Destruction certificate: {certificate.certificate_id}")

Using Redis Backend

from efsf import EphemeralStore

store = EphemeralStore(
    backend="redis://localhost:6379/0",
    default_ttl="1h",
    attestation=True,
)

# Redis provides native TTL enforcement
record = store.put({"session": "data"}, ttl="15m")

Sealed Execution

from efsf import sealed

@sealed(attestation=True)
def process_payment(card_number: str, amount: float) -> str:
    """
    All local variables are destroyed when this function returns.
    A destruction certificate is automatically generated.
    """
    # Process payment...
    return f"payment_id_{hash(card_number) % 10000}"

result = process_payment("4111-1111-1111-1111", 99.99)
# card_number is now destroyed from memory

Data Classifications

Classification Default TTL Max TTL Use Case
TRANSIENT 1 hour 24 hours Session tokens, OTPs
SHORT_LIVED 1 day 7 days Shopping carts, temp files
RETENTION_BOUND 90 days 7 years Invoices, audit logs
PERSISTENT None None Legal holds (requires justification)

Destruction Certificates

Every destroyed record can have a cryptographically signed certificate:

from efsf import EphemeralStore

store = EphemeralStore(attestation=True)
record = store.put({"sensitive": "data"}, ttl="1m")

# Wait for expiration or destroy manually
certificate = store.destroy(record.id)

# Certificate contains:
print(certificate.to_json())
# {
#   "certificate_id": "uuid",
#   "resource": {"type": "ephemeral_data", "id": "record-id", ...},
#   "destruction": {"method": "crypto_shred", "timestamp": "...", ...},
#   "chain_of_custody": {...},
#   "signature": "base64-signature"
# }

Development

# Clone the repo
git clone https://github.com/efsf/efsf.git
cd efsf/sdk/python

# Install dev dependencies
pip install -e ".[dev]"

# Run tests
pytest

# Run tests with Redis (requires running Redis)
pytest --redis-url redis://localhost:6379

# Type checking
mypy efsf/

# Formatting
black efsf/ tests/

License

Apache 2.0

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

efsf-0.1.0.tar.gz (21.3 kB view details)

Uploaded Source

Built Distribution

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

efsf-0.1.0-py3-none-any.whl (19.8 kB view details)

Uploaded Python 3

File details

Details for the file efsf-0.1.0.tar.gz.

File metadata

  • Download URL: efsf-0.1.0.tar.gz
  • Upload date:
  • Size: 21.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for efsf-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ccdd2029219cf7c73b982e22301153c022743d97020b5fb14087d27ae139d742
MD5 420691a1e201df4bc4e95de7b454229d
BLAKE2b-256 670358796a3bf65afd7ed4ef782d8633a5a4ba25ef4cdb9ba31042f9d42f398c

See more details on using hashes here.

Provenance

The following attestation bundles were made for efsf-0.1.0.tar.gz:

Publisher: release.yml on akshat666/ephemeral-first-security-framework

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

File details

Details for the file efsf-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: efsf-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 19.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for efsf-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c9264f54bde54502c125cdb13fa95c3138f1d70a277fefeb98fb61ea59e429ac
MD5 96bead3084407642579fbdb2a3a2b7dd
BLAKE2b-256 3680708039b7522cc51afc7443a55b801f1d526eceda1721ca02a8a670089b2e

See more details on using hashes here.

Provenance

The following attestation bundles were made for efsf-0.1.0-py3-none-any.whl:

Publisher: release.yml on akshat666/ephemeral-first-security-framework

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