TheZ3ro / spake2-cffi

Python3 FFI wrapper for spake2-c

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SPAKE2 for Python

Python3 FFI wrapper for spake2-c by @MuntashirAkon

SPAKE2 is a a Password Authenticated Key Exchange (PAKE) protocol run between two parties for deriving a strong shared key with no risk of disclosing the password. spake2-cffi is the simplest way to use it in Python and PyPy:

Note Currently the spake2-c package support only SPAKE2-edwards25519-SHA512-HKDF-HMA / spake25519 as implemented by Google's boringssl library.

>>> from spake2 import Spake2
>>> alice = Spake2_Alice(b'alice name', b'bob name')
>>> message = alice.generate_message(b'password')
... # exchange messages with bob
>>> shared_key = alice.process_msg(bob_message)
>>> print(shared_key)
b'5c12af40e2bf2e30ac637652cdfc4f6367ed82542ec7640906532a1cd3e71e6bd74f76432d9ce3eb8d50c8c016fa88b3434fe84b878d1f67c01fa9f9d01db63c'

Project Information

Credits

spake2-cffi is maintained by TheZero.

About

Python3 FFI wrapper for spake2-c

License:GNU Lesser General Public License v2.1


Languages

Language:Python 100.0%