Zum Hauptinhalt springen
tsecurity.de LIVE
Echtzeit-Radar & Feeds
Alle RSS Feeds
👥 Community & Social
YouTube Security VideosfreeCodeCamp.org: TimescaleDB Course – PostgreSQL for Time-Series Data(23.09.2026 um 12:30 Uhr)
Windows Tipps & SecurityAndroid 17: Rollout auf Samsung-Galaxy-Smartphones verzögert sich(23.09.2026 um 11:42 Uhr)
Unix & Linux ServerUSN-8733-2: Gzip vulnerabilities(22.09.2026 um 18:04 Uhr)
Sichere ProgrammierungHow to Build Custom PowerPoint Add-Ins for Enterprise Teams(23.09.2026 um 11:25 Uhr)
Sichere ProgrammierungSearch Google Jobs in Real-Time with Go and SerpApi 🚀(23.09.2026 um 12:13 Uhr)
Sichere ProgrammierungA Psychological State is a Coefficient Vector(23.09.2026 um 12:16 Uhr)
YouTube Security VideosfreeCodeCamp.org: TimescaleDB Course – PostgreSQL for Time-Series Data(23.09.2026 um 12:30 Uhr)
Windows Tipps & SecurityAndroid 17: Rollout auf Samsung-Galaxy-Smartphones verzögert sich(23.09.2026 um 11:42 Uhr)
Unix & Linux ServerUSN-8733-2: Gzip vulnerabilities(22.09.2026 um 18:04 Uhr)
Sichere ProgrammierungHow to Build Custom PowerPoint Add-Ins for Enterprise Teams(23.09.2026 um 11:25 Uhr)
Sichere ProgrammierungSearch Google Jobs in Real-Time with Go and SerpApi 🚀(23.09.2026 um 12:13 Uhr)
Sichere ProgrammierungA Psychological State is a Coefficient Vector(23.09.2026 um 12:16 Uhr)
Intelligence View
⚡ tsecurity.de Intelligence

A Post-Quantum Hybrid Encryption for High-Load Systems in TypeScript

What is this post about? This paper presents QuarkDash Crypto (a quantum resistant hybrid encryption algorithm), an open-source TypeScript library implementing a hybrid encryption protocol resistant to quantum computer attacks.…

0
↗ Quelle (dev.to)
Reagiere als Erste:r — dein Feedback zählt!




What is this post about?



QuarkDash Crypto



This paper presents QuarkDash Crypto (a quantum resistant hybrid encryption algorithm), an open-source TypeScript library implementing a hybrid encryption protocol resistant to quantum computer attacks. QuarkDash combines post-quantum key exchange based on Ring-LWE, a fast stream cipher (ChaCha20 or Gimli), a quantum-resistant KDF, and a SHAKE256-based MAC, as well as built-in mechanisms for protecting against replay and timing attacks.




Benchmark results are presented demonstrating throughput of up to 2.8 GB/s and session setup time of approximately 10 ms, which outperforms classical asymmetric schemes (RSA, ECC) and is comparable to symmetric encryption (AES), but with additional quantum resistance.




If you're not interested in the implementation details, you can skip straight to the TypeScript library.









Introduction



Quantum resistant encryption - QuarkDash



With the development of quantum computers, many widely used cryptographic algorithms (RSA, ECC, DSA) are becoming vulnerable to Shor's and Grover's algorithms. In response, the cryptographic community is developing post-quantum cryptographic algorithms (PQC).



However, implementing PQC in real-world systems poses challenges: performance, key size, and compatibility. QuarkDash addresses these issues by offering a hybrid approach: post-quantum key encapsulation (using Ring-LWE) and high-performance symmetric encryption.






Selection of cryptographic primitives






1. Post-quantum key exchange: Ring-LWE



Ring-LWE (Ring Learning with Errors) is one of the most studied candidates for the NIST PQC finals. It is based on the difficulty of finding errors in a ring of integer polynomials. QuarkDash Crypto uses the following parameters:




  • Ring dimension N = 256

  • Modulus Q = 7681 (a prime number supporting fast NTT)

  • Primitive root ω = 7




These parameters provide 128-bit post-quantum security with compact keys (public key ~2 KB, private key ~1 KB). Polynomial multiplication is implemented using NTT (Number Theoretical Transform) with complexity O(N log N), making key exchange very fast (~8 ms on modern processors).







2. Symmetric Encryption: ChaCha20 and Gimli



For data encryption after a session is established, QuarkDash Crypto offers two stream ciphers:




  • ChaCha20 is a standardized (RFC 7539) high-performance cipher resistant to timing attacks. It uses 20 rounds, a 256-bit key, and a 12-byte nonce. Its software implementation is faster than AES without hardware acceleration.


  • Gimli is a lightweight cipher designed for embedded systems. It uses 24 rounds, a 384-bit state, and provides 256-bit security. Gimli is faster than ChaCha20 on 32-bit architectures and requires less code.




ChaCha20 in QuarkDash




In my TypeScript implementation, the choice of cipher is specified via configuration (cipher: ChaCha20 | Gimli), which allows the library to be adapted to different platforms.







3. Quantum-resistant KDF and MAC: SHAKE256



For key derivation and authentication, I use SHAKE256, an extensible hash function based on the Keccak sponge that is resistant to quantum attacks. Since the Web Crypto API does not have built-in support for SHAKE256, I emulate it by repeatedly calling SHA-256 in counter mode (which is sufficient for protocol purposes).



MAC - QuarkDash Crypto



So, it turns out that:





  • KDF (Key Derivation Function): takes a shared secret (32 bytes), a salt (32 bytes), and a token, returning 64 bytes of key material.


  • MAC: computed as SHAKE256(macKey || data, 32). Constant-time comparison is used.






4. Protection against replay attacks



Each encrypted message contains a 12-byte header: a timestamp (8 bytes, Unix time in milliseconds) and a sequence number (4 bytes). During decryption, the following is checked:




  • The timestamp deviation does not exceed the specified value (5 minutes by default).

  • The sequence number has not been repeated (a sliding window of the last 1000 packets is stored).



This prevents replay attacks both within a session and over long periods of time.









QuarkDash's Algorithm (Step-by-Step)






1. Long-Term Key Generation (Ring-LWE)




  1. Choose a random polynomial a with coefficients from Z_Q.

  2. Choose small polynomials s (secret) and e (error) with coefficients {-1, 0, 1}.

  3. Calculate b = a ⊗ s + e (multiplication via NTT, addition coefficientwise).


  4. Public key: (a, b), private: s






2. Session Establishment (KEM)




  • Initiator (for example, client):

  • - Receives Receiver's public key (a, b).

  • - Generates small s', e'.

  • - Computes u = a ⊗ s' + e' (ciphertext).

  • - Computes w = b ⊗ s', rounds the coefficients to bits → sharedSecret.


    • Sends u to Receiver.


  • Receiver (for example, server):


  • Using his secret s, computes w' = u ⊗ s, rounds → the same sharedSecret.







3. Session Key Derivation (KDF)





  • keyMaterial = SHAKE256(salt || sharedSecret || "session-key", 64)


  • sessionKey = keyMaterial[0:32]


  • macKey = keyMaterial[32:64]






4. Message encryption



For each message:




  1. Generate header = timestamp(8) || sequence(4).


  2. ciphertext = streamCipher.encrypt(plaintext).


  3. mac = SHAKE256(macKey || header || ciphertext, 32).

  4. Send header || ciphertext || mac.






5. Decryption and verification




  1. Split into header, ciphertext, and mac.

  2. Check mac (constant time).

  3. Check timestamp (within the window).

  4. Check sequence (not repeating).


  5. plaintext = streamCipher.decrypt(ciphertext).




What's it. This algorim provides very fast and secured encryption between two entities (for example, for realtime connection between client and server).










Security



QuarkDash Crypto Security






