Skip to main content

A crypto library for encrypting text data.

Project description

Alguns

Alguns is a symmetric encryption method that contains 2 keys, without which decryption of the message is impossible.

Alguns also uses 128-bit AES in CBC mode and PKCS7 padding.

Letters and symbols are encrypted using the replacement method generate_replacement. A replacement character for a letter consists of [randomSymbol, randomNumber(0,99), randomSymbol, randomNumber(0,99)]. A Alguns key as returned by the generate_key actually contains two 16-byte keys: A signing key used to sign the HMAC.

A private key used by the encryption. These two values are concatenated to form a 32 byte value. This 32 byte key is then encoded using Base64 encoding. This encodes the binary quantity as string of ASCII characters. The variant of Base64 used is URL and filename safe, meaning that it doesn't contain any characters that aren't permitted in a URL or a valid filename in any major operating system.


Supported Languages:

  • Russian
  • English

Installation

The installation method for this module is shown below.

pip3 install alguns


How generate keys?
key = Alguns.generate_key()
replacement = Alguns.generate_replacement()
# Put this somewhere safe!
How to encrypt a message?
mykey = # My key that I created earlier.
myreplacement = # My replacement that I created earlier.
al = Alguns(key=mykey, replacement=myreplacement)
msgcrypt = al.encrypt('Hellow it is my message! Привет, это мое сообщение...')
print(msgcrypt)
# gAAAAABewxb_nE1mbHgN7ma79_XAbh68hLblIFdX3czIEmUDCSFWxMXTTEdIU5...
How to decrypt a message?
al = Alguns(key=mykey, replacement=myreplacement)
msgdecrypt = al.decrypt('gAAAAABewxb_nE1mbHgN7ma79_XAbh68hLblIFdX3czIEmUDCSFWxMXTTEdIU5...')
print(msgdecrypt)
# Hellow it's my 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

alguns-0.1.4.tar.gz (5.5 kB view details)

Uploaded Source

Built Distributions

alguns-0.1.4-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

alguns-0.1.4-py2.py3-none-any.whl (7.4 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file alguns-0.1.4.tar.gz.

File metadata

  • Download URL: alguns-0.1.4.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.4 CPython/3.7.4 Windows/10

File hashes

Hashes for alguns-0.1.4.tar.gz
Algorithm Hash digest
SHA256 5502f8422dad70adcd3f0c31ffee17ec169d37de4181fb86c745713c3aff212f
MD5 7320b7a51278a0fc38977a7e5c02272d
BLAKE2b-256 95b6cabf0c56ab5673f73a63568d34e5c21139e9724e9d43aeece0bd24870257

See more details on using hashes here.

File details

Details for the file alguns-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: alguns-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 7.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.4 CPython/3.7.4 Windows/10

File hashes

Hashes for alguns-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 78b5ba1fb8185b3b9cfd3bdd182a6e130adbcde9d1ad5d80f8146d230f1c7af8
MD5 16d71cbd96b67761694be1f191465828
BLAKE2b-256 133f92226b7ecb66e703d42784e67fbfb0494cb47b2f6a528f8b52cfd1592ab5

See more details on using hashes here.

File details

Details for the file alguns-0.1.4-py2.py3-none-any.whl.

File metadata

  • Download URL: alguns-0.1.4-py2.py3-none-any.whl
  • Upload date:
  • Size: 7.4 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.4 CPython/3.7.4 Windows/10

File hashes

Hashes for alguns-0.1.4-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 a301b23fb8e20fc7e1d8b63790ef111432f0ecc63bbbec7ce2f9658637c2c800
MD5 5b083bdf51a3eb59eafac54ee2ced210
BLAKE2b-256 3f45432aaf6f9df313b5275bf9dc275b70a910ab91525c4c328019abc7f40581

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