Skip to content

DumiduLakshan/Password-Hashed-Registration-App

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

6 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ”’ Password Hashed Registration App

Welcome to the Password Hashed Registration App! This application is designed to provide a secure way to register users with password hashing. The app uses a modern UI built with customtkinter and connects to a MySQL database.

πŸ“Έ Screenshots

Screenshot 1

Description of Screenshot 1

Screenshot 2

Description of Screenshot 2

πŸš€ Features

  • πŸ”‘ Secure Registration: Passwords are securely hashed before being stored in the database.
  • πŸ’» Modern UI: Built using customtkinter for a sleek and modern look.
  • πŸ“§ Email Registration: Users can register with their username and email.
  • πŸ—„οΈ Database Integration: Connects to a MySQL database to store user information.

πŸ› οΈ Setup

Follow these steps to get the app running on your local machine.

<h3>Prerequisites</h3>
<ul>
    <li>Python 3.x</li>
    <li>MySQL server</li>
    <li><code>customtkinter</code> library</li>
    <li><code>mysql-connector-python</code> library</li>
</ul>

<h3>Installation</h3>
<ol>
    <li>
        <strong>Clone the repository</strong>
        <pre class="code"><code>git clone https://github.com/yourusername/password-hashed-app.git

cd password-hashed-app

  • Install dependencies
    pip install customtkinter mysql-connector-python
  • Set up the MySQL database
    CREATE DATABASE studentdb;
    USE studentdb;
    CREATE TABLE student (
    id INT AUTO_INCREMENT PRIMARY KEY,
    name VARCHAR(255) NOT NULL,
    email VARCHAR(255) NOT NULL,
    password VARCHAR(255) NOT NULL
    );
  • Update database credentials in the script
    db = mysql.connector.connect(
    host="localhost",
    user="your_mysql_user",
    passwd="your_mysql_password",
    database="studentdb"
    )
  • Run the application
    python app.py
  • πŸ“‹ Code Overview

    Here's a brief overview of the main parts of the code.

    <h3>Database Connection</h3>
    <pre class="code"><code>db = mysql.connector.connect(
    host="localhost",
    user="root",
    passwd="4878",
    database="studentdb"
    

    ) cursor = db.cursor()

    <h3>Password Checking and Registration</h3>
    <pre class="code"><code>def passChecker():
    passwd = password.get()
    conpass = confirmPass.get()
    if passwd == conpass:
        validator()
    else:
        mb.showerror("Error", "Passwords do not match")
    

    def validator(): try: newusername = username.get() newemail = email.get() confirmpass = password.get() hashed_pass = hashlib.sha256(confirmpass.encode()).hexdigest() q = f'INSERT INTO student (name, email, password) VALUES (%s, %s, %s)' cursor.execute(q, (newusername, newemail, hashed_pass)) db.commit() mb.showinfo("Information", "User created successfully") clear_entries() except mysql.connector.Error as err: mb.showerror("Error", f"Database Error: {err}")

    🀝 Contributing

    Contributions are welcome! Please feel free to submit a Pull Request.

    πŸ“„ License

    This project is licensed under the MIT License.

    About

    This application is designed to provide a secure way to register users with password hashing. The app uses a modern UI built with customtkinter and connects to a MySQL database

    Resources

    Stars

    Watchers

    Forks

    Releases

    No releases published

    Packages

     
     
     

    Contributors

    Languages