Skip to content

ErosCamacho/kyber_sw

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

Kyber-SW

2024-02-28 - Eros Camacho-Ruiz ([email protected])

This is the repository of the evaluation carried out in the Kyber cryptosystem that is the research starting point of the ML-KEM cryptosystem in the QUBIP project. The idea was to create a demo to stablish a secured communication between two devices.

Table of Contents

  1. Directory structure
  2. IP Integration
  3. Installation and Use of the Demo
  4. Example of the Demo
  5. Note for version
  6. Contact
  7. Developers

Directory structure

  • kyber_SW: the folder that contains the Kyber software implementation
    • data_in: stores the input ciphertext in binary format when the demo is running.
    • data_out: stores the output ciphertext in binary format when the demo is running.
    • gen_keys: stores the generated keys.
    • pub_keys: stores the public keys of the devices to connect.
    • kyber: source files
      • common: extra functions
      • src: Kyber SW libraries (ML-KEM)
    • Makefile: to generate the executables for the library
    • demo.c: main file to demo
  • README.md: this file

Installation and Use of the Demo

The main idea of the Demo is to interconnect two devices and share information using PQC (Kyber) as the next figure shows. In this case, one RaspberryPi platform and a Pynq platform are interconnected in a local network. The two of them are going to generate the key pair (public and private keys). Then, one of them is going to recive the public key of the other one using this key to encapsulate a shared secret. Then the ciphertext generated (with the information of the shared secret) is sent to the other platform that will use the private key to decapsulate and extract the shared secret.

  1. For compilation of a specific demo:
make demo_XXXX

where XXX can be: kem512, kem768, kem1024, kem512-90s, kem768-90s, kem1024-90s. So, for example if the user wants to compile something related with the parameter set kyber512, they must issue: make demo_kem512

  1. For the use, the program has different input variables:

    • -h : Show the help.
    • -k : Key generation.
    • -e : Encapsulation.
    • -d : Decapsulation.

    Also it includes verbose options:

    • -v : verbose level level
      • 1: Show only functions.
      • 2: Show intermediate results.
      • 3: Show keys.

Example of the Demo

There is an example in the Youtube channel of the QUBIP project: Link. Also, the demo video example can be downloaded in the next link.

For the example, two platforms will be used: #RPI-4 and #PYNQ-Z2. It is recommended that the verbose level be 3 in order to see all the intermediate results.

Note: For the execution, it is mandatory to activate root privileges.

  1. The first step is to perform the key generation in both platforms:
demo_kyber509 -k -v 3
  1. The next step is to send the public key of the #PYNQ-Z2 to the #RPI-4:
send_pk.sh

Note: the configuration set in send_pk.sh can be modified to the final user. It has been set to my personal set-up.

  1. The next step is to encapsulate the shared secret using the public key in the #RPI-4.
demo_kyber509 -e -v 3
  1. The next step is to send the ciphertext generated in the below step back to the #PYNQ-Z2:
send_ct.sh

Note: the configuration set in send_ct.sh can be modified to the final user. It has been set to my personal set-up.

  1. The next step is to recover the shared secret in the #PYNQ-Z2 decapsulating:
demo_kyber509 -d -v 3

At the end, it will check that both platforms share the same secrets.

Note for version

v. 1.0

  • Reordered the repository structure.
  • Added a Readme file.

Contact

Eros Camacho-Ruiz - ([email protected])

Hardware Cryptography Researcher

Instituto de Microelectrónica de Sevilla (IMSE-CNM), CSIC, Universidad de Sevilla, Seville, Spain

Developers

Eros Camacho-Ruiz

Instituto de Microelectrónica de Sevilla (IMSE-CNM), CSIC, Universidad de Sevilla, Seville, Spain

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published