GithubHelp home page GithubHelp logo

tim-weller-wolfssl / wolfcrypt-py Goto Github PK

View Code? Open in Web Editor NEW

This project forked from wolfssl/wolfcrypt-py

0.0 0.0 0.0 2.34 MB

A Python wrapper that encapsulates wolfSSL's wolfCrypt API.

Home Page: https://wolfssl.github.io/wolfcrypt-py

Python 96.99% C 1.55% Makefile 1.46%

wolfcrypt-py's Introduction

wolfcrypt: the wolfSSL Crypto Engine

wolfCrypt Python, a.k.a. wolfcrypt is a Python module that encapsulates wolfSSL's wolfCrypt API.

wolfCrypt is a lightweight, portable, C-language-based crypto library targeted at IoT, embedded, and RTOS environments primarily because of its size, speed, and feature set. It works seamlessly in desktop, enterprise, and cloud environments as well. It is the crypto engine behind wolfSSL's embedded ssl library.

Compiling

Windows

Install the following on Windows:

Then from the command line install tox and CFFI using:

pip install tox cffi

You can then build the source distribution packages using:

python setup.py sdist

Linux

The setup.py file covers most things you will need to do to build and install from source. As pre-requisites you will need to install either from your OS repository or pip. You'll also need the Python development package for your Python version:

  • cffi
  • tox
  • pytest

To build a source package run python setup.py sdist, to build a wheel package run python setup.py bdist_wheel. To test the build run tox. The tox tests rely on Python 3.9 being installed, if you do not have this version we recommend using pyenv to install it.

Installation

We provide Python wheels (prebuilt binaries) for OSX 64 bits and Linux 64 bits:

$ pip install wolfcrypt

To build wolfcrypt-py against a local installation of the native C wolfSSL library, use the USE_LOCAL_WOLFSSL variable. This variable should be

wolfcrypt-py can be built against a local version of the native wolfSSL library by using pip with the USE_LOCAL_WOLFSSL variable. USE_LOCAL_WOLFSSL should be set equal to the installation path for the wolfSSL library:

$ USE_LOCAL_WOLFSSL=/path/to/wolfssl/install pip install .

If building wolfcrypt-py against a local wolfSSL library, wolfcrypt-py will attempt to do native feature detection to enable/disable wolfcrypt-py features based on how native wolfSSL has been compiled. It uses the <wolfssl/options.h> header to do feature detection.

Testing

>>> from wolfcrypt.hashes import Sha256
>>> Sha256('wolfcrypt').hexdigest()
b'96e02e7b1cbcd6f104fe1fdb4652027a5505b68652b70095c6318f9dce0d1844'

Testing wolfcrypt's source code with tox

To run the unit tests in the source code, you'll need tox and a few other requirements.

  1. Make sure that the testing requirements are installed:
$ sudo -H pip install -r requirements/test.txt
  1. Run tox:
$ tox
...
_________________________________ summary _________________________________
py3: commands succeeded
congratulations :)

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.