My collection of my tools
Project description
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'
# ------- customs -------
list = egter.customs.List
l = list([1,2,3])
# equal to dict.get
l.get(2)
# 3
l.get(3)
# None
l.get(3, 'not found')
# not found
l.get(3, 45)
# 45
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.4.tar.gz
(10.4 kB
view details)
File details
Details for the file egter-0.3.4.tar.gz
.
File metadata
- Download URL: egter-0.3.4.tar.gz
- Upload date:
- Size: 10.4 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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7b7abd5417c49bf8e265ac7593987aaca0670c861ee32694ed11d8334315535f |
|
MD5 | 9345cebdfa9e20aa3169cce1b1513a84 |
|
BLAKE2b-256 | 52bb6bb9b078e72dca5ffa5c0d566bb411c8aac4c853d1c264ccf9b0c257f58f |