Skip to content

stsch9/py-cpace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

py-cpace

WARNING: This is just a PoC. Use at your own risk.
This is a simple python implementation of CPace defined in draft-irtf-cfrg-cpace-13.

It uses pysodium for all Ristretto255 functions. Therefore libsodium must be pre-installed.

Usage:

symmetric setting

# User Alice:
cpaceA = CPace(PRF=b'Password', role='symmetric', ADa=b'Alice', ADb=b'Bob', CI=b'CI', sid=b'sid')
Ya, ADa = cpaceA.compute_Yx()

# User Bob:
cpaceB = CPace(PRF=b'Password', role='symmetric', ADa=b'Bob', ADb=b'Alice', CI=b'CI', sid=b'sid')
Yb, ADb = cpaceB.compute_Yx()

# User Alice:
ISK_A = cpaceA.derive_ISK(Yb)

# User Bob:
ISK_B = cpaceB.derive_ISK(Ya)

initiator-responder setting

# User Alice:
cpaceA = CPace(PRF=b'Password', role='initiator', ADa=b'Alice', ADb=b'Bob', CI=b'CI', sid=b'sid')
Ya, ADa = cpaceA.compute_Yx()

# User Bob:
cpaceB = CPace(PRF=b'Password', role='responder', ADa=b'Alice', ADb=b'Bob', CI=b'CI', sid=b'sid')
Yb, ADb = cpaceB.compute_Yx()

# User Alice:
ISK_A = cpaceA.derive_ISK(Yb)

# User Bob:
ISK_B = cpaceB.derive_ISK(Ya)

Releases

No releases published

Packages

No packages published

Languages