Skip to content

Repository files navigation

🔐 CryptoVault - Custom Encryption System

A modern, full-stack web application featuring a completely custom encryption algorithm called "QuantumShift Cipher". Built with Next.js, this application provides secure text encryption and decryption with a beautiful, responsive user interface.

CryptoVault Demo Next.js TypeScript Tailwind

Made with ❤️ by RBaskey

✨ Features

Scenario Can Decode? Difficulty
Knows only output ❌ No Impossible
Knows output + key ❌ No Extremely hard
Knows output + key + algorithm ✅ Yes Fully possible
Knows key but wrong algorithm ❌ No No way to decrypt

🧠 Custom QuantumShift Cipher Algorithm

  • Multi-layer encryption with 6 distinct transformation steps
  • Key-based personalization using custom salt integration
  • Position-dependent encoding for enhanced security
  • Bit manipulation and mathematical transformations
  • Reversible operations with integrity verification
  • No reliance on standard ciphers (AES, Caesar, Base64, etc.)

🎨 Modern User Interface

  • Glassmorphism design with gradient backgrounds
  • Smooth animations and transitions
  • Responsive layout for all device sizes
  • Real-time feedback with toast notifications
  • Interactive controls with tabbed interface
  • Copy-to-clipboard functionality
  • Input/output text swapping for convenience

🔧 Robust Backend

  • RESTful API with dedicated encrypt/decrypt endpoints
  • Comprehensive error handling and validation
  • Security verification with key signatures
  • Detailed logging for debugging and monitoring
  • CORS enabled for cross-origin requests

🚀 Tech Stack

Frontend

  • Next.js 15 - React framework with App Router
  • TypeScript - Type-safe development
  • Tailwind CSS - Utility-first styling
  • Radix UI - Accessible component primitives
  • Lucide React - Beautiful icons

Backend

  • Next.js API Routes - Serverless functions
  • Node.js - Runtime environment
  • Custom encryption algorithm - No external crypto libraries

📦 Installation

Prerequisites

  • Node.js 18+
  • npm or yarn package manager

Quick Start

  1. Clone the repository ```bash git clone https://github.com/yourusername/cryptovault.git cd cryptovault ```

  2. Install dependencies ```bash npm install

    or

    yarn install ```

  3. Run the development server ```bash npm run dev

    or

    yarn dev ```

  4. Open your browser Navigate to http://localhost:3000

Production Build

```bash npm run build npm start ```

🔍 Usage Guide

Basic Encryption/Decryption

  1. Enter your encryption key (salt) in the key field
  2. Input your text in the text area
  3. Select Encrypt or Decrypt mode using the tabs
  4. Click the action button to process your text
  5. Copy or swap the result as needed

Example Usage

``` Input Text: "Hello World!" Encryption Key: "mySecretKey" Encrypted Output: "A7L~B8M#C9N@D10O%E11P&F12Q*G13R+H14S=I15T!J16U?K17V|ABC1" Decrypted Output: "Hello World!" ```

🔐 Algorithm Deep Dive

QuantumShift Cipher Process

The custom encryption algorithm applies six layers of transformation:

Encryption Steps:

  1. Key Hash Generation - Creates consistent transformations from user key
  2. Position-Based Shifting - Each character shifted based on position and key
  3. XOR Operations - Key-dependent bitwise operations
  4. Bit Rotation - Position-based bit shifting for obfuscation
  5. Prime Multiplication - Mathematical transformation using prime numbers
  6. Custom Base Conversion - Base-36 encoding with position markers

Security Features:

  • Key Signature Verification - Ensures data integrity
  • Position Markers - Prevents reordering attacks
  • Dynamic Separators - Obfuscates data structure
  • Modular Arithmetic - Enables reversible operations

Algorithm Complexity

  • Time Complexity: O(n) where n is text length
  • Space Complexity: O(n) for output storage
  • Key Dependency: Each character transformation depends on key and position

🌐 API Documentation

Encryption Endpoint

POST /api/encrypt

```json { "text": "Hello World!", "key": "mySecretKey" } ```

Response: ```json { "result": "A7L~B8M#C9N@D10O%E11P&F12Q*G13R+H14S=I15T!J16U?K17V|ABC1" } ```

Decryption Endpoint

POST /api/decrypt

```json { "cipherText": "A7L~B8M#C9N@D10O%E11P&F12Q*G13R+H14S=I15T!J16U?K17V|ABC1", "key": "mySecretKey" } ```

Response: ```json { "result": "Hello World!" } ```

Error Responses

```json { "error": "Text is required" } ```

```json { "error": "Invalid key or corrupted data" } ```

🛡️ Security Considerations

Algorithm Security

  • Custom Implementation - Not based on known vulnerable ciphers
  • Key-Dependent Operations - Different keys produce different outputs
  • Integrity Verification - Key signatures prevent tampering
  • Position Sensitivity - Character order affects encryption

Application Security

  • Input Validation - All inputs are validated and sanitized
  • Error Handling - Secure error messages without information leakage
  • No Key Storage - Keys are not stored on the server
  • HTTPS Recommended - Use HTTPS in production for key transmission

Limitations

  • Educational Purpose - Not intended for production cryptographic needs
  • Key Management - Users responsible for key security
  • No Key Recovery - Lost keys cannot recover encrypted data

📁 Project Structure

``` cryptovault/ ├── app/ │ ├── api/ │ │ ├── encrypt/ │ │ │ └── route.ts # Encryption API endpoint │ │ └── decrypt/ │ │ └── route.ts # Decryption API endpoint │ ├── globals.css # Global styles and animations │ ├── layout.tsx # Root layout component │ └── page.tsx # Main application page ├── components/ │ └── ui/ # Reusable UI components │ ├── button.tsx │ ├── card.tsx │ ├── input.tsx │ ├── label.tsx │ ├── tabs.tsx │ └── textarea.tsx ├── hooks/ │ └── use-toast.ts # Toast notification hook ├── lib/ │ └── utils.ts # Utility functions ├── public/ # Static assets ├── next.config.js # Next.js configuration ├── package.json # Dependencies and scripts ├── tailwind.config.js # Tailwind CSS configuration └── README.md # Project documentation ```

🤝 Contributing

We welcome contributions! Please follow these steps:

  1. Fork the repository
  2. Create a feature branch ```bash git checkout -b feature/amazing-feature ```
  3. Commit your changes ```bash git commit -m 'Add amazing feature' ```
  4. Push to the branch ```bash git push origin feature/amazing-feature ```
  5. Open a Pull Request

Development Guidelines

  • Follow TypeScript best practices
  • Maintain consistent code formatting
  • Add comments for complex algorithm logic
  • Test encryption/decryption thoroughly
  • Update documentation for new features

🐛 Known Issues

  • Large text inputs (>10MB) may cause performance issues
  • Unicode characters with high code points may not encrypt properly
  • Browser compatibility limited to modern browsers supporting ES6+

🔮 Future Enhancements

  • File Encryption - Support for encrypting files
  • Batch Processing - Encrypt multiple texts simultaneously
  • Key Strength Meter - Visual feedback for key security
  • Encryption History - Save and manage encrypted texts
  • Export/Import - Save encrypted data to files
  • Mobile App - React Native implementation
  • Advanced Algorithms - Additional custom cipher options

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

🙏 Acknowledgments

  • Next.js Team - For the amazing React framework
  • Tailwind CSS - For the utility-first CSS framework
  • Radix UI - For accessible component primitives
  • Vercel - For seamless deployment platform

About

Text Encryptor Application

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages