Skip to main content

My collection of my tools

Project description

  1. Egor Ternovoy. 2020

!!! NOT SO SAFE! It is possible to reverse calculate source bytes from hash! !!!

Uses library random

Documentation can be found here.

Usage:

import egter

# ------- hashing -------

hash = egter.hash.EHash(b'some bytes', lenght=32, iterations=100)  # lenght - bytes count

print(hash) # equal to hexdigest method
# 90b0f287805156865bfebbf93eac3328ab0e9bcbb82dfcc9d5f88d6d41524766

print(hash.digest()) # bytes
# b'\x90\xb0\xf2\x87\x80QV\x86[\xfe\xbb\xf9>\xac3(\xab\x0e\x9b\xcb\xb8-\xfc\xc9\xd5\xf8\x8dmARGf'

print(hash.hexdigest())
# 90b0f287805156865bfebbf93eac3328ab0e9bcbb82dfcc9d5f88d6d41524766

print(hash.intdigest())
# 65445689155113512790458496256639542022557958647760937310771143133228635932518

hash.update(b'add bytes to hash')
print(hash.hexdigest())
# 591822f89a114ede35c8ac4a4ebeda6952fd6f4114a9434ebe27b1b8fc6b0d2a

# set custom seed
hash.generate(b'some seed')
print(hash.hexdigest())
# a2c401e4e18b0ebda141fd63da4a0efbc9253b9d204e6c24381b9bd45ec4abc1

hash2 = egter.hash.EHash(int) # equal to egter.EHash('<class 'int'>')
print(hash)
# a7eb7705b8a37e77df4a48882584b4bcfa20377b305bdae586784636be9ba255

custom_hash = egter.hash.EHash('custom hash', custom=(1, 2, 3), custom_type=str) # custom_type = str|bytes,
                                                                           #custom = iterable type
print(custom_hash.customdigest())
# 11321321121122112121111133122213


# ------- steganographing -------

s = egter.crypt.steganography.Steganography(egter.crypt.steganography.defaults.steganography_list)
enc = s.encode(b'some bytes')
dec = s.decode(enc)
print(enc, dec)
# Viverra facilisisu eue nisla elita nisio luctuso litorae, nisla; viverra b'some bytes'


# ------- encrypting -------

# Enigma
e = egter.enigma.Enigma(egter.enigma..generate_configuration(b'pass'), b'pass')
enc = e.encode(b'hello')
dec = e.decode(enc)
print(enc, dec)
# b'\\xa7G&\\x1cP' b'hello'

# Random encryption
e = egter.enigma.RandomCrypt(b'pass')
enc = e.encode(b'text')
dec = e.decode(enc)
print(enc, dec)
# b'\\x07^\\x1b\\r' b'text'

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

egter-0.3.3.tar.gz (10.1 kB view details)

Uploaded Source

File details

Details for the file egter-0.3.3.tar.gz.

File metadata

  • Download URL: egter-0.3.3.tar.gz
  • Upload date:
  • Size: 10.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.5

File hashes

Hashes for egter-0.3.3.tar.gz
Algorithm Hash digest
SHA256 99e49552f1f7fc4365674c4dba3c12ed469ccb9a0f645b0d7d1e12da39831ceb
MD5 13513474d952be4937f4a26b42cb915a
BLAKE2b-256 c35db01d28241e100e0eacf3fe8fd282b7c16f6f63ff651670c6acaabfb31875

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