This project demonstrates a secure authentication system using zero-knowledge proofs implemented through a gRPC-based client-server architecture. The server offers user registration, authentication challenge creation, and verification to ensure privacy and security during authentication.
The project consists of two main components: the server and the client.
The server provides the authentication service through gRPC, offering the following functionalities:
- User registration with unique usernames and passwords 'x'.
- Creation of authentication challenges with random 'c' values for users.
- Verification of authentication responses.
The client interacts with the server to facilitate user registration and authentication:
- Users can register with unique usernames and passwords 'x'.
- Users can log in by responding to authentication challenges using calculated responses 's'.
Follow these steps to set up and run the server and client components of the project.
- Python 3.6 or higher
- gRPC (Python library)
-
Clone the repository:
git clone https://github.com/ayushguptacse14/ZKP-Auth-Protocol.git cd ZKP-Auth-Protocol -
Install gRPC (if not already installed):
pip install grpcio grpcio-tools
-
Run the server:
python server.py
Or
-
Run docker container
docker-compose up --build
-
Open a new terminal window.
-
Run the client script:
python client.py
Unit tests are provided in the test.py file. To run the tests, follow these steps:
-
Open a terminal window.
-
Navigate to the project root directory:
python server_test.py python client_test.py
- Register: Choose option 1, enter a username and password 'x', and the user will be registered.
- Login: Choose option 2, enter the registered username and the corresponding password 'x', and the user's authentication status will be displayed.
- Exit: Choose option 3 to exit the client.
Contributions are welcome! Feel free to open issues or submit pull requests for any improvements, bug fixes, or new features you'd like to contribute.
This project is licensed under the MIT License.