• Keyed Dynamic Shift Matrix •

#Introduction

KDSM (Keyed Dynamic Shift Matrix) is an innovative encryption system designed to provide secure message encryption with a unique approach to cryptography. Unlike traditional encryption methods, KDSM uses a dynamic matrix-based algorithm that shifts character values based on a unique key.

This project was created to offer a lightweight, browser-based encryption solution that doesn't require server-side processing or complex installations. KDSM Encryptor allows users to securely encrypt messages that can only be decrypted with the correct key.

#How It Works

KDSM encryption operates on a principle of character shifting within a dynamic matrix. Here's a simplified explanation of the process:

  1. Key Generation: A unique encryption key is either provided by the user or automatically generated.
  2. Matrix Creation: The key is used to create a dynamic shift matrix that determines how each character in the message will be transformed.
  3. Character Transformation: Each character in the original message is processed through the matrix, resulting in a shifted value.
  4. Encryption Output: The transformed characters are combined to create the encrypted message.

Decryption follows the reverse process, using the same key to transform the encrypted characters back to their original values.

#Features

  • Client-side Encryption: All encryption/decryption happens in your browser - no data is sent to any server.
  • Key Management: Use your own key or let the system generate a secure random key.
  • Copy with Key: Share encrypted messages along with the key in a special format.
  • Auto-detection: When pasting a message with an embedded key, the system automatically extracts and applies the key.
  • API Integration: Use KDSM encryption in your own applications via our REST API.
  • Rate Limited: Fair usage policy with 10 API calls per day per key.
  • Responsive Design: Works seamlessly across desktop and mobile devices.

#Security

KDSM provides a solid level of security for everyday communication needs. However, it's important to understand its security characteristics:

  • Key Importance: The security of KDSM relies entirely on keeping the encryption key secret. Anyone with the key can decrypt the message.
  • API Security: API keys are required for external access and are rate-limited to prevent abuse.
  • Transport Security: All API communications should use HTTPS to prevent interception.
  • No Backdoors: The system contains no backdoors or master keys - without the original encryption key, the message cannot be recovered.

#Usage

Web Interface

  1. Enter your message in the text area.
  2. Optionally enter a custom key or use the "Generate Random Key" button.
  3. Click "Encrypt" to generate the encrypted message.
  4. Use the copy buttons to copy either just the encrypted message or the message with its key.

API Integration

For developers who want to integrate KDSM encryption into their applications, we provide a REST API. See the API Documentation section below for detailed information.

#Technical Details

KDSM Encryptor is built using modern web technologies:

  • Framework: Next.js for React-based UI and routing
  • Backend: Appwrite for authentication and data storage
  • API: RESTful API with rate limiting and key authentication
  • UI Components: Custom components with Tailwind CSS for styling
  • Animations: Framer Motion for smooth, physics-based animations

#API Pass Gen. (free)

Integrate the ability to generate a strong password in your project with ease with our API for free!

Important info

  • • Free for all (No API key required)
  • • Usage is not monitored or rate-limited

GET /password-generator

Generate a strong password via query parameters.

Query Parameters:
length=12&includeNumbers=true&includeSpecialChars=true&includeUppercase=true&includeLowercase=true&excludeSimilar=false&customChars=
Response:
{ "password": "generated_password_here" }
cURL Example:
curl "https://kdsm.vercel.app/api/password-generator?length=12&includeNumbers=true&includeSpecialChars=true"

POST /password-generator

Generate a strong password via JSON body.

Request Body:
{ "length": 12, "includeNumbers": true, "includeSpecialChars": true, "includeUppercase": true, "includeLowercase": true, "excludeSimilar": false, "customChars": "" }
Response:
{ "password": "generated_password_here" }
cURL Example:
curl -X POST https://kdsm.vercel.app/api/password-generator   -H "Content-Type: application/json"   -d '{ "length": 12, "includeNumbers": true }'

#Encryption API v1

KDSM API

🚀 Getting Started

To use the KDSM API, you'll need to create an API key from your profile page. Navigate to Profile → Developer tab to generate your API keys.

Base URL

https://kdsm.vercel.app/api/v1

Authentication

All API requests require an API key to be included in the request headers:

x-api-key: your_api_key_here

Rate Limits

Tier-based Rate Limiting (Only applicable to API v1)

Free Users
10 calls per day
Premium Users
100 calls per day
  • Rate limits are shared across all API keys for the same user
  • Rate limits reset daily at midnight UTC
  • Maximum 3 API keys per user account

Endpoints

POST /encrypt

Encrypt a message using KDSM algorithm.

Request Body:
{
  "message": "Hello, World!",
  "key": "optional-custom-key"
}
Response:
{
  "success": true,
  "data": {
    "encryptedMessage": "encrypted_text_here",
    "key": "encryption_key_used",
    "keyGenerated": false
  }
}
cURL Example:
curl -X POST https://kdsm.vercel.app/api/v1/encrypt \
  -H "Content-Type: application/json" \
  -H "x-api-key: your_api_key_here" \
  -d '{
    "message": "Hello, World!",
    "key": "my-secret-key"
  }'

