This program:
- Generates a Kyber768 keypair
- Encrypts a message (from message.txt)
- Decrypts it back
Example Output:
Public Key: 3F5A6E...C27A
Secret Key: 2E1C8D...91B3
Ciphertext: AECF4B...7D12
Shared Secret (Sender): 0A1B2C...9F
Shared Secret (Receiver): 0A1B2C...9F
✅ Shared secrets match!
Warning : You need to install and build the liboqs library for this demo to work.
Steps:
git clone https://github.com/open-quantum-safe/liboqs.git
cd liboqs
cmake -DCMAKE_INSTALL_PREFIX=/usr/local -S . -B build
cmake --build build
sudo cmake --install build
To run:
gcc -O2 -Wall main.c -o main -loqs
./main