Skip to content

A security-focused Java application designed to manage user authentication through robust asymmetric encryption.

Notifications You must be signed in to change notification settings

masum184e/crypto_lock

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CryptoLock

CryptoLock is a secure Java-based authentication system that demonstrates the implementation of RSA Asymmetric Encryption for user management. It features both a Command Line Interface (CLI) and a Graphical User Interface (GUI), providing a robust way to register and authenticate users without ever storing passwords in plain text.

Features

  • Asymmetric Cryptography: Utilizes RSA (1024-bit) to encrypt and decrypt user passwords.
  • Dual Interface: - GUI Mode: A clean Java Swing interface for a modern desktop experience.
    • CLI Mode: A lightweight terminal-based menu for quick operations.
  • Automated Key Generation: Generates unique Public/Private key pairs for every registered user.
  • Persistent Storage: Saves user data and cryptographic keys in a structured text-based format (users.txt).

How It Works

  1. Registration: The system generates an RSA KeyPair. The password is encrypted using the Public Key and stored along with the Private Key (encoded in Base64).
  2. Authentication: When a user logs in, the system retrieves the stored Private Key to decrypt the saved password and compares it to the input.

Getting Started

Prerequisites

  • Java Development Kit (JDK) 8 or higher.

Installation

  1. Clone the repository:

    https://github.com/masum184e/crypto_lock
    cd crypto_lock
  2. Compile the source files:

    javac *.java

Running the Application

To run the Graphical Interface (GUI):

java CryptoLockGUI

To run the Command Line Interface (CLI):

java CryptoLock

Project Structure

  • CryptoLockGUI.java: The Java Swing entry point.
  • CryptoLock.java: The terminal-based entry point.
  • Auth.java: Core logic for user registration, login, and file I/O.
  • RSA.java: Cryptographic utility class for key generation and encryption logic.
  • users.txt: The database (auto-generated upon first registration).

Security Implementation

This project uses the javax.crypto and java.security libraries. By utilizing RSA, the system ensures that even if the users.txt file is accessed by an unauthorized party, the passwords remain encrypted and require the corresponding Private Key for decryption.

About

A security-focused Java application designed to manage user authentication through robust asymmetric encryption.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages