Skip to main content

A tiny asymmetric/symmetric encryption lib for humans.

Project description

kripta-py

An simple implementation of a Symmetric(AES) and Asymmetric(RSA) encryption based on pycryptodome module.

Requirements

  • Python (3.10 recommended)

Features

  • Generate RSA keys like
  • Encrypt/Decrypt messages, files, binaries on symmetric or asymmetric

How to use

  • Install the lib
pip install kripta-py
  • To use the symmetric encryption (AES):

    • Schema :

      drawing

    • Code :

      from kripta_py import KriptaAES
      
      
      message = "secret-message"
      secret_key = "secret-code-password"
      
      k = KriptaAES()
      # to encrypt
      encrypted_msg = k.encrypt(message, secret_key)
      
      # to decrypt
      print(k.decrypt(encrypted_msg1, secret_key).decode())
      # secret-message 
      
  • To use an asymmetric encryption (RSA):

    • Schema :

      drawing

    • Code example:

      from kripta_py import KriptaRSA
      
      
      message = "secret-message"
      pub_key = """-----BEGIN PUBLIC KEY-----
      ....
      -----END PUBLIC KEY-----"""
      
      k = KriptaRSA()
      k.setPublicKey(pub_key)
      # To encrypt a message
      encrypted_msg = k.encrypt(k.getPublicKey(), message.encode())
      
      priv_key = """-----BEGIN RSA PRIVATE KEY-----
      .....
      -----END RSA PRIVATE KEY-----"""
      
      k.setPrivateKey(priv_key)
      # To decrypt
      print(k.decrypt(encrypted_msg).decode())
      # secret-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

kripta-py-0.1.3.tar.gz (5.5 kB view hashes)

Uploaded Source

Built Distribution

kripta_py-0.1.3-py3-none-any.whl (5.7 kB view hashes)

Uploaded Python 3

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