This is a client-side web application for a decentralised ZK-ABE system. This includes a server that generates the public key and master secret key, and also with a codebase for encryption, secret key generation, and decryption.
The codebase for the ABE system we are using is derived from the rabe
library, specifically focusing on the cipher text attribute-based encryption scheme proposed by BSW (John Bethencourt, Amit Sahai, Brent Waters).
The following are for who want to execute the program in their local machine.
- Make sure
rust
andcargo
are all installed in your machine - Set up an account in
supabase
, which is used to store public key and master secret key. - Create a table in
supabase
calledkeys
. And create 2 columns (public_key
andmaster_secret_key
) in this table.
fig. 1 creation of two columns: public_key
and master_secret_key
This step should be conducted by the maintainer of key generator server.
The first step is to generate a public key and master secret key for the user to encrypt data, generate secret key and decrypt cipher text.
Since the codebase we are using is a Rust
library, we have to convert them into web assembly language, which would be compiled into the form that our browser is able to read.
Turn on the terminal and make sure you are in the root of this directory.
- Run
cd keygen_server
- Run
cp .env.example .env
and fill in the information (supabase URL and public anon API key, see fig. 2) - Run
wasm-pack build --target web
to buildwasm
- Run
cargo run
to generate public key and master secret key in your database
fig. 2 Supabase URL and anon/public API key
First, run the development server:
pnpm dev
Open http://localhost:3000 with your browser to see the result.
To learn more about Next.js, take a look at the following resources:
- Next.js Documentation - learn about Next.js features and API.
- Learn Next.js - an interactive Next.js tutorial.
You can check out the Next.js GitHub repository - your feedback and contributions are welcome!
The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.
Check out our Next.js deployment documentation for more details.