Skip to main content
Latest Version Supported Python Versions ci

Client-side encryption for S3

You can find the source on GitHub.

Getting Started

Required Prerequisites

  • Python 3.6+

Installation

Usage

import boto3
from s3_encryption_sdk import EncryptedClient
from s3_encryption_sdk.materials_providers import KmsMaterialsProvider


materials_provider = KmsMaterialsProvider(
   key_id="alias/YourAlias",
   client=boto3.client("kms", region_name="us-east-1"),
)

s3 = boto3.client("s3", region_name="us-east-1")

crypto_s3 = EncryptedClient(
   client=s3,
   materials_provider=materials_provider,
)

key = "4711"
plaintext = "foo bar"

crypto_s3.put_object(
   Bucket=bucket.name,
   Key=key,
   Body=plaintext,
)

encrypted_obj = s3.get_object(
   Bucket=bucket.name,
   Key="object",
)

decrypted_obj = crypto_s3.get_object(
   Bucket=bucket.name,
   Key="object",
)

assert plaintext != encrypted_obj["Body"].read().decode("utf8")
assert plaintext == decrypted_obj["Body"].read().decode("utf8")

Metadata

Release files for s3-encryption-sdk 0.0.3

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

Source distribution (sdist)

Source distribution for s3-encryption-sdk 0.0.3
File Size Uploaded
s3-encryption-sdk-0.0.3.tar.gz 9.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for s3-encryption-sdk 0.0.3
File Interpreter ABI Platform
s3_encryption_sdk-0.0.3-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 25.9 kB

Release files / s3-encryption-sdk-0.0.3.tar.gz

Download URL s3-encryption-sdk-0.0.3.tar.gz
Size 9.3 kB
Tags Source
SHA-256 checksum
How to use checksums
2031f46f5082113be58d2cd658b268b030b3d8c86fd54315ba3c588189f27ccb
BLAKE2b-256 checksum
How to use checksums
b187ce6f8455510dfd882c7d329f461a02e8ee88db525b45ad198d74da0d9ee1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.9.1

Release files / s3_encryption_sdk-0.0.3-py2.py3-none-any.whl

Download URL s3_encryption_sdk-0.0.3-py2.py3-none-any.whl
Size 16.6 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
f0460654a34d0dbfd036469fa20729b181c65ffeda044b4de18bf0092997fdb4
BLAKE2b-256 checksum
How to use checksums
5f6732d79fa4a29f10315899ec8271023712f34fdc0a6577819e9abdafb4dd13
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.9.1

Release history Release notifications | RSS feed

This release

0.0.3 This release

2 release files

0.0.2

2 release files

0.0.1

2 release files

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