Skip to content

A cryptographic client side user state for phone number verification flow in web applications.

Notifications You must be signed in to change notification settings

PouyaEsmaeili/CryptographicClientSideUserState

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

This repository shows a cryptographic way to validate user phone number in registration flow.

Here is the sequence diagram for this flow:

sequence diagram

For more details read this.

Example:

from main import PhoneVerification

# Get verification code
phone_verification = PhoneVerification(secret_key='VEcGULCPPAuAaD7QtcMd')
state, verification_code = phone_verification.generate_verification_state(phone_number='+12025550331')
print('This is state: ', state)
print('This is verification code: ', verification_code)

# Validate verification code
validation_result = phone_verification.validate_state(state, verification_code)
print('This is validation result: ', validation_result)

And this is the output:

This is state:  State(timestamp=1673730351.149517, digest='4b68d6f3c5d9f21037ee8f1649e93a8274408026df356387c0d1d286f46e9304', phone_number='+12025550331')
This is verification code:  89402
This is validation result:  True

About

A cryptographic client side user state for phone number verification flow in web applications.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages