Skip to content

roger-95s/Command-Line-Password-Manager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Here’s a template for README.md file based on my project: Command-Line Password Manager

Video Demo: [YouTube/Command-Line-Password-Manager]

Description:

This project is a command-line password manager written in C that allows users to securely store, retrieve, and delete passwords for different services. The program utilizes basic XOR encryption for securing passwords, making it a useful tool for managing credentials on the fly in a secure manner. Key Features:

Add New Passwords: Users can input a service name, username, and password. The password is encrypted before being stored in a file.
Retrieve Passwords: The user can retrieve the stored password by entering the service name. The password is decrypted and displayed.
Delete Passwords: The program allows users to securely delete a stored password entry by specifying the service name.
File-Based Storage: Passwords are stored in a text file, where each entry contains the service name, username, and encrypted password.
Encryption and Decryption: Passwords are encrypted using a simple XOR-based encryption algorithm, ensuring basic security for saved credentials.

How it Works:

Main Menu: The program displays a menu with options to add, retrieve, delete passwords, or exit. Depending on the user’s choice, the respective function is executed.

Adding a Password:
    The user is prompted to enter the service name, username, and password.
    The password is encrypted using the XOR method and saved to a file alongside the service name and username.
    The file acts as the database for storing and retrieving passwords.

Retrieving a Password:
    The user enters the service name for which they want to retrieve the password.
    The program searches the file for the corresponding service name, decrypts the password, and displays it to the user.

Deleting a Password:
    The user inputs the service name of the password they want to delete.
    The program searches for the entry, removes it from the file, and updates the file accordingly.

XOR Encryption:
    A simple XOR encryption algorithm is used to obfuscate the passwords before storing them. While not the most secure form of encryption, this provides a layer of basic security.
    The same XOR key is used to decrypt the passwords when retrieved.

Files in the Project:

main.c:
The primary file that contains the program logic. It manages the main menu and handles user input. The program uses a while loop to keep running until the user chooses to exit.

Functions:
    add_password(): Collects user input for service name, username, and password, encrypts the password, and saves it to a file.
    retrieve_password(): Retrieves and decrypts the password for a specified service name.
    delete_password(): Deletes an entry for a given service name from the file.
    encrypt_password(): A simple XOR-based function that encrypts the password.
    decrypt_password(): The reverse of the encryption function, decrypting the password.
    save_to_file(): Writes encrypted passwords to the file.
    find_in_file(): Searches for a password in the file by service name.
    remove_from_file(): Removes a password entry from the file.

Design Choices:

XOR Encryption: The decision to use XOR encryption was based on simplicity and ease of implementation. Though not suitable for high-security applications, it serves as an introduction to encryption concepts for a small-scale project.

File Handling: Passwords are stored in a text file, which allows easy reading, writing, and manipulation of entries. This approach is not the most secure for production use, but it's simple and effective for demonstrating basic password management features.

User Input Handling: The program uses a basic method for input validation, ensuring users cannot leave fields empty when adding passwords. This is achieved through a loop that asks users to re-enter values until valid input is received.

Future Improvements:

Stronger Encryption: The current XOR-based encryption is rudimentary. A future improvement could involve implementing stronger encryption algorithms such as AES or SHA for better security.

Password File Security: Storing passwords in a plain text file is insecure. In future versions, the password file could be further protected using encryption for the entire file or storing passwords in a more secure database.

User Authentication: Adding a login mechanism to the password manager would provide another layer of security, ensuring that only authorized users can access the stored passwords.

Cross-Platform Compatibility: The current program is intended for command-line use on Linux. Future versions could be adapted for cross-platform compatibility, including Windows and macOS.

Conclusion:

This command-line password manager project serves as a basic introduction to C programming, encryption, and file handling. It showcases fundamental concepts such as user input, conditional logic, and the practical use of functions to manage data. While the project is not designed for real-world security applications, it provides a solid foundation for further exploration into more advanced encryption and password management techniques.

About

This project is a command-line password manager written in C that allows users to securely store, retrieve, and delete passwords for different services. The program utilizes basic XOR encryption for securing passwords, making it a useful tool for managing credentials on the fly in a secure manner.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages