Skip to main content

Encrypt your private data with aes256+hmac

Project description

Lockis

Easily encrypt your sensitive data with aes256+hmac and with ttl.

# generate secret key (96 bytes)
key = gkey()

# initilize secret key
key = lockis(key)

# encrypt message
key.encrypt()

# decrypt message
key.decrypt(data, ttl=10)

You can also specify ttl, this will help protect against replay attacks.

>>> from lockis import gkey, lockis
>>> key = gkey()
>>> key = lockis(key)
>>> key.encrypt(b"hello everyone, its a test message!")
b'EAAAAABnhh92pdLhypQcEsvwh4YUMuwzNg8RiQE2pJLnkT9Ru8tUSXvN6XGi3eeO1q-OiLD_E66pCpymr8Jw_BtrXB6Q1i9SeHe3l-NiCvGRZD2WOEmzjjH7MnyO7Haiw-hHdvs8SFZJgpssxR_tLAEvRaDcV9scC7Gfd2kwmdsok8wrRNvlpkE='
>>> key.decrypt(b'EAAAAABnhh92pdLhypQcEsvwh4YUMuwzNg8RiQE2pJLnkT9Ru8tUSXvN6XGi3eeO1q-OiLD_E66pCpymr8Jw_BtrXB6Q1i9SeHe3l-NiCvGRZD2WOEmzjjH7MnyO7Haiw-hHdvs8SFZJgpssxR_tLAEvRaDcV9scC7Gfd2kwmdsok8wrRNvlpkE=', ttl=60)
hello everyone, its a test message!

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

lockis-1.0.0.tar.gz (2.9 kB view details)

Uploaded Source

File details

Details for the file lockis-1.0.0.tar.gz.

File metadata

  • Download URL: lockis-1.0.0.tar.gz
  • Upload date:
  • Size: 2.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for lockis-1.0.0.tar.gz
Algorithm Hash digest
SHA256 04b8d34c0251a99b604a31100fb6975fe6d3da090a7b0c1f250fb04a89fd62fa
MD5 582f4b682131b9727b560fff9eeac18b
BLAKE2b-256 fee202d5d1dc9329731bd1677887bfabb747601fb486ec719b9f13e0bab07506

See more details on using hashes here.

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