TextEncryptor is a command-line encryption tool that allows users to encrypt and decrypt text using multiple encryption methods. The project supports:
- Rail Fence Cipher
- Morse Code
- AES (Advanced Encryption Standard) This project is cross-platform and runs on both Linux and Windows using dedicated scripts.
TextEncryptor/
├── bin/ # Compiled Java class files
├── files/ # Input text files
├── src/
│ ├── TextEncryptor.java # Entry point
│ ├── AESCipher.java
│ ├── MorseCodeCipher.java
│ ├── RailFenceCipher.java
├── scripts/ # Platform-specific scripts
│ ├── LINUX_RUN.sh # Bash script for Linux
│ ├── WINDOWS_RUN.ps1 # PowerShell script for Windows
├── README.md
- Operating System: Windows or Linux
- Java Development Kit (JDK): Version 8 or higher
- IDE (optional): IntelliJ IDEA, NetBeans, or any Java-compatible editor
- Command-line Terminal or PowerShell
- Download or transfer the project files to your machine.
- Compile and run the program (make sure you're in the main directory
TextEncryptor):
- Linux:
chmod +x scripts/LINUX_RUN.sh
./scripts/LINUX_RUN.shIf
javacis not installed, run:
sudo apt install default-jdk- Windows (PowerShell): Before compiling and running:
java -version
javac -versionNote: If these commands are not recognized, make sure Java is installed and the JDK
bindirectory is added to your system’sPATHenvironment variable. Then compile and run:
.\scripts\WINDOWS_RUN.ps1If prompted for permissions:
- Press
Rto run once, or - Temporarily allow running scripts for this session by executing:
Set-ExecutionPolicy -Scope Process -ExecutionPolicy BypassNote: This change applies only to the current PowerShell session. You will need to reapply it if you open a new session.
- Use the terminal or IDE console to interact with the tool.
- Launch the program using your terminal or IDE.
- Choose to Encrypt or Decrypt.
- Select your input method:
- Manual text entry
- Reading from a file in the
files/directory
- Choose an encryption algorithm:
- Rail Fence Cipher
- Morse Code
- AES (Advanced Encryption Standard)
- If using AES, ensure that you enter a 16-character key.
- View the result displayed in the terminal.
| Issue | Cause | Solution |
|---|---|---|
| Permission denied on Linux script | Missing execute permission | Run chmod +x scripts/LINUX_RUN.sh |
| PowerShell ExecutionPolicy error | Script execution is blocked | Use Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass |
| AES key error | Key is not 16 characters long | Enter an AES key that is exactly 16 characters long |
| File not found | Incorrect file name or path | Ensure the file is in the files/ directory and the name is correct |
| Compilation errors | Filename doesn't match class name | Ensure the public class name matches the file name (e.g., Main.java) |
| Java not recognized | Java is not added to environment vars | Add the JDK bin folder to your system’s PATH |