Python wrapper for the XTT Trust Transit protocol securing IoT network traffic.
Project description
# xtt-python
[![PyPI version](https://badge.fury.io/py/xtt.svg)](https://badge.fury.io/py/xtt)
[![Build Status](https://travis-ci.org/xaptum/xtt-python.svg?branch=master)](https://travis-ci.org/xaptum/xtt-python)
A Python module (`xtt`) that encapsulates the [XTT Trusted
Transit](https://github.com/xaptum/xtt) protocol for securing Internet
of Things (IoT) devices.
## Installation
``` bash
pip install xtt
```
The package is published to PyPI for Python 2.7 and 3.3+ for Linux and
OS X. `pip` installs all dependencies, including `xtt` itself.
## Quick-Start
``` python
import socket
import xtt
# In these examples, we assume the id, certs, and keys needed to run
# an XTT client handshake are available as files.
# Load root certificate, used to authenticate the server
root_id = xtt.CertificateRootId.from_file("root_id.bin")
root_pubkey = xtt.ED25519PublicKey.from_file("root_pub.bin")
# Load the server id
server_id = xtt.Identity.from_file("server_id.bin")
# Load the DAA group information
group_basename = b'BASENAME'
group_gpk = xtt.LRSWGroupPublicKey.from_file("daa_gpk.bin")
group_id = xtt.GroupId(hashlib.sha256(group_gpk.data).digest())
group_cred = xtt.LRSWCredential.from_file("daa_cred.bin")
group_secretkey = xtt.LRSWPrivateKey.from_file("daa_secretkey.bin")
group_ctx = xtt.ClientLRSWGroupContext(group_id, group_secretkey,
group_cred, group_basename)
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM, 0)
sock.connect(('192.0.2.1', 4443))
xtt_sock = xtt.XTTClientSocket(sock,
version = xtt.Version.ONE,
suite_spec = xtt.SuiteSpec.XTT_X25519_LRSW_ED25519_CHACHA20POLY1305_SHA512,
group_ctx, server_id, root_id, root_pubkey)
xtt_sock.start()
my_identity = xtt_sock.identity
my_public_key = xtt_sock.longterm_public_key
my_private_key = xtt_sock.longterm_private_key
```
## Contributing
Please submit bugs, questions, suggestions, or (ideally) contributions
as issues and pull requests on GitHub.
## License
Copyright 2018 Xaptum, Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not
use this work except in compliance with the License. You may obtain a copy of
the License from the LICENSE.txt file or at
[http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0)
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
License for the specific language governing permissions and limitations under
the License.
[![PyPI version](https://badge.fury.io/py/xtt.svg)](https://badge.fury.io/py/xtt)
[![Build Status](https://travis-ci.org/xaptum/xtt-python.svg?branch=master)](https://travis-ci.org/xaptum/xtt-python)
A Python module (`xtt`) that encapsulates the [XTT Trusted
Transit](https://github.com/xaptum/xtt) protocol for securing Internet
of Things (IoT) devices.
## Installation
``` bash
pip install xtt
```
The package is published to PyPI for Python 2.7 and 3.3+ for Linux and
OS X. `pip` installs all dependencies, including `xtt` itself.
## Quick-Start
``` python
import socket
import xtt
# In these examples, we assume the id, certs, and keys needed to run
# an XTT client handshake are available as files.
# Load root certificate, used to authenticate the server
root_id = xtt.CertificateRootId.from_file("root_id.bin")
root_pubkey = xtt.ED25519PublicKey.from_file("root_pub.bin")
# Load the server id
server_id = xtt.Identity.from_file("server_id.bin")
# Load the DAA group information
group_basename = b'BASENAME'
group_gpk = xtt.LRSWGroupPublicKey.from_file("daa_gpk.bin")
group_id = xtt.GroupId(hashlib.sha256(group_gpk.data).digest())
group_cred = xtt.LRSWCredential.from_file("daa_cred.bin")
group_secretkey = xtt.LRSWPrivateKey.from_file("daa_secretkey.bin")
group_ctx = xtt.ClientLRSWGroupContext(group_id, group_secretkey,
group_cred, group_basename)
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM, 0)
sock.connect(('192.0.2.1', 4443))
xtt_sock = xtt.XTTClientSocket(sock,
version = xtt.Version.ONE,
suite_spec = xtt.SuiteSpec.XTT_X25519_LRSW_ED25519_CHACHA20POLY1305_SHA512,
group_ctx, server_id, root_id, root_pubkey)
xtt_sock.start()
my_identity = xtt_sock.identity
my_public_key = xtt_sock.longterm_public_key
my_private_key = xtt_sock.longterm_private_key
```
## Contributing
Please submit bugs, questions, suggestions, or (ideally) contributions
as issues and pull requests on GitHub.
## License
Copyright 2018 Xaptum, Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not
use this work except in compliance with the License. You may obtain a copy of
the License from the LICENSE.txt file or at
[http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0)
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
License for the specific language governing permissions and limitations under
the License.
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 Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distributions
Close
Hashes for xtt-0.9.2.post0-cp37-cp37m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | af0ec229d2e08d85bc3c6b84e47740f192c41c9cb92fe4822a842d36a0c67a7d |
|
MD5 | 8fd1a7e18459390e724c3216681ecdc3 |
|
BLAKE2b-256 | f9d00d5c1d0b5b7cb1ec951250ec4170bdea88f83aeebd8d1071ad84719b7b78 |
Close
Hashes for xtt-0.9.2.post0-cp37-cp37m-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 447c8057b7d024e6a4416592b2384891974887713def9c8a506b288732f7a0fe |
|
MD5 | ce7d0f56a9123eed2790d65791f40daa |
|
BLAKE2b-256 | 9137af4c551506e6ee228784c3d98dfefef0424ef9fd57d72229cf24f8d88b78 |
Close
Hashes for xtt-0.9.2.post0-cp36-cp36m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2b34060928ca2a242ce270bfd2fe061632b43df53fad07daa89ba4bac483f89c |
|
MD5 | 027b428e7d2c5b2861912319df27b9fa |
|
BLAKE2b-256 | 4a81733680805ed67eb1f18c446acc7925a139ba54813a85417aadda19586189 |
Close
Hashes for xtt-0.9.2.post0-cp36-cp36m-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d26828c1b8ba49d4b90ecfac91556b303c28a3c5e0c90a0d76d3e08ebd14684e |
|
MD5 | 06ef813b17e32f0535570e683e4be65a |
|
BLAKE2b-256 | 946db6bc628f0fad1a3e11cb456745c648731d612e43e5f389092f5d4dcade31 |
Close
Hashes for xtt-0.9.2.post0-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ebce26e1be722f9871057b3a2cffa67c5c4d22aec1a67db5518b88090034d5a5 |
|
MD5 | 4279d9baf79c918918d4c6dc938f256e |
|
BLAKE2b-256 | 803935bc614b2cf1b33a023910377d7a79a01bb1f96ce9dda626ba38c9ccca2e |
Close
Hashes for xtt-0.9.2.post0-cp35-cp35m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e4172924391c64c889a946ce454d0f606b0044d224938f7d1aa6b126c8d47ab9 |
|
MD5 | aaf5fea13ed9609023ff7421a9c36e38 |
|
BLAKE2b-256 | 83553ccd94b7e2f5663d653781db0cfb92a32d7b9d157ae6d8904efc4f5d6ddf |
Close
Hashes for xtt-0.9.2.post0-cp35-cp35m-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2395ab08206f23679b2a38e783e9ba2a47d5e7d7e118ebdb6dd2fb25c4c0d004 |
|
MD5 | 57b94c023b9b7caeec43a2661d3d2994 |
|
BLAKE2b-256 | 0f386569023b56976ecb086640171fbe851f45b24bb9ed34f670058983400ad6 |
Close
Hashes for xtt-0.9.2.post0-cp35-cp35m-macosx_10_6_intel.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3e91c2dea152c370307eb8b9ca459d727947c08a883bfae5253072781f561e59 |
|
MD5 | b70639164b605a1d54c1f83962bf1e98 |
|
BLAKE2b-256 | bf1c1186a70530cb33fdadba69f42a29f6857853be4f71c6f268d17aebfe4969 |
Close
Hashes for xtt-0.9.2.post0-cp34-cp34m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 70dc3b1c9b2b5ae92df21da1962a5947a1552efa01c3af45b5968b7aa38244d0 |
|
MD5 | d222b1ea6051a2f8654754f200259d16 |
|
BLAKE2b-256 | dccf28ddab94e3d790716c0396d9dbb72deb0fad7f9d8fe734de841d92204e3f |
Close
Hashes for xtt-0.9.2.post0-cp34-cp34m-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 14a52ea625b565c2cb94a9a9ecd22e2037ea671ad03be52255856e102053ec47 |
|
MD5 | 622018795a05ca4c230682ee9d56079f |
|
BLAKE2b-256 | 0a37b1940b58bb62989c3bf3173a459b4da199a3d396b750b6855f08eb5889c3 |
Close
Hashes for xtt-0.9.2.post0-cp34-cp34m-macosx_10_6_intel.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9b52f044145dfe4b177a24f2579a8f4bd94bd39d42abf7fce09b67dd1299587e |
|
MD5 | 890a50e3ac8b6237e7c16dd205b2438d |
|
BLAKE2b-256 | 61f93815189205b0613bc480f8cfa1272fd0bd8af110ef38dfaa2ac4cbe92eda |
Close
Hashes for xtt-0.9.2.post0-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5e686afbf4f67ff94d4512d57a96cd84c1edef7a5fd2e37f166dfc99196d7e70 |
|
MD5 | 25c244d728fdeb62654be58b68f9b439 |
|
BLAKE2b-256 | 60da7a929a9d9bb63c936916ea017353a2e6e1db6a7e2894cd03341a572f8ae4 |
Close
Hashes for xtt-0.9.2.post0-cp27-cp27mu-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 90e4f99a0de59287422e223759fb691fa4e1f0313dcea01cac3248d0484122cd |
|
MD5 | 93866a7dd67ef0de57662898e7cd6126 |
|
BLAKE2b-256 | a642fcc1c66c6d603e095590fe54ce85e85c39007948e982252be559b1433b9b |
Close
Hashes for xtt-0.9.2.post0-cp27-cp27m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d6e28e5b82c87f20fb5d76694355464d95b6edd01c950dddee297aa4ec918e3a |
|
MD5 | 06b0e998e90e7c413817d2f778ff567f |
|
BLAKE2b-256 | 64348031ee7ee412d909c032ae064d8145074338e6912d6416cd61d03e46b094 |
Close
Hashes for xtt-0.9.2.post0-cp27-cp27m-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 976b76ff4962efd08334ef276a405ed60c4840c991909840f555d7cf59b18b72 |
|
MD5 | 2cd42e86fd304f7ac7e99426ed8160bc |
|
BLAKE2b-256 | 9ed8e80ff00583afc2543fd9040f44ac8368d917c8569f40d1ae0d6979c61b37 |
Close
Hashes for xtt-0.9.2.post0-cp27-cp27m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 168b4b98be0937639c7092a34661b2ea285984654cc4261b409b4f05368e3c83 |
|
MD5 | 64731446614e582a1ceba22ae539c406 |
|
BLAKE2b-256 | e6296a98a389136d99763afade5c69505b9c6cf0a7497612dee07628df05a159 |