A cryptosystem πŸ’Ώ

Overview

こま

A cryptosystem πŸ’Ώ

δ½•οΌŸ πŸ§ͺ

こま (also called Komatta) is an utility / library which implements a fast (yet to be tested) cryptosystem: encryption, integrity (signed or unsigned).

γ©γ†γ‚„γ£γ¦οΌŸ πŸ€”

As its primitives, it uses Blake3 for the keyed hash function (not using the Blake3's native keyed hash) and Argon2.

subkey is an Argon2 of random salt || symmetric key

Cypher πŸ”‘

It's symmetric and variable-length. Here is a brief explanation of how the mechanism works:

  1. A random iv is generated
  2. Input is divided in blocks of length equal to the block size to get the plain blocks
  3. Create an array of byte arrays cyphered blocks where the encrypted blocks will be stored
  4. Enumerate and iterate plain blocks (offset, block):
    1. Get the last cyphered block from cyphered blocks (if the array is empty, this value will be the keyed hash of iv using subkey as the key)
    2. Calculate the keyed hash of offset using sub key as the key to get the counter
    3. counter will be now equal to counter ⨁ last cyphered block (if counter > last cyphered block, last cyphered block is repeated until both are the same length) (if counter < last cyphered block, last cyphered block's latest elements will be popped out of the array until both are the same length)
    4. Calculate block ⨁ counter to get cyphertext (if block length > counter length, counter is repeated until both are the same length) (if block length < counter length, counter's latest elements will be popped out of the array until both are the same length)
    5. Push cyphertext to cyphered blocks
  5. Concatenate all the cyphered blocks's arrays

Integrity πŸ”’

input is block size || integrity kind || iv || cyphertext

Signed

Signatures are generated using Dilithium5 with an input and a previously generated keypair. Using signed integrity can achieve:

  • Integrity
  • Authenticity

Unsigned

Unsigned integrity is achieved by calculating a keyed hash of input using subkey as the key. Using unsigned integrity can achieve:

  • Integrity
  • Authenticity

発達 πŸ§‘β€πŸ’»

γƒͺγ‚Ήγƒˆγ‚’θ‘Œγ† πŸ›Έ

わからγͺい!

You might also like...
Owner
Oskar
β€œWhile the world sleeps, γŠγ™γ‹γ‚ dream”
Oskar
A cryptosystem πŸ’Ώ

こま A cryptosystem ?? δ½•οΌŸ ?? こま (also called Komatta) is an utility / library which implements a fast (yet to be tested) cryptosystem: encryption, integ

Oskar 2 Sep 5, 2022
Baek-Zheng threshold cryptosystem on top of BLS12-381

bzte A rust implementation of the Baek-Zhang threshold cryptosystem on top of BLS12-381 using arkworks Why threshold encrypt? The advantage of thresho

null 4 Jun 28, 2022
A cryptosystem πŸ’Ώ

こま A cryptosystem ?? δ½•οΌŸ ?? こま (also called Komatta) is an utility / library which implements a fast (yet to be tested) cryptosystem: encryption, integ

Oskar 2 Sep 5, 2022