Show HN: Mrs-Hybride-PQC – Hybrid Kyber1024 KEM 5-6x Faster Than HKDF-SHA256

A19dammer911 pts0 comments

GitHub - A19dammer91/MRS-Hybride-PQC: Hybrid Post-Quantum cryptographic library: Kyber1024 KEM + MRS(19,9) Diophantine key derivation + AES-256-GCM encryption. · GitHub

/" data-turbo-transient="true" />

Skip to content

Search or jump to...

Search code, repositories, users, issues, pull requests...

-->

Search

Clear

Search syntax tips

Provide feedback

--><br>We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Cancel

Submit feedback

Saved searches

Use saved searches to filter your results more quickly

-->

Name

Query

To see all available qualifiers, see our documentation.

Cancel

Create saved search

Sign in

/;ref_cta:Sign up;ref_loc:header logged out"}"<br>Sign up

Appearance settings

Resetting focus

You signed in with another tab or window. Reload to refresh your session.<br>You signed out in another tab or window. Reload to refresh your session.<br>You switched accounts on another tab or window. Reload to refresh your session.

Dismiss alert

{{ message }}

A19dammer91

MRS-Hybride-PQC

Public

Notifications<br>You must be signed in to change notification settings

Fork

Star

main

BranchesTags

Go to file

CodeOpen more actions menu

Folders and files<br>NameNameLast commit message<br>Last commit date<br>Latest commit

History<br>9 Commits<br>9 Commits

src

src

.gitignore

.gitignore

Cargo.lock

Cargo.lock

Cargo.toml

Cargo.toml

LICENSE

LICENSE

README.md

README.md

View all files

Repository files navigation

MRS Hybride PQC

Hybrid Post-Quantum cryptographic library combining Kyber1024 KEM,<br>MRS(19,9) Diophantine key derivation, and AES-256-GCM encryption.

Overview

This library couples a post-quantum key encapsulation mechanism<br>(Kyber1024, NIST Security Level 5) with a fast, constant-time<br>number-theoretic key derivation step based on the MRS(19,9) Diophantine<br>decomposition system. The two derived values are combined via XOR into<br>a single session key, which is then used for authenticated encryption.

Architecture

Stage<br>Function<br>Description

Block 1<br>kyber_keygen, kyber_encapsulate, kyber_decapsulate<br>Kyber1024 key encapsulation

Block 2<br>derive_mrs_master_key<br>MRS(19,9) decomposition → fast O(1) key derivation (A0 = N mod 9)

Coupling<br>hybrid_coupling<br>k_combined = k1 XOR mk

Block 3<br>encrypt_payload, decrypt_payload<br>AES-256-GCM AEAD encryption/decryption

Important: the MRS(19,9) component is a constant-time, O(1)<br>key-derivation step, not an independent security layer. When<br>session_id is public (the default usage pattern), derive_mrs_master_key<br>contributes no additional entropy; all cryptographic security in that<br>case comes from Kyber1024's k1. See Limitations below for when this<br>step does add independent security value.

Usage

use mrs_auth_pqc::MrsAuthKem;

let keypair = MrsAuthKem::kyber_keygen();

let packet = MrsAuthKem::full_encrypt(<br>&keypair.public_key,<br>session_id,<br>hkdf_context,<br>&nonce,<br>associated_data,<br>plaintext,<br>)?;

let plaintext = MrsAuthKem::full_decrypt(<br>&keypair.secret_key,<br>&packet,<br>session_id,<br>hkdf_context,<br>&nonce,<br>associated_data,<br>)?;

Build & Test

To validate the internal number-theoretic tests:

cargo test

To bench the official microsecond/nanosecond speed performance yourself:

cargo bench

Limitations

derive_mrs_master_key is deterministic and operates on whatever session_id it is given. If session_id is known to an attacker (the common case), mk provides no security margin. All confidentiality relies entirely on Kyber1024's k1.

For the MRS step to contribute independent entropy, session_id would need to be a secret shared via a channel independent of this library, which introduces its own key-distribution problem.

This library has not undergone external cryptographic review.

The primary demonstrated contribution of MRS(19,9) is speed: a constant-time O(1) derivation path, not an additional security guarantee, when used with public session identifiers.

Dependencies

pqcrypto-kyber - Kyber1024 post-quantum KEM

aes-gcm - AES-256-GCM AEAD encryption

sha2 - SHA-256 for MRS master key derivation

License

Apache-2.0

Author

Bilal El Issaoui

About

Hybrid Post-Quantum cryptographic library: Kyber1024 KEM + MRS(19,9) Diophantine key derivation + AES-256-GCM encryption.

Resources

Readme

License

Apache-2.0 license

Uh oh!

There was an error while loading. Please reload this page.

Activity

Stars

stars

Watchers

watching

Forks

forks

Report repository

Releases

No releases published

Packages

Uh oh!

There was an error while loading. Please reload this page.

Contributors

Uh oh!

There was an error while loading. Please reload this page.

Languages

Rust<br>100.0%

You can’t perform that action at this time.

kyber1024 derivation library encryption reload cargo

Related Articles