cocagne / pysrp

Python implementation of the Secure Remote Password protocol (SRP)
MIT License
113 stars 42 forks source link

Add padding specified in RFC 5054 #26

Closed dragomirecky closed 6 years ago

dragomirecky commented 6 years ago

Adds padding specified in RFC 5054 for calculation of u and k. https://tools.ietf.org/html/rfc5054

cocagne commented 6 years ago

Unfortunately, merging these changes in would break compatibility with previous versions. There is an rfc5054_compat branch that I believe has a similar set of changes but that has not been merged to mainline as it lacks a mechanism for defaulting to the old behavior but with an option to switch to rfc5054 compatibility. Have you tried using this branch to see if it's compatible with your use case?

dragomirecky commented 6 years ago

Makes sense. I changed the commit to make it backward compatible. To enable rfc5054 compatibility, it is needed to first do

import pysrp
pysrp.rfc5054_enable()

(I also added this function to sphinx documentation.)