POST /decrypt

Decrypt a KDSM encrypted message.

Request Body:
{
  "encryptedMessage": "encrypted_text_here",
  "key": "decryption_key"
}
Response:
{
  "success": true,
  "data": {
    "decryptedMessage": "Hello, World!"
  }
}
cURL Example:
curl -X POST https://kdsm.vercel.app/api/v1/decrypt \
  -H "Content-Type: application/json" \
  -H "x-api-key: your_api_key_here" \
  -d '{
    "encryptedMessage": "encrypted_text_here",
    "key": "my-secret-key"
  }'

Error Responses

400 Bad Request
{
  "success": false,
  "error": "Message is required"
}
401 Unauthorized
{
  "success": false,
  "error": "Invalid API key"
}
429 Too Many Requests
{
  "success": false,
  "error": "Rate limit exceeded. Maximum 10 requests per day."
}

JavaScript SDK Example

Here's a simple JavaScript class to interact with the KDSM API:

class KDSMClient {
  constructor(apiKey, baseUrl = 'https://kdsm.vercel.app/api/v1') {
    this.apiKey = apiKey;
    this.baseUrl = baseUrl;
  }

  async encrypt(message, key = null) {
    const response = await fetch(`${this.baseUrl}/encrypt`, {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
        'x-api-key': this.apiKey
      },
      body: JSON.stringify({ message, key })
    });

    const data = await response.json();
    
    if (!data.success) {
      throw new Error(data.error);
    }
    
    return data.data;
  }

  async decrypt(encryptedMessage, key) {
    const response = await fetch(`${this.baseUrl}/decrypt`, {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
        'x-api-key': this.apiKey
      },
      body: JSON.stringify({ encryptedMessage, key })
    });

    const data = await response.json();
    
    if (!data.success) {
      throw new Error(data.error);
    }
    
    return data.data;
  }
}

// Usage example
const client = new KDSMClient('your_api_key_here');

// Encrypt a message
try {
  const result = await client.encrypt('Hello, World!');
  console.log('Encrypted:', result.encryptedMessage);
  console.log('Key:', result.key);
} catch (error) {
  console.error('Encryption failed:', error.message);
}

// Decrypt a message
try {
  const result = await client.decrypt('encrypted_text', 'your_key');
  console.log('Decrypted:', result.decryptedMessage);
} catch (error) {
  console.error('Decryption failed:', error.message);
}

Python Example

import requests
import json

class KDSMClient:
    def __init__(self, api_key, base_url="https://kdsm.vercel.app/api/v1"):
        self.api_key = api_key
        self.base_url = base_url
        self.headers = {
            "Content-Type": "application/json",
            "x-api-key": api_key
        }
    
    def encrypt(self, message, key=None):
        payload = {"message": message}
        if key:
            payload["key"] = key
            
        response = requests.post(
            f"{self.base_url}/encrypt",
            headers=self.headers,
            json=payload
        )
        
        data = response.json()
        if not data["success"]:
            raise Exception(data["error"])
            
        return data["data"]
    
    def decrypt(self, encrypted_message, key):
        payload = {
            "encryptedMessage": encrypted_message,
            "key": key
        }
        
        response = requests.post(
            f"{self.base_url}/decrypt",
            headers=self.headers,
            json=payload
        )
        
        data = response.json()
        if not data["success"]:
            raise Exception(data["error"])
            
        return data["data"]

# Usage example
client = KDSMClient("your_api_key_here")

try:
    # Encrypt a message
    result = client.encrypt("Hello, World!")
    print(f"Encrypted: {result['encryptedMessage']}")
    print(f"Key: {result['key']}")
    
    # Decrypt the message
    decrypted = client.decrypt(result['encryptedMessage'], result['key'])
    print(f"Decrypted: {decrypted['decryptedMessage']}")
    
except Exception as e:
    print(f"Error: {e}")

Best Practices

  • Store API keys securely: Never expose API keys in client-side code or public repositories
  • Use environment variables: Store API keys in environment variables or secure configuration files
  • Handle rate limits: Implement proper error handling for rate limit responses
  • Use HTTPS: Always use HTTPS when making API requests to protect data in transit
  • Key management: Store encryption keys separately from encrypted data
  • Error handling: Always check the success field in API responses

Important Notes

  • • API keys cannot be recovered if lost - store them securely
  • • Encryption keys are separate from API keys - both are required
  • • Rate limits are enforced per API key, not per user
  • • Deleted API keys are immediately revoked and cannot be restored

#FAQs

No. Without the exact key used for encryption, it's not possible to decrypt the message. There is no recovery mechanism by design for security reasons.