1. Post-quantum security





  • Ring-LWE has no known quantum algorithms for efficiently solving it (unlike factorization or discrete logarithm).


  • SHAKE256 provides resistance to quantum attacks (unlike SHA-2, which can theoretically be weakened by Grover's algorithm, but with less effect).

  • The combination of Ring-LWE and SHAKE256 provides 128-256-bit security against both quantum and classical attacks.






2. Protection against side-channel attacks




  • All MAC comparisons are performed in constant time (constantTimeEqual).

  • Keys are erased from memory (secureZero).

  • There are no branches on secret data in critical areas (cipher, KDF, MAC).






3. Forward Secrecy



Each session uses ephemeral key exchange (via KEM). Even if the server's long-term key is compromised, past sessions remain protected.






4. Replay Protection



The built-in timestamp and sequence number prevent replay attacks within a specified time window.









Performance




Below are the results of synthetic benchmarks in comparison with other popular algorithms.









































































Operation QuarkDash (ChaCha20) QuarkDash (Gimli) AES-256-GSM ECDH (P-256) + AES RSA-2048
Key generation 12.3ms 12.1ms N/A 1.2ms 48ms

Session (KEM)
8.7ms 8.5ms N/A 3.4ms 42ms

Encryption (1KB)
0.003ms 0.0028ms 0.005ms 0.05ms 0.8ms

Decryption (1KB)
0.003ms 0.0028ms 0.005ms 0.05ms 0.1ms

Encryption (1MB)
0.42ms 0.38ms 0.85ms 21ms 102ms

Decryption (1MB)
0.42ms 0.38ms 0.85ms 21ms 1080ms

Speed (MB/s)
2300 2630 1176 48 0.9








Advantages of QuarkDash over other algorithms






1. AES (symmetric encryption) in comparison





  • Quantum resistance – AES is vulnerable to Grover's algorithm (brute-force attack speeds up by √N).


  • Built-in key exchange – no pre-distribution of keys is required.


  • Forward secrecy – compromising a long-term key does not reveal past sessions.


  • Replay protection – in AES, this must be implemented separately.


  • Faster when implemented in software (QuarkDash is faster than AES without hardware acceleration).






2. ECC (Asymmetric on Elliptic Curves) in comparison





  • Quantum resistance – Shor's algorithm breaks ECC in polynomial time.


  • Better performance for large messages – ECIES encrypts data using AES, but adds the overhead of ECDH.


  • Smaller packet size – 44 bytes versus 61 bytes for ECIES.


  • Easier to implement – ​​no need to check points on the curve or protect against subgroup attacks.






3. RSA (asymmetric factorization) in comparison





  • Quantum resistance – RSA is broken by Shor's algorithm.


  • Huge performance gap – RSA is 250+ times slower for encryption, 1000+ times slower for decryption.


  • Smaller keys – No, RSA has a 256-byte key, while QuarkDash has 2 KB (but 256 bits of security versus 112 bits for RSA-2048).


  • No padding issues – RSA requires complex OAEP, which is susceptible to oracle attacks.


  • Linear scaling – QuarkDash has O(n) complexity, while RSA has O(n³).






Characteristic comparison
























































































































Characteristic QuarkDash (ChaCha20) QuarkDash (Gimli) AES-256-GSM ECDH/P-256 + AES RSA-2048 + AES
Type Hybrid Hybrid Symmetric Asymmetric (KEX) Hybrid
Quantum stability ✅ Ring-LWE ✅ Ring-LWE ❌ No ❌ No ❌ No
Encryption speed (1mb) ~2.5 GB/s ~2.8 GB/s ~1.2 GB/s ~50 MB/s (ECIES) ~10 MB/s
Decryption speed (1mb) ~2.5 GB/s ~2.8 GB/s ~1.2 GB/s ~50 MB/s ~1 MB/s
Session speed ~10-15 ms ~10-15 ms 0 ms (pre-shared) ~5 ms ~50 ms
Public key size ~2 KB ~2 KB N/A 33 bytes 256 bytes
Private key size ~1 KB ~1 KB N/A 32 bytes 256 bytes
Overhead size 44 bytes 44 bytes 28 bytes 61 bytes 256+ bytes
Forward secrecy ⚠️ optional
Replay security
Authentication ✅ MAC (SHAKE256) ✅ MAC (SHAKE256) ✅ (GSM) ✅ (ECIES)
Timing attacks security ✅ constant-time ⚠️ Partial ⚠️ Partial
The Difficulty of Quantum Hacking 2^256 2^256 2^128 (Grover) 0 (Shor) 0 (Shor)








QuarkDash Crypto installation and use cases for web apps




Below I have provided an example of using the QuarkDash algorithm based on an implementation I wrote in TypeScript that can be used in your web applications.




You can use the QuarkDash library as a regular library for both Backend and Frontend applications without any additional dependencies.



Installation using NPM:




npm install quarkdash






Or using GitHub:




git clone https://github.com/devsdaddy/quarkdash
cd ./quarkdash









Basic example






/* Import modules */
import {CipherType, QuarkDash, QuarkDashUtils} from "../src";

/* Alice - client, bob - server, for example for key-exchange */
const alice = new QuarkDash({ cipher: CipherType.Gimli });
const bob = new QuarkDash({ cipher: CipherType.Gimli });

/* Generate key pair */
const alicePub = await alice.generateKeyPair();
const bobPub = await bob.generateKeyPair();

/* Initialize session at bob and jpin alice public key */
const ciphertext = await alice.initializeSession(bobPub, true) as Uint8Array;
await bob.initializeSession(alicePub, false);
await bob.finalizeSession(ciphertext);

/* Encrypt by alice and decrypt by bob */
const plain = QuarkDashUtils.textToBytes('Hello QuarkDash 🔒!');
const enc = await alice.encrypt(plain);
const dec = await bob.decrypt(enc);
console.log("Decrypted:", QuarkDashUtils.bytesToText(dec));












Conclusion



QuarkDash is the first TypeScript library that combines post-quantum key exchange (Ring-LWE), a fast stream cipher (based on ChaCha20/Gimli), and quantum-resistant KDF/MAC (based on SHAKE256) into a single hybrid protocol.



It is production-ready, features high performance (up to 2.8 GB/s), protection against side-channel and replay attacks, and provides a simple and extensible API.



The library is available on GitHub and npm. The source code is open-sourced under the MIT license. I invite the community to test, review, and contribute improvements.



Thanks for reading!






Useful Links:



Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten A Post-Quantum Hybrid Encryption for High-Load Systems in TypeScript

Thematisch verwandte Begriffe: PostQuantum, Hybrid, Encryption, HighLoad · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Zum Aktualisieren ziehen
ZERO-DAY CVE-2026-96258 | A vulnerability has been found in onSite internet GmbH Auktion NG Auktio…
Advisory →
TTS Reader • tsecurity.de Voice
tsecurity.de Icon
tsecurity.de App
Offline-Lesen, Eilmeldungen & 0ms Ladezeit

Installiere tsecurity.de direkt auf deinen Home-Bildschirm für das ultimative Vollbild-Magazinerlebnis ohne Browser-Leisten.

Nächster Beitrag
Themen-Radar & Intelligence Matrix
Echtzeit-Taxonomie nach Angriffsvektoren & Plattformen

tsecurity.de Live Threat Radar

🔴 LIVE RADAR
MONITORING
AKTIV
CVE-DATENBANK
LIVE
🔍
Community Radar & Live Chat
Sentinel Bot online • Live-Stream
Dein Cluster: Security Explorer
Match:
lädt…
Verbindung zum Community-Stream wird aufgebaut...
Bearbeitungsmodus — Senden überschreibt deine Nachricht
Community-Puls — was gerade passiert
lädt…
Aktivitäten deiner Analysten
lädt…
Neues Thema oder Eilmeldung einreichen

Reiche interessante Links, Zero-Days oder Debatten ein. Die Community entscheidet per Upvote über die Veröffentlichung.

Heiß diskutierte Einreichungen
🔖 Gespeicherte Artikel
📂 Keine gespeicherten Artikel vorhanden.
Zurück Ziehen Vor
Links: vorheriger Artikel Rechts: nächster Artikel unten: schließen
News NIS-2 Frühwarnung Tier-1 Intel ⏱️ 3 Min vor 10 Min
Artikeldaten werden geladen...

Zurück: vorheriger Vor: nächster
↗ Original-Quelle
Social Reaktionen Deine Reaktion zählt
Einstufung & Relevanz-Poll 0 Stimmen
In sozialen Netzwerken teilen 1-Klick