Skip to main content

Python implementation of ciphersweet

Project description

pyciphersweet

Python implementation of ciphersweet

This is a very early stage implementation of ciphersweet from https://github.com/paragonie/ciphersweet Please do not attempt to use this in production yet, as I'm not sure if everything works. There are tests that match the original ciphersweet tests and those tests are currently passing.

Currently, only the "modern" modes are supported.

Here is an example of how to create an encrypted field of the last four digits of a number:

import ciphersweet
import secrets

nacl_key = secrets.token_bytes(32)
field = ciphersweet.EncryptedField(
    base_key=nacl_key,
    table='contacts',
    field='ssn',
)
t = ciphersweet.Transformation.last_four_digits
field.add_blind_index('contact_ssn_last_four', t, output_length=16, fast=True)
index = field.get_blind_index('hello', name='contact_ssn_last_four')

print(index['value'])

For documentation on how this works, look into the original ciphersweet project.

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

ciphersweet-0.1.1.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

ciphersweet-0.1.1-py2.py3-none-any.whl (9.5 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file ciphersweet-0.1.1.tar.gz.

File metadata

  • Download URL: ciphersweet-0.1.1.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/0.11.5 CPython/3.6.5 Darwin/17.7.0

File hashes

Hashes for ciphersweet-0.1.1.tar.gz
Algorithm Hash digest
SHA256 b3718211ccfa1d4a9cc8cf45d164bc8c617315451a795c0f6becdc88b47e09f7
MD5 45f17df04c656857f4f8641770d337f4
BLAKE2b-256 2aaa30d1101f02b5346d999b0d75ee779fde29dec40553028211ee794051b3d2

See more details on using hashes here.

File details

Details for the file ciphersweet-0.1.1-py2.py3-none-any.whl.

File metadata

  • Download URL: ciphersweet-0.1.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 9.5 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/0.11.5 CPython/3.6.5 Darwin/17.7.0

File hashes

Hashes for ciphersweet-0.1.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 ce8a8c2da637b308ab65eb7903d2886d539dc2976cf69c057bc525dc7f61b5ff
MD5 29620b72171094e2d6fb43f2d50dc0b0
BLAKE2b-256 6a1a24fa99e88f4fc21d3d1cc824fa5120a11a2d4900924d2c1dad96b8fb335f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page