Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

JSON Web Encryption implementation in Python

Project Description
# PyJWE
[JSON Web Encryption](https://tools.ietf.org/html/rfc7516) implementation in Python

[![PyPI version](https://badge.fury.io/py/PyJWE.svg)](https://badge.fury.io/py/PyJWE)
[![Build Status](https://travis-ci.org/chrisseto/pyjwe.svg?branch=master)](https://travis-ci.org/chrisseto/pyjwe)


## Basic Usage

```python
import jwe

key = b'MySecretKey'
salt = b'pepper'

derived_key = jwe.kdf(key, salt)

encoded = jwe.encrypt(b'SuperSecretData', derived_key)

print(encoded)

jwe.decrypt(encoded, derived_key) # b'SuperSecretData'
```


## FAQ

### What is the kdf function? Should I use it? Do I have to use it?

`jwe.kdf` is a very simple [key derivation function](https://en.wikipedia.org/wiki/Key_derivation_function) that uses the [PBKDF2](https://en.wikipedia.org/wiki/PBKDF2).

It is mostly there for the purpose of [key stretching](https://en.wikipedia.org/wiki/Key_stretching) so that users' keys do not have to be the perfect length for AES256.

You do not have to use it, but if you do not your key must be exactly 256 bits.


### Why is `dir` the only algorithm supported?

Because [key wrapping](https://en.wikipedia.org/wiki/Key_Wrap) is more or less [completely useless](https://security.stackexchange.com/questions/40052/when-do-i-use-nist-aes-key-wrapping).


### Why is AES 256 GCM the only encryption methd?

It met my needs and I've yet to need another method.
Feel free to submit an issue if you would like another method implemented.
Release History

Release History

This version
History Node

1.0.0

History Node

0.1.6

History Node

0.1.5

History Node

0.1.4

History Node

0.1.3

History Node

0.1.2

History Node

0.1.1

History Node

0.1.0

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
PyJWE-1.0.0.tar.gz (8.1 kB) Copy SHA256 Checksum SHA256 Source Dec 16, 2015

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting