Coders Packet

SecurePass Vault in Java using JDBC Connectivity

By K SYAM PRASAD

A secure & user-friendly password manager to store, generate, and manage passwords, ensuring enhanced online security.

Detail Code : [SecurePass Vault]

This Java project represents a graphical user interface (GUI) application for managing and storing passwords for different domains. The application appears to be a password manager for a bank or financial institution, and it allows bankers to securely store passwords for various accounts or services.

This is the main window page :

This project is a SecurePass Vault - Simple Password Manager management application developed using Java Swing and MySQL database. The project aims to help users securely store and manage their passwords for different domains or services. Below are the main features of this password management project:

  1. User Registration:

     The project starts with a user registration page (BankerPassword) where users can create their accounts by providing a name, user ID, and PIN (password).

     User data, including the PIN, name, and user ID, is stored in the MySQL database in the "userLogin" table.

  1. User Login:

     After successful registration, users can log in to their accounts using their user ID and PIN (password).

     If the user enters the correct credentials, they are taken to the dashboard page (Dashboard).

  1. Dashboard:

     The dashboard is the main interface where users can view their stored password records.

     The dashboard displays a welcome message along with the table to show password records for different domains, user IDs, and passwords.

     Users can view their password records in a tabular format, making it easy to manage multiple passwords for different services.

  1. View Password Records:

     The JTable in the dashboard dynamically loads the user's password records from the MySQL database.

     The "load_table()" method fetches the data based on the user ID and displays it in the table.

     Password records are organized by domain name, user ID, and corresponding password.

  1. Back Button:

     The dashboard provides a "BACK" button that allows users to navigate back to the login/registration page to switch users or log out.

  1. Database Storage:

     The application uses a MySQL database to store user registration data and password records.

     Upon user registration, a new record is added to the "userLogin" table in the database, containing the user's name, user ID, and PIN.

     For each registered user, a new table is created in the database to store their password records for different domains.

     The password records are stored securely in the database, and the PIN is used for user authentication.

  1. Error Handling:

     The project includes basic error handling to handle cases where users do not provide all required information during registration or when there are database connectivity issues.

     Error messages are displayed to users to prompt them to provide all necessary information or notify them of any issues that may arise during database interactions.

It's important to note that this project is a simple demonstration of a password management application and may lack advanced security features such as encryption or multi-factor authentication, which are important for real-world password management applications. Nonetheless, it serves as a good starting point for those interested in building more robust password management solutions.

-------------------------------------

Creating Registration Window :[Registration.java]

This code represents the second window page of a password management application developed using Java Swing. This page is dedicated to user registration. The user can create a new account by providing their name, user ID (username), and PIN (password). The application stores this information in a MySQL database and creates a new table for the user in the database to store their password records.

Here's a breakdown of the components on this registration page:

  1. Input Fields:

     Name: JTextField to enter the user's name.

     User ID: JTextField to enter the user's desired username.

     PIN (Password): JPasswordField to enter the user's chosen password.

  1. Buttons:

     CREATE: JButton to initiate the registration process. When clicked, it stores the user's information in the database and creates a new table for them to store their password records.

     CLEAR: JButton to clear the input fields when clicked.

  1. Message Label:

           JButton is used as a label to display messages to the user, such as "Record Added" or "Missing Fields."

  1. BACK Button:

     This button allows the user to return to the first window page (BankerPassword) to log in or register another user.

The registration process includes checking for missing fields before saving the user's data. If any of the fields are empty, an appropriate message is displayed on the message label. Otherwise, the user's data is saved to the database.

Overall, this page provides a simple user interface for user registration and demonstrates how the application interacts with a MySQL database to store user information and manage password records.

-----------------------------

Registering New User :

-----------------------------

Registration Form :

-----------------------------

Registration Successful :

-------------------------------------

