The Caesar Cipher Converter is a web application that allows users to encrypt and decrypt text using the Caesar Cipher method. Additionally, the application includes features such as a dark/light mode toggle and accurate decryption logic leveraging dictionary-based analysis.
- Encryption: Encrypt text by shifting characters by a user-defined value.
- Decryption: Automatically detect the shift value of encrypted text and decrypt it.
- Theme Toggle: Switch between light and dark themes using a visually intuitive button.
- Accurate Decryption: Utilizes a dictionary-based algorithm to determine the most likely shift value for encrypted text.
- Copy-to-Clipboard: Copy encrypted or decrypted results directly from the UI.
- Framework: Astro
- Language: TypeScript
- Styling: TailwindCSS
- Node.js (v16 or later)
- NPM or Yarn (for dependency management)
-
Clone the repository:
git clone https://github.com/khamisilawrence/caesar-cipher-converter.git cd caesar-cipher-converter -
Install dependencies:
npm install
-
Run the development server:
npm run dev
-
Open your browser and navigate to:
http://localhost:3000
- Navigate to the Encrypt tab.
- Enter the text to encrypt in the input field.
- Specify the shift value using the input box.
- Click Encrypt to generate the encrypted text.
- Navigate to the Decrypt tab.
- Enter the text to decrypt in the input field.
- Click Decrypt to automatically detect the shift and display the decrypted text.
- Use the theme toggle button to switch between dark and light modes.
- Click the copy icon next to the result to copy the output.
caesar-cipher-converter/
├── src/
│ ├── components/
│ │ ├── CaesarForm.astro # Main form for encrypting and decrypting text
│ │ ├── CopyIcon.astro # Copy-to-clipboard functionality
│ │ ├── Footer.astro # Footer component
│ │ ├── Header.astro # Header component
│ │ ├── ThemeToggle.astro # Dark/light mode toggle
│ ├── layouts/
│ │ └── BaseLayout.astro # Base layout structure
│ ├── pages/
│ │ └── index.astro # Main page of the application
│ ├── styles/
│ │ └── globals.css # Global CSS styles
│ └── utils/
│ ├── alphabets.ts # Language-specific alphabets
│ ├── caesarCipher.ts # Cipher logic
│ ├── determineShift.ts # Algorithm to detect shift values
│ ├── dictionary.ts # Dictionary loading and caching logic
├── public/
│ ├── favicon.ico # Application favicon
│ └── assets/ # Static assets
├── astro.config.mjs # Astro configuration
├── package.json # Project dependencies
└── tailwind.config.mjs # TailwindCSS configurationThis project is licensed under the MIT License.
- Inspired by classical Caesar Cipher encryption.