Skip to content

DonUserOn/python-encryption-program

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

🔐 Python Encryption Program

A clean and interactive terminal-based Encryption Program built with Python.

This project allows users to encrypt and decrypt text messages using a substitution cipher. It includes key generation, key saving, key loading, a menu system, and a clean function-based structure.

It is designed to demonstrate algorithmic thinking, string manipulation, file handling, input validation, and beginner-to-intermediate Python programming skills.


📌 Project Overview

The Python Encryption Program is a simple text encryption and decryption tool.

The program generates a randomized encryption key, saves it to a local file, and uses that same key to encrypt and decrypt messages. This allows encrypted messages to be decoded later as long as the saved key is preserved.

This project focuses on building a practical Python program with real-world concepts such as data protection, text transformation, file handling, and key management.


✨ Features

Core Features

  • Text message encryption
  • Text message decryption
  • Random encryption key generation
  • Saved key system using secret_key.txt
  • Key loading on program startup
  • Option to generate a new key
  • Warning before replacing an old key
  • Menu-based terminal interface
  • Function-based code organization

🛠 Technologies Used

  • Python 3
  • Built-in random module
  • Built-in string module
  • File handling with .txt files

No external libraries are required.


🚀 How to Run the Project

Step 1 — Clone the Repository

git clone https://github.com/DonUserOn/python-encryption-program.git
cd python-encryption-program

Step 2 — Run the Program

python main.py

When the program runs for the first time, it automatically creates a secret_key.txt file.


🧪 Example Usage

=============================================
        Python Encryption Program
=============================================
1. Encrypt a message
2. Decrypt a message
3. Generate a new key
4. Exit
=============================================
Choose an option (1-4): 1

Enter a message to encrypt: hello

Original message:
hello

Encrypted message:
7@Qz!

⚠️ Important Note

This project is created for educational purposes.

It demonstrates how basic substitution encryption works, but it should not be used for real-world secure communication. Modern security systems use advanced cryptographic algorithms and security libraries.


🧠 Programming Concepts Practiced

This project helps strengthen understanding of:

  • Functions
  • Constants
  • Lists and strings
  • Randomization
  • File handling
  • Reading and writing files
  • String indexing
  • Substitution cipher logic
  • Input handling
  • Menu-based programs
  • Code organization
  • Basic cybersecurity concepts

📈 Future Improvements

Future versions of this project may include:

  • Password-protected key access
  • Stronger encryption using Python cryptography libraries
  • GUI version using Tkinter
  • Web version using Flask or Streamlit
  • Save encrypted messages to files
  • Decrypt messages from files
  • Copy-to-clipboard feature
  • Unit testing with pytest
  • Object-Oriented Programming version

💡 What I Learned

While building this project, I improved my understanding of:

  • Implementing basic encryption logic
  • Managing encryption keys
  • Saving and loading data from files
  • Structuring Python programs with functions
  • Handling user input through menus
  • Improving code readability and maintainability
  • Preparing practical Python projects for GitHub

This project helped me practice both programming fundamentals and basic cybersecurity concepts.


👨‍💻 Author

Hanan Ossama

AI Student | Python Developer | Future AI Engineer

Focused on building practical Python projects, AI assistant tools, automation systems, and beginner-to-intermediate software projects with real-world value.

Connect With Me

GitHub: https://github.com/DonUserOn

Future Portfolio Website: Coming Soon


⭐ Repository Goal

This repository is part of my Python learning journey and portfolio development. It demonstrates my ability to implement algorithms, manage files, structure clean code, and prepare professional GitHub projects for future internship opportunities.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages