This repository contains a User Registration and Authentication System with salted hash implemented in Go. It allows users to register with a username and password and authenticate themselves later. The application uses SQLite as the database and Argon2 for password hashing, providing a secure and straightforward web interface.
This application allows users to register and authenticate using a web interface. It ensures secure handling of user credentials and provides feedback to users during the registration and authentication processes.
- Go: Version 1.16 or higher
- SQLite3: For database management
-
Install Go: Ensure Go is installed on your machine. Download it from golang.org.
-
Install SQLite Driver: Open your terminal and run:
go get github.com/mattn/go-sqlite3
-
Clone the Repository: Download the code files to your local machine.
git clone https://github.com/bennitampz/Cryptographics-Challenge-Problems cd Cryptographics-Challenge-Problems
- Open your terminal.
- Navigate to the directory containing main.go.
- Run the application using:
go run main.go
- You should see a message indicating the server has started at :8080
-
Open your web browser and navigate to http://localhost:8080/register or look at the top of the website there is navigation to panel register.
-
Fill in the registration form:
Username: Enter a username (1-15 alphanumeric characters).
Password: Enter a password (minimum 8 characters, must include letters, numbers, and special characters).
-
Click the "Daftar" button to submit the form.
-
You will receive feedback indicating whether the registration was successful or if there were errors.
-
Navigate to http://localhost:8080/authenticate or look at the top of the website there is navigation to panel authenticate.
-
Fill in the authentication form:
Username: Enter your registered username.
Password: Enter your password.
-
Click the "Masuk" button to log in.
-
You will receive feedback indicating whether authentication was successful or if there were errors.
To check if the user data has been successfully inserted into the SQLite database use Browser SQLite or :
-
Open SQLite: In your terminal, navigate to the directory containing users.db and start the SQLite shell:
sqlite3 users.db SELECT * FROM users;
a. GET /register: Serves the registration HTML page.
b. GET /authenticate: Serves the authentication HTML page.
c. POST /register_process: Processes user registration.
d. POST /authenticate_process: Processes user authentication.