Skip to main content

VerseGroups encryption manager class (RSA and Fernet wrapped AES sessions through RSA) for secure transmission of data. Also includes utilities such as hashing, salting and base64 encoding.

Project description

vgem (python edition)

VerseGroup's native encryption manager adapted for python applications.

Function

EM is an efficient manager to allow for easy encryption/decryption/secure session management, without having to code for specific algorithims, as long as the client/reciever uses this same package (or alternative language equivalent).

EM prefers the OOP approach, in order to reduce the amount of key passing and similar tedious tasks. Simply initiate an EM instance empty to generate a new set of keys, or pass in existing keys (serialized or object formatted) to use. Supports mainly RSA assymetric encryption, but also hybrid encryption with RSA generated fernet wrapped AES sessions.

EM also provides utilities such as hashing and base64 encoding.

RSA and Fernet-AES explained

RSA is assymetric encryption, which uses private and public keys to send encrypted messages. Private keys can decrypt messages and public keys can only encrypt messages. A server wishing to recieve encrypted messages would distribute its public keys freely, and then decrypt incoming messages with its' private key. For two-way encryption, two servers would each send eachother their public keys, and decrypt messages with their private keys.

Symmetric keys is less secure as it uses one key that can both encrypt and decrypt. RSA is efficient and more secure than fernet, but can sometime be slow and tedious. So, hybrid encryption is an option. Both servers use their RSA keys to send eachother a symmetric key to use (fernet key) and they then communicate with that fernetkey that only they know (this uses RSA to securly send over the symmteric key).

vgem's EM class supports both use cases.

How to Use

Through terminal with an activated virtualenv:

pip install vgem

In python:

from vgem import EM

Then you have access to the EM class.

Example usage of RSA:

from vgem import EM

handler = EM()

message = "A very secret message"

encrypted_message = handler.encrypt(message)

private_key = handler.serialize_private_key()

handler2 = EM(serialized_private_key = private_key)

decrypted_message = handler2.decrypt(encrypted_message)

assert message == decrypted_message

Documentation

class EM

utils subdir for alternative approach (OOP prefered instead though)

Attributes

  • RSA private key
  • RSA public key
  • Fernet object
  • Fernet key

Construction

  • Optional Paramaters:
    • RSA private key
    • RSA public key
    • Serialized RSA private key
    • Serialized RSA public key
    • Fernet key
    • Encrypted fernet key
  • EM will construct anything else essential and not passed in

Methods

  • Serialize private/public RSA keys
  • Encrypt/Decrypt using RSA keys
  • Load new fernet sessions
  • Encrypt/Decrypt using fernet session
  • Serialize/Deserialize RSA encrypted fernet keys
  • Base64 encoding option for all encrypting and serialization

New

  • hashing and salting!

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

vgem-1.3.0.tar.gz (8.2 kB view details)

Uploaded Source

Built Distribution

vgem-1.3.0-py3-none-any.whl (10.6 kB view details)

Uploaded Python 3

File details

Details for the file vgem-1.3.0.tar.gz.

File metadata

  • Download URL: vgem-1.3.0.tar.gz
  • Upload date:
  • Size: 8.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for vgem-1.3.0.tar.gz
Algorithm Hash digest
SHA256 d47dd643554681e7b77de6aba584f182dfa8b1a70249085536d756c1d3d1a8a5
MD5 4b4b5049611971da626bd68d10d926f1
BLAKE2b-256 af99b3a6248aeb6f43708f22f0b9ee8b5856d7657d73285b69a00276f6b19aae

See more details on using hashes here.

File details

Details for the file vgem-1.3.0-py3-none-any.whl.

File metadata

  • Download URL: vgem-1.3.0-py3-none-any.whl
  • Upload date:
  • Size: 10.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for vgem-1.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c326a29f5f1e61809ddfbab487adfb8e1ed438cef2e24a7158c27fb8d0c1ef18
MD5 2569dd9195a7ba859258c5213bacf89b
BLAKE2b-256 9cf93e6a42de463cbfc3dab352dd51d5d73d0ab955b1a8523050bff0fb353c92

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page