Skip to content

Kaalka Encryption is designed to work seamlessly across multiple platforms and provides a versatile encryption mechanism that incorporates the progressive value of time. By using dynamic time-based encryption, you can achieve secure communication that is inherently bound to a specific moment in time.

License

Notifications You must be signed in to change notification settings

PIYUSH-MISHRA-00/Kaalka-Encryption-Algorithm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 

Repository files navigation

DOI

Kaalka Encryption Algorithm

Time is the Key 🔑

🌟 Overview

Kaalka is a robust, time-driven encryption protocol for cross-platform security. It leverages clock angles, trigonometric functions, and time-based transformations—making every encryption unique to its timestamp. Kaalka supports envelope, seal, replay protection, chunked file encryption, and a CLI tool, all implemented natively in Python, JavaScript, Java, Kotlin, and Dart.


🚀 Features

  • Time-First Protocol: Envelope, seal, replay protection, time window
  • Envelope & Seal: Canonical structure, time-based integrity MIC
  • Replay Protection: In-memory ledger, auto-expiry
  • Chunked File Encryption: Large file support, lossless roundtrip
  • CLI Tool: Encrypt, decrypt, envelope, file operations
  • Cross-Platform: Identical logic in Python, JS, Java, Kotlin, Dart
  • Flexible API: System or user-defined timestamp
  • Production-Ready: Fully tested, documented, and versioned (v5.0.0)

📦 Supported Languages

Python · Node.js · Java · Kotlin · Dart

💻 Quick Start

Python

from kaalka import Kaalka
kaalka = Kaalka()
encrypted = kaalka.encrypt("Hello")
decrypted = kaalka.decrypt(encrypted)
# Explicit timestamp
encrypted_exp = kaalka.encrypt("Hello", time_key="12:34:56")
decrypted_exp = kaalka.decrypt(encrypted_exp, time_key="12:34:56")

Java

Kaalka kaalka = new Kaalka();
String encrypted = kaalka.encrypt("Hello");
String decrypted = kaalka.decrypt(encrypted);
// Explicit timestamp
String encryptedExp = kaalka.encrypt("Hello", "12:34:56");
String decryptedExp = kaalka.decrypt(encryptedExp, "12:34:56");

Kotlin

val kaalka = Kaalka()
val encrypted = kaalka.encrypt("Hello")
val decrypted = kaalka.decrypt(encrypted)
// Explicit timestamp
val encryptedExp = kaalka.encrypt("Hello", "12:34:56")
val decryptedExp = kaalka.decrypt(encryptedExp, "12:34:56")

Dart

final kaalka = Kaalka();
final encrypted = kaalka.encrypt('Hello');
final decrypted = kaalka.decrypt(encrypted);
// Explicit timestamp
final encryptedExp = kaalka.encrypt('Hello', timeKey: '12:34:56');
final decryptedExp = kaalka.decrypt(encryptedExp, timeKey: '12:34:56');

JavaScript

const Kaalka = require('kaalka');
const kaalka = new Kaalka();
const encrypted = kaalka.encrypt("Hello");
const decrypted = kaalka.decrypt(encrypted);
// Explicit timestamp
const encryptedExp = kaalka.encrypt("Hello", "12:34:56");
const decryptedExp = kaalka.decrypt(encryptedExp, "12:34:56");

🛡️ Protocol & CLI Highlights

  • Envelope: senderId, receiverId, timestamp, window, seq, ciphertext, seal
  • Seal: Time-based integrity MIC, auto-expiry, replay protection
  • Chunked File: Large file support, chunk index + timestamp
  • Explicit Timestamp Support:
    • All APIs and CLI commands allow you to pass a custom timestamp for encryption and decryption.
    • This enables time-variant security and cross-platform compatibility.
  • CLI Tool:
    • encrypt --in <inputFile> --out <outputFile> --sender <id> --receiver <id> --timestamp <time>
    • decrypt --in <inputFile> --out <outputFile> --receiver <id> --timestamp <time>
    • envelope --text "message" --sender <id> --receiver <id> --timestamp <time>

🧪 Testing & Reliability

  • Unit Tests: Protocol, envelope, seal, replay, chunking, CLI
  • Cross-Platform: Identical results across all supported languages
  • Production-Ready: All tests pass, robust error handling

📚 Documentation & API

  • API Reference:
    • encryptEnvelope(plaintext, senderId, receiverId, timestamp?)
    • decryptEnvelope(envelope, receiverId, timestamp?)
    • encryptFileChunks(fileBytes, senderId, receiverId, timestamp?)
    • decryptFileChunks(chunks, receiverId, timestamp?)
  • CLI Usage: See above
  • Changelog: See CHANGELOG.md

🔄 Cross-Platform Compatibility


🤝 Contributing

Contributions, bug reports, and feature requests are welcome.
Submit issues or pull requests via GitHub.


💡 Author & Credits

Developed and maintained by Piyush Mishra.
Thanks to contributors across all supported language implementations.

Time is the Key.

About

Kaalka Encryption is designed to work seamlessly across multiple platforms and provides a versatile encryption mechanism that incorporates the progressive value of time. By using dynamic time-based encryption, you can achieve secure communication that is inherently bound to a specific moment in time.

Resources

License

Stars

Watchers

Forks

Packages

No packages published