Sharing Secrets with Confidence
⚠️ This is a completely experimental (proof-of-concept) project and should be used at your own risk.
Secret sharing application using Asymmetric Encryption (public/private key pair). We can create a new Key Pair and save the Public Key to a Supabase DB table. We can then encrypt a secret with the Public Key and decrypt it with the Private Key.
The encryption & decryption is done using RSA-OAEP algorithm, for which the keys are 2048 bits long & supports asymmetric encryption. The application generates & accepts Private & Public Keys in JWK format.
- Securely Sharing Username/Password with a team member over an email as an encrypted text
- Sharing
.envfiles with a team member over slack/teams as an encrypted text - Sharing sensitive information with a third party
- Sharing sensitive information with a client
- 🔑 Create new Key Pair (public/private)
- 🛅 Save Public Keys to Supabase DB table
- 🔐 Encrypt a secret with a Public Key (also fetch from supabase)
- 🔓 Decrypt a secret only by a Private Key
- Persistence: Add Supabase DB table to store Public Keys with titles
- Authn: Add Authentication using Supabase Auth
- Security: Add ECDSA (Elliptic Curve Digital Signature Algorithm) or ECDH (Elliptic Curve Diffie-Hellman) support to sign the encrypted secrets for increased security
- Chore: Cleanup application code style and structure (project was created as a Proof of Concept)
- Authz: Limit fetch from supabase for authenticated & authorized users (something roles/permissions)
Install the dependencies:
bun install-
Copy the
.env.examplefile to.env.localand fill in the values.cp .env.example .env.local
-
Setup Supabase credentials in
.env.local -
Create a
public_keystable in Supabase with the following schema:💡 You can go to your Project > SQL Editor (left sidebar) > paste the following SQL query and execute it
create table public.public_keys ( id uuid not null default gen_random_uuid (), title text null, key text null, created_at timestamp with time zone not null default now(), constraint public_keys_pkey primary key (id), constraint public_keys_title_key unique (title) ) tablespace pg_default; -
Make sure the Row Level Security (RLS) policy are set properly in Supabase for the table
public_keys. Make sure theINSERT&SELECTpolicies have the roleanon&authenticatedset. -
Run the development server:
bun dev
Open http://localhost:3000 with your browser to see the result.
As this tool is meant for internal or personal use, the registration is limited to your projects organization members only (on supabase). To open up the registration you may need to setup custom SMTP provider in the Supabase Authentication settings.
This project is for internal purposes only. It is not intended to be used for any production environment. The author or contributors are not responsible for any damages caused by the use of this project. Use it at your own risk.
This project is an open-sourced software licensed under the MIT license.