EnigmaBridge Python Client
Project description
`Enigma Bridge <https://www.enigmabridge.com>`__ Python client
==============================================================
With this repo you can use `Enigma Bridge <https://www.enigmabridge.com>`__ encryption service.
Installation
------------
.. code:: bash
pip install ebclient
Usage
-----
The following example assumes that you already have access to the encryption server, i.e., you have a valid api key,
which in this case is 'API_TEST'.
Calling processData():
.. code:: python
from ebclient.process_data import ProcessData
from ebclient.uo import Configuration, Endpoint, SimpleRetry, UO
from ebclient.crypto_util import *
# Construct general configuration (endpoint, request config)
cfg = Configuration()
cfg.endpoint_process = Endpoint.url('https://site2.enigmabridge.com:11180')
cfg.api_key = 'API_TEST'
# UO you want to work with
uo_aes = UO(uo_id=0xee01,
uo_type=0x4,
enc_key=from_hex('e134567890123456789012345678901234567890123456789012345678901234'),
mac_key=from_hex('e224262820223456789012345678901234567890123456789012345678901234'),
configuration=cfg)
# ProcessData itself
pd = ProcessData(uo=uo_aes, config=cfg)
result = pd.call(from_hex('6bc1bee22e409f96e93d7e117393172a'))
print(from_hex('95c6bb9b6a1c3835f98cc56087a03e82') == result)
For more usage examples please refer to tests and our `API
documentation <https://api.enigmabridge.com/api/?python>`__.
Dependencies
------------
.. code:: bash
pip install pycrypto requests
Or to install to home directory
.. code:: bash
pip install --user pycrypto requests
If the error ``ImportError: No module named Crypto`` is thrown it's
needed to run pip with ``--upgrade`` and update pycrypto to the latest
version.
Compatibility
-------------
We should be compatible with Python 2.6+ and Python 3+.
Troubleshooting
---------------
Error in installation of dependencies (cryptography, pyOpenSSL):
``sorry, but this version only supports 100 named groups``
[`100-named-groups <https://community.letsencrypt.org/t/certbot-auto-fails-while-setting-up-virtual-environment-complains-about-package-hashes/20529/18>`__]
Solution: Install downgraded version of pycparser and pyOpenSSL:
::
pip install pycparser==2.13
pip install pyOpenSSL==0.13
pip install cryptography
You may need to install some deps for the python packages
::
yum install gcc g++ openssl-devel libffi-devel python-devel
SNI on Python < 2.7.9
~~~~~~~~~~~~~~~~~~~~~
TLS SNI support was added to Python. For earlier versions SNI needs to
be added to Requests networking library.
::
pip install urllib3
pip install pyopenssl
pip install ndg-httpsclient
pip install pyasn1
Mac OSX installation
~~~~~~~~~~~~~~~~~~~~
For new OSX versions (El Capitan and above) the default system python
installation cannot be modified with standard means. There are some
workarounds, but one can also use ``--user`` switch for pip.
::
pip install --user cryptography
==============================================================
With this repo you can use `Enigma Bridge <https://www.enigmabridge.com>`__ encryption service.
Installation
------------
.. code:: bash
pip install ebclient
Usage
-----
The following example assumes that you already have access to the encryption server, i.e., you have a valid api key,
which in this case is 'API_TEST'.
Calling processData():
.. code:: python
from ebclient.process_data import ProcessData
from ebclient.uo import Configuration, Endpoint, SimpleRetry, UO
from ebclient.crypto_util import *
# Construct general configuration (endpoint, request config)
cfg = Configuration()
cfg.endpoint_process = Endpoint.url('https://site2.enigmabridge.com:11180')
cfg.api_key = 'API_TEST'
# UO you want to work with
uo_aes = UO(uo_id=0xee01,
uo_type=0x4,
enc_key=from_hex('e134567890123456789012345678901234567890123456789012345678901234'),
mac_key=from_hex('e224262820223456789012345678901234567890123456789012345678901234'),
configuration=cfg)
# ProcessData itself
pd = ProcessData(uo=uo_aes, config=cfg)
result = pd.call(from_hex('6bc1bee22e409f96e93d7e117393172a'))
print(from_hex('95c6bb9b6a1c3835f98cc56087a03e82') == result)
For more usage examples please refer to tests and our `API
documentation <https://api.enigmabridge.com/api/?python>`__.
Dependencies
------------
.. code:: bash
pip install pycrypto requests
Or to install to home directory
.. code:: bash
pip install --user pycrypto requests
If the error ``ImportError: No module named Crypto`` is thrown it's
needed to run pip with ``--upgrade`` and update pycrypto to the latest
version.
Compatibility
-------------
We should be compatible with Python 2.6+ and Python 3+.
Troubleshooting
---------------
Error in installation of dependencies (cryptography, pyOpenSSL):
``sorry, but this version only supports 100 named groups``
[`100-named-groups <https://community.letsencrypt.org/t/certbot-auto-fails-while-setting-up-virtual-environment-complains-about-package-hashes/20529/18>`__]
Solution: Install downgraded version of pycparser and pyOpenSSL:
::
pip install pycparser==2.13
pip install pyOpenSSL==0.13
pip install cryptography
You may need to install some deps for the python packages
::
yum install gcc g++ openssl-devel libffi-devel python-devel
SNI on Python < 2.7.9
~~~~~~~~~~~~~~~~~~~~~
TLS SNI support was added to Python. For earlier versions SNI needs to
be added to Requests networking library.
::
pip install urllib3
pip install pyopenssl
pip install ndg-httpsclient
pip install pyasn1
Mac OSX installation
~~~~~~~~~~~~~~~~~~~~
For new OSX versions (El Capitan and above) the default system python
installation cannot be modified with standard means. There are some
workarounds, but one can also use ``--user`` switch for pip.
::
pip install --user cryptography
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
ebclient-1.1.11.tar.gz
(21.7 kB
view details)
Built Distribution
File details
Details for the file ebclient-1.1.11.tar.gz
.
File metadata
- Download URL: ebclient-1.1.11.tar.gz
- Upload date:
- Size: 21.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: Python-urllib/3.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4197df012d3ca66e24da40386b0bf5d71f85a94779d7afbff803f4951de21f0d |
|
MD5 | 2c65e22fc75e4af02326346b953a22cb |
|
BLAKE2b-256 | d8c7e8b5206b096b9cfd6c4ad033ada835637d50ea8c44bd8bf4e34c25747cd6 |
File details
Details for the file ebclient-1.1.11-py2.py3-none-any.whl
.
File metadata
- Download URL: ebclient-1.1.11-py2.py3-none-any.whl
- Upload date:
- Size: 29.7 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: Python-urllib/3.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a2f54ab612f5fd6f5bb0e7af8b5d525944d6904e4e9d2f490d7fc5e05167bfed |
|
MD5 | 8a4c39bd16e461bfebabfb9668a57ff1 |
|
BLAKE2b-256 | 1fa6d6fadb30facbb56e83b537f0897ec686c24e80e8c4664c846902e8075b2e |