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.post1-cp37-cp37m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 59d05b760478eda14bd6f4317ac6e4cce3c6205fb6670687716ab6fddad33074 |
|
MD5 | 48c95e6bc42d12557e0abafa042954ff |
|
BLAKE2b-256 | c3bb2b97b245bf1a4ce1108b1719e0da6fb29171c9c2a5c4065ff1e34d1668fe |
Close
Hashes for xtt-0.9.2.post1-cp37-cp37m-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | aebe2ce860936e4b5712cc517cde3e73444fdd4c6daf4cf0065422ba1e58c551 |
|
MD5 | 8f332c101a01a5984bce3c42064fe7ea |
|
BLAKE2b-256 | 249380902e548e5a27df6aa12f9edd719b0ca214b7e4c179cea10b971170ca62 |
Close
Hashes for xtt-0.9.2.post1-cp36-cp36m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3c2424591c26e59ca58b6813b95de406541028b8430e01c17dcb1ef4423ff0e9 |
|
MD5 | 2074267310f3db4d72d41db5e321f3d0 |
|
BLAKE2b-256 | 974406dd2a440eb16b019c4ffb0df52434c703598509218455cc93b85ba122ec |
Close
Hashes for xtt-0.9.2.post1-cp36-cp36m-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | db7d8348f3feaf52b8bb729e94895bb0888023e2a653c5b5d777712a7c61a8b7 |
|
MD5 | 619da44ce60cbb4834ee3c143e841c1b |
|
BLAKE2b-256 | 7ae1f13b769d913a7f573e5632ecdd8b5c785aef97f3984e646af3c6be42322f |
Close
Hashes for xtt-0.9.2.post1-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7926153920760db8cba014b983ca38d0229ac044d1e0f5a181503e264114e6ac |
|
MD5 | 39a1bdb8f4fbd4c26f21c165382edd58 |
|
BLAKE2b-256 | 5f727d105d9775b25ac503396e05bca7446053658855b08c7debe09d4f42ea74 |
Close
Hashes for xtt-0.9.2.post1-cp35-cp35m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dd889d4a0de05128cd40a8f2bd5efd37408640b2a56947d5b1a53be10a0a7798 |
|
MD5 | 0bd334fa57f976a8b2cf7ec543266f0c |
|
BLAKE2b-256 | 975cf8aae0f9f8d6715bce0d171d04303ef277123132d6b66c1876c6f148a883 |
Close
Hashes for xtt-0.9.2.post1-cp35-cp35m-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d6c542c2aecb0dcb3c200290844f78c5104c68faf5a2393c63847bd1a5eb085f |
|
MD5 | d9a4d8e745ffe131a371ef786dad487b |
|
BLAKE2b-256 | 647d4e62916ad173ca4a4998a0d1a3bee1e3f8575993af927e029030fb26d262 |
Close
Hashes for xtt-0.9.2.post1-cp35-cp35m-macosx_10_6_intel.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2345be0fa93a5805561e912768522498b67cff47c01820586f1fa5aca176cc68 |
|
MD5 | 3dd5dfa68c2502ef54a2971ffc233495 |
|
BLAKE2b-256 | 8888fe43df7ddd4e9d69b10c35989c709f21823d22aaaf35fb5c8bcf492ff019 |
Close
Hashes for xtt-0.9.2.post1-cp34-cp34m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f56ef430de8b7842ac74914c3c7a0dc444241b7b7777281f6e8de5f751e6d17d |
|
MD5 | fced98f746479983b4f26b29d61e2013 |
|
BLAKE2b-256 | 59c744ab118c4d849743b495f87e91cf23e8c9173144566b9a0cb2e330205a63 |
Close
Hashes for xtt-0.9.2.post1-cp34-cp34m-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1ddbeab40f19e51732c5395dbb7144d67683aa8ee7c04bffa6526bf070c8d97e |
|
MD5 | ad2623ff0a5cc588f2a0001095c481e3 |
|
BLAKE2b-256 | 841a99b4e9df95a00566a9f4a31c7487438012c275d42bd5031fc138ca7483ac |
Close
Hashes for xtt-0.9.2.post1-cp34-cp34m-macosx_10_6_intel.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 422f282ac3c5fe719629c21b5368eaa1babf1b6c5b1637d9543ae1a29df21eb2 |
|
MD5 | 94f11ec6522313a4daacb5dc168ed5a4 |
|
BLAKE2b-256 | e58a8a8ab00db1817862a821619cfee92283a0d9ff5f925d0834b900393885d2 |
Close
Hashes for xtt-0.9.2.post1-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 85936a052ebc3d18b00822923992a89fc22def615f27d7b1c4d85df1f26534e3 |
|
MD5 | df3f9bc2a4b2c4311ae777cbdd1dd1bb |
|
BLAKE2b-256 | 1c7a9b1abfd907392a04b339f39aef63ead2d375497c20e87d2348a0cb492217 |
Close
Hashes for xtt-0.9.2.post1-cp27-cp27mu-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 685a63637c4a460090a5cca7d1a6a48870ca35a42e37bebb84c9a474ad004e1d |
|
MD5 | 8620fcb87f68c9435220d85563c5a4c9 |
|
BLAKE2b-256 | 22f36bc9859c94eebb129d205b404baa7d8a759814cf3fae0fbf1cf0de5fd709 |
Close
Hashes for xtt-0.9.2.post1-cp27-cp27m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ab2b704ccf0f86271bcf4fdc7ceb3dad202b56d3f9ec94c872e6bc9bf293eb40 |
|
MD5 | ed69acf290d2b3c9b5b3deed159a879e |
|
BLAKE2b-256 | 9d977d218b81bba7fc91d402f36f7da9c1a2f966b1233e31d890a037ea9897d8 |
Close
Hashes for xtt-0.9.2.post1-cp27-cp27m-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6ce264aa2fb3229e6e2d4bab9e9c8aee9d4040ea386b296b2ca8e7425304fc5f |
|
MD5 | 19612c547e441dad2fc8b6d3f7a47809 |
|
BLAKE2b-256 | a0344c9e854afd39e25e9e5ad27cfc5cab567c12d5a2546168a6ccdaf63966ed |
Close
Hashes for xtt-0.9.2.post1-cp27-cp27m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 64d8b37039cc509c84d1fef579a9bd7a7ccb6606bce4eaea4b8d0a486777df08 |
|
MD5 | 597542f290da28a5140e863e5a029fc0 |
|
BLAKE2b-256 | b48c0681abbceee5742b586db8f74dd33f4c21d1b305547be51b37d06285894a |