Skip to main content

Toolkit for securing information into a database

Project description

Cryha is a Python toolkit for securing information into a data base; it lets hash passwords, and encrypt/decrypt personal information. It is ready for input of Unicode characters, and the schema is returned as Unicode.

The text is stored according to this schema for a hash:

separator, the hash function identifier, separator, the salt, separator, the hash output

And this another for a cipher text:

separator, the cipher identifier, separator, the mode identifier, separator, the IV parameter, separator, the ciphertext

The idea of the schema has been taken of Linux systems that store the hashed passwords so, using a $ as separator.

The use of a schema let us to store the salt (for hash) and IV (for cipher) –which must be unique for each field–, together to the parameters that has been used to hashing/encrypting the text.

The salt and IV parameters are obtained from a random string –using the PRNG of the operating system– into a domain of 256 possible values for greater security.

[PRNG]

Pseudo random number generator. In Linux is /dev/urandom.

Use

Typical usage:

>>> import cryha

Hasher:

>>> hasher = cryha.Hasher()
>>> hash = hasher.create('text')
>>> hasher.valid('text', hash)
True
>>> hasher.valid('Text', hash)
False

Crypter:

>>> crypter = cryha.Crypter(root_keyfile='.', dir_keyfile='test_crypter')
>>> crypt = crypter.encrypt('text')
>>> crypter.decrypt(crypt) == 'text'
True

Project details


Release history Release notifications | RSS feed

This version

1.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cryha-1.0.tar.gz (22.1 kB view details)

Uploaded Source

File details

Details for the file cryha-1.0.tar.gz.

File metadata

  • Download URL: cryha-1.0.tar.gz
  • Upload date:
  • Size: 22.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for cryha-1.0.tar.gz
Algorithm Hash digest
SHA256 3b894bf121d3c5e74efc176d60de82c8761293315f1979c9d597f59bb58beed0
MD5 83c1a1e7e3b80b60b096dc4608f5103d
BLAKE2b-256 b7f83b2ee5d168f1f4ac7b5c2ef159eefe5f227d1bd9051f6d6a8be9dab4fb22

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