Skip to content

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

Secure Remote Password submodule

This submodule provides the interface to the custom implementation of ProtonMail's SRP API. It automatically tries to load the constant time ctypes + OpenSSL implementation, and on failure it uses the native long int implementation. It is based on pysrp.

Examples

Authenticate against the API

from proton.srp import User
usr = User(password, modulus)
client_challenge = usr.get_challenge()

# Get server challenge and user salt...

client_proof = usr.process_challenge(salt, server_challenge, version)

# Send client proof...

usr.verify_session(server_proof)
if usr.authenticated():
    print("Logged in!")

Generate new random verifier

from proton.srp import User
usr = User(password, modulus)
generated_salt, generated_v = usr.compute_v()

Generate verifier given salt

from proton.srp import User
usr = User(password, modulus)
generated_salt, generated_v = usr.compute_v(salt)