29 lines
555 B
ReStructuredText
29 lines
555 B
ReStructuredText
encrypted-content-encoding
|
|
==========================
|
|
|
|
A simple implementation of the `HTTP encrypted
|
|
content-encoding <https://tools.ietf.org/html/rfc8188>`_
|
|
|
|
Use
|
|
---
|
|
|
|
.. code-block:: python
|
|
|
|
import http_ece
|
|
import os, base64
|
|
|
|
key = os.urandom(16)
|
|
salt = os.urandom(16)
|
|
data = os.urandom(100)
|
|
|
|
encrypted = http_ece.encrypt(data, salt=salt, key=key)
|
|
decrypted = http_ece.decrypt(encrypted, salt=salt, key=key)
|
|
assert data == decrypted
|
|
|
|
This also supports the static-ephemeral ECDH mode.
|
|
|
|
TODO
|
|
----
|
|
|
|
Provide a streaming API
|