Here's a description of the main components of the main window page: [BankerPassword.java]

  1. Main Frame: The application's main window frame, where all the components are placed.
  2. PIN Input Panel: The left panel in the window is used to enter the PIN (Personal Identification Number) to log in as a banker. The PIN is a 6-digit number, and the buttons labeled 0 to 9 allow the banker to enter the PIN digits. The "Clear" button clears the entered PIN, and the "Enter" button is used to submit the entered PIN for validation.
  3. Display Panel: The top center panel displays text output, such as login status, error messages, or prompts for the banker.
  4. Register and Logout Buttons: Below the PIN input panel, there are two buttons: "Register" and "Logout." The "Register" button allows bankers to access a registration page to create new banker accounts. The "Logout" button logs out the currently logged-in banker.
  5. Functionality Panel: The right panel contains various buttons and input fields to perform actions once the banker successfully logs in. However, these components are initially disabled until the banker enters the correct PIN and logs in.
  6. Domain Dropdown and Data Entry: The functionality panel includes a dropdown menu labeled "DOMAIN," which allows the banker to select the type of account or service for which they want to store a password (e.g., GMAIL, OUTLOOK, CODERS PACKET, FACEBOOK). Below the dropdown, there are input fields for entering the ID and password associated with the selected domain. Once a domain is selected, the "ADD," "CLEAR," and "EXIT" buttons become enabled to allow the banker to add the entered information, clear the fields, or exit the application, respectively.
  7. Show Records Button: At the bottom of the window, there is a button labeled "SHOW RECORDS," which allows the banker to view previously stored passwords and access a dashboard.

Overall, this application serves as a basic password manager for bankers, providing secure storage for passwords associated with different domains. The code utilizes Java's Swing library for creating the graphical user interface and connects to a MySQL database to store and retrieve password data.

Enter Pin :

Once you have entered the PIN, press "Enter" to display the valid welcome message on the screen.

-----------------------------

After Login :

Once you have successfully logged in, ensure that all the necessary features are enabled. As shown in the image above, the options to add, clear, exit, and show records should now be available.

-----------------------------

Attempting to log in without providing correct login credentials will result in an authentication error, as the system requires valid credentials for successful login.

-----------------------------

Enter Record :

-----------------------------

Record Added Successfully :

-------------------------------------

Third Window Page : [Dashboard.java]

This file represents the third page of the password management application developed using Java Swing. This page is the user dashboard, where users can view their stored password records for different domains.

Here's a breakdown of the components on this dashboard page:

  1. Table:

      A JTable is used to display the password records for different domains, along with their associated user IDs and passwords.

  1. Labels:

     Domain Name: A label indicating the column representing the domain names in the table.

     User ID: A label indicating the column representing the user IDs in the table.

     Password: A label indicating the column representing the passwords in the table.

  1. Welcome Message:

     A welcome message is displayed in the dashboard's center, greeting the user.

  1. BACK Button:

     This button allows the user to navigate back to the login/registration page (BankerPassword) to switch users or log out.

  1. load_table() Method:

     This method is responsible for loading the user's password records from the MySQL database and displaying them in the table. The method takes the user ID as input (retrieved from the previous page), and based on the user ID, it fetches the records from the corresponding table in the database.

     Note: The user ID is passed to this page from the previous page, but the specific code segment responsible for passing it is not included in the provided code snippet.

  1. Other Variables:

     userId: A string variable that stores the user ID passed from the previous page.

     travel: A JLabel is used to display additional information (not clear from the code snippet).

Overall, this page provides a user-friendly interface where users can view their stored password records for different domains in a tabular format. The application uses the load_table() method to fetch the data from the MySQL database and dynamically populate the JTable with the user's password records. It allows users to manage their passwords efficiently and securely.

View Records : [ID and passwords]

---------------------------------------

Exit Window :

   

To exit the window, simply click on the 'Exit' button. This will prompt a confirmation dialog box to appear. If you select 'Yes', the window will close.

Logout Window :

When you click on the logout button, the window will close and display a message confirming that the logout was successful. that the logout was successful.

---------------------------------------

MySql :

I am using the above table in SQL for this project.  [This is the sample table]

The syam58 table displayed above appears to have encrypted text, but upon closer inspection, it is clear that there is plain text present. As a safety measure, I am currently enhancing the security features of this table. The syam58 table displayed above appears to have encrypted text, but upon closer inspection, it is clear that there is plain text present. As a safety measure, I am currently enhancing the security features of this table. features of this table.

DataType :

I have utilized the blob datatype for each field in the syam58 table mentioned earlier.

Decode :

When retrieving data, I use a secret key to decrypt it. This key is actually the user's name.

Example:

User Name: K. Syam Prasad

Secret Key: First letter of User Name + Last letter of User Name => [KD].

It's just a presumption, so feel free to use your own key.n assumption.

-------------------------------------

Note :

I am utilizing Jbutton icons which can be found in the attached package.

 

Download Complete Code

Comments

No comments yet

Download Packet

Reviews Report

Submitted by K SYAM PRASAD (Syampk58)

Download packets of source code on Coders Packet