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.
- π Secure Registration: Passwords are securely hashed before being stored in the database.
- π» Modern UI: Built using
customtkinterfor 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.
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
pip install customtkinter mysql-connector-pythonCREATE 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
);db = mysql.connector.connect(
host="localhost",
user="your_mysql_user",
passwd="your_mysql_password",
database="studentdb"
)python app.pyHere'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}")

