Skip to main content

The EntX encryption library for python.

Project description

EntX - The Python Encryption Library

EntX Encryption and Decryption

How to create an encryption client with password stored in an environment variable:

import os
import entx

client = entx.Client(os.environ["password"])

How to encrypt a string

import os
import entx

client = entx.Client(os.environ["password"])
to_encrypt = "This will be encrypted"
encrypted = client.encrypt(to_encrypt)

How to decrypt a string

import os
import entx

client = entx.Client(os.environ["password"])
to_decrypt = "This will be decrypted"
encrypted = client.decrypt(to_decrypt)

EntX Storage

JSON

EntX supports JSON reading and writing, allowing you to store and read dictionaries in the .json format, automatically encrypting and decrypting the data with the password provided.

How to create a JSON client with a password stored in an environment variable:

import os
from entx.storage import JSONClient

client = JSONClient(os.environ["password"])

How to convert a dictionary to an encrypted JSON string:

import os
from entx.storage import JSONClient

client = JSONClient(os.environ["password"])
to_encrypt_dictionary = {"keys": "values"}
dictionary_json_string = client.dumps(to_encrypt_dictionary)

How to write a dictionary to an encrypted JSON file:

import os
from entx.storage import JSONClient

client = JSONClient(os.environ["password"])
to_encrypt_dictionary = {"keys": "values"}
with open("demo.json", "w") as output_file:
    client.dump(to_encrypt_dictionary, output_file)

How to read a dictionary from an encrypted JSON string:

import os
from entx.storage import JSONClient

client = JSONClient(os.environ["password"])
encrypted_json_string = "your string here"
decrypted_dictionary = client.loads(encrypted_json_string)

How to read a dictionary from an encrypted JSON file:

import os
from entx.storage import JSONClient

client = JSONClient(os.environ["password"])
with open("demo.json", "r") as input_file:
    decrypted_dictionary = client.load(input_file)

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

entx-2.0.1.tar.gz (3.2 kB view details)

Uploaded Source

Built Distribution

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

entx-2.0.1-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

Details for the file entx-2.0.1.tar.gz.

File metadata

  • Download URL: entx-2.0.1.tar.gz
  • Upload date:
  • Size: 3.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.0

File hashes

Hashes for entx-2.0.1.tar.gz
Algorithm Hash digest
SHA256 88d56f0d5d51a7a9a7de0026e804d6f9b6fe1708d73b607afa8dcd470b6f8771
MD5 a47f7cf278d46cbf770ee88b6f8abc52
BLAKE2b-256 b3065b19305bda3c70921534e2efa90e6d69ac21f63d5ce53f71d1500d0e8bc7

See more details on using hashes here.

File details

Details for the file entx-2.0.1-py3-none-any.whl.

File metadata

  • Download URL: entx-2.0.1-py3-none-any.whl
  • Upload date:
  • Size: 4.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.0

File hashes

Hashes for entx-2.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 33ebd23d9a149cae47e119486f0977cf7e12e15c30ec28f4dab6a1e319213871
MD5 d8ed03484a84c5f8d66493f16e1343d5
BLAKE2b-256 921ec2ebf9a05ad1b4df3d812e2b7fff396e3f0bb2bcdc6bc4598188519a86ff

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