Giter Site home page Giter Site logo

python-crypto's Introduction

crypto

Python library for simply text cryptography.

Documentation

Instalation

Instalation is very simple over pip. # pip install crypto

Functions

Generate keys pair

import crypto
key_length = 256
public, private = crypto.newkeys(key_length)

Export key to string, file

public_string = crypto.export_key(public)  # export key to string
crypto.export_key_file(public, "id_rsa.pub")  # expo key to string

Load key to string, file

public = crypto.load_key(public_string)  # load key from string
private = crypto.load_key_file("id_rsa.pub")  # load key from string

Encrypt to bin

message = "My secret message"
encrypted = crypto.encrypt(message, public)

Decrypt from bin

message = crypto.decrypt(encrypted, private)

Encrypt to string

message = "My secret message"
encrypted = crypto.encrypt_str(message, public)

Decrypt from string

message = crypto.decrypt_str(encrypted, private)

Bitdeli Badge

python-crypto's People

Contributors

bitdeli-chef avatar ondrejsika avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.