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.
- 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)
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")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");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")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');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");- 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>
- Unit Tests: Protocol, envelope, seal, replay, chunking, CLI
- Cross-Platform: Identical results across all supported languages
- Production-Ready: All tests pass, robust error handling
- 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
- Python: PyPI
- Node.js: npm
- Dart: pub.dev
- Java/Kotlin: GitHub Releases
Contributions, bug reports, and feature requests are welcome.
Submit issues or pull requests via GitHub.
Developed and maintained by Piyush Mishra.
Thanks to contributors across all supported language implementations.