Skip to content

Post-Quantum cryptography Zenroom scripts for microservices

Notifications You must be signed in to change notification settings

ForkbombEu/tf-pqcrypto-scripts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Post-Quantum Cryptography Zenroom scripts

Multiplatofrm Post-Quantum cryptography Zenroom scripts for microservices or as a library.

Includes:

  • ML-DSA-44 sign: signs a string and returns string, signature and public key of the signer. Uses a private key included in the repo. If you want to create a new sk, use the example Apiroom or use Zenrooom CLI
  • ML-DSA-44 verify: verifies the output from above

As a microservice

The scripts can be used in Zenroom, or as a microservice.

When used as standalone, requires NCR to run

Quickstart

Setup and run

With the Makefile

make

Setup and run manually

Downlod NCR (runs only on Linux):

wget https://github.com/forkbombeu/ncr/releases/latest/download/ncr && chmod +x ncr

Run NCR or port 3333:

./ncr -p 3333 -z ../tf-pqcrypto-scripts/contracts

Create keys, print pubkeys

There are already secret and public keys in the folder ./contracts/keys that you can use for testing.

You can also create new keys, using the API create-keys or the corresponding applet that you can open at http://localhost:3333/create-keys/app, the new keys will be stored into ./contracts/keys/keyring.keys.json and ./contracts/keys/pubkeys.keys.json

You can also print out the pubkeys using the API print-pubkeys or the corresponing applet at http://localhost:3333/print-pubkeys/app

APIs

Once you have created your keys, you can:

  • Sign a string (using the secret key we just created) with ML-DSA-44

  • verify a ML-DSA-44 signature Note: if instead of a string you want to sign an object or data coming from an endpoint, 1 or 2 lines of Zencode are needed (ask us if you need help at [email protected])

  • encrypt a string using ML-KEM + AES (coming soon)

  • decrypt a string using ML-KEM + AES (coming soon)

Swagger

Open the browser at http://localhost:3333/docs

You should see something like:

Swagger

Applets

In Swagger, navigate the Generated Applets section, press execute and open the resulting URL in the browser, or access the applets directly from:

The applets look like:

Applet

About

Post-Quantum cryptography Zenroom scripts for microservices

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •