Credential Manager is an application that lets you manager your digital credentials and signatures such as secrets, API keys, passwords in a familiar key-value pairs with sharing feature enabled using Relationship Based Access Control (ReBAC), along with storing images as well.
cred-manager-vid-480-rembg-.git.mp4
- To manage digital credentials, and have a go-to tool, accessible in least clicks.
- To efficiently share credentials and manage them.
- To have a single place for all credentials.
- End-To-End Encryption (E2EE) enabled with client-side decryption only, meaning only you can access and decrypt the credential value. (though, credential name is not encrypted).
- Ability to share individual credential with other users with specific access control:
a. Viewer : Can 'view' only.
b. Editor : Can 'view' and 'edit' only.
c. Author : Can ''view', 'edit' and 'delete' only.Note : Only you can 'share' the credential with others.
- More than just key-value credentials, you can store image credentials (=<1MB) via cloudinary.
Note : Encryption is not applied to image credentials, admin can view them via cloudinary console.
NOTE : You must download (export) your crypto-keys from dashboard, they are digital keys to your credentials as well as used and asked when you login in different browser, re-login, or change devices.
- Smooth authentication using Passkey login, Single-sign-on with google, or via username-password.
- Download all your credentials in beautiful markdown format.
- Reset your password if needed.
- Resetting password during login via One-Time-Password with registered email.
- Export your crypto keys in a click, and use credential manager on any platform and still have access to your data without compromising security and privacy.
- View all the credentials shared with you in well structured manner and perform operation on them.
Backend : Nodejs, Expressjs
Frontend : HTML/CSS/JS
Important implementations :
1. Cloudinary : for management of image credentials.
2. Nodemailer : for verifying users.
3. Permit.io : for decoupling authorization (available in docker image, not in this repository)
4. Simplewebauthn : for passkey authentication.
Database : MongoDB
Note : This method does not run 'Permit' service, though it does not affect the application.
- Fork this repository.
- Clone the forked repository in your machine/computer.
- Ensure that you are on
mainbranch. - Follow the following steps:
cd to\your\cloned\repo
touch .env # this will create .env file
#after this, copy the contents from .env.example to newly created .env
npm install # this will install all required dependencies
npm start # start the server - Now your server should be up and running at port 3005.
Note: With this implementation, we are not using 'Permit' service.
What is Permit.io ?
Permit.io provides service to decouple authorization logic from main code base, means you can up-scale/down-scale authorization without affecting main codebase.
Permit is used as a additional service, in this project, and it will not directly affect the code if implemented as mentioned. You can find it's implementation in
permitAuthorization.jsfile in
utilsfolder.
For more details visit: https://docs.permit.io/ .
- Install and setup docker desktop and docker CLI from (docker official)[https://www.docker.com/get-started/].
- Run
docker pull meayush/credential-manager:v1.0in terminal, this will pull docker image of this application in your machine. - To run the service, you first need to setup 'permit' service, as it depends on it, this service is opensource.
docker run -it -p 7766:7000
--env PDP_API_KEY=your_permit.io_secret_id_here
--env PDP_DEBUG=True
permitio/pdp-v2:latest- Once the this container is up and running, run the main service by following:
# run this command with respective environment variables
docker run -it -p 3005:3005
-e PORT=3005
-e BCRYPT_SECRET_KEY=some-integer-set-here
-e JWT_SECRET_KEY=set-secret-key-here
-e BCRYPT_SALT_ROUNDS=some-integer-here
-e MONGO_URL=your_mongo_url_here
-e GOOGLE_CLIENT_ID=your_google_client_id_here
-e GOOGLE_CLIENT_SECRET=your_google_client_secret
-e SESSION_SECRET=passport_secret-here
-e PERMIT_API_KEY=your_permit.io_secret_id_here
-e CLOUDINARY_CLOUD_NAME=your_cloudinary_cloud_name_here
-e CLOUDINARY_API_KEY=your_cloudinary_api_key
-e CLOUDINARY_API_SECRET=your_cloudinary_api_secret
-e COOKIE_SECRET=some-secret-here
-e NODEMAILER_EMAIL_USER=your_gmail_to_contact_users_with
-e NODEMAILER_EMAIL_PASS=app_password_for_above_mentioned_gmail
meayush/credential-manager:v1.0Note : For this setup you need docker installed and set up.
- Ensure you have git-local branch forked and cloned, copy from
.env.exampleand paste in newly created.envwith right values and remove.envfrom.dockerignorefile. - Checkout on git-local branch by running
git checkout git-local. - Run following commands:
docker build -t <local-image-name>:tag_optional . # this will create you image locally on your machine
docker compose up -d # this will run permit service (in background)
# now run the newly created image like B.4 (above mentioned), just change the image name from 'meayush/credential-manager:v1.0' to '<local-image-name>:tag_optional - Now your containers should be up and running.
To provide encryption along with the facility to share with others while maintaining your privacy and security, combination of Symmetric key distribution and Proxy re-encryption is used.
Flow of implementation :
On client-side:
- A pair of crypto keys i.e.
public-keyandprivate-keyis generated on signup only, and stored on indexDB of browser (client-side), onlypublic-keyis sent to server which CANNOT be used for decryption. - Whenever a credential is created a
symmetric-keyis generated for that particular credential and credential-value is encrypted, now thesymmetric-keyis encrypted withpublic-keyof user. - Now both
encrypted-symmetric-keyandencrypted-credential-valueis sent to server for processing and storing.
Note : In the entire process
private-keyhas NEVER been sent to server.
-
When user (owner) requests for credentials, all the
encrypted-credentialsalong with respectiveencrypted-symmetric-keysare fetched from database, thenencrypted-symmetric-keyis deciphered on client-side using user'sprivate-key, thissymmetric-keyis further used to decipherencrypted-credential-value.

-
When user 'Share' any particular credential,
encrypted-symmetric-keyof that credential along withpublic-keyof member (whom is shared with) is fetched from database. -
This
encrypted-symmetric-keyis deciphered with user'sprivate-keyand thensymmetric-keyobtained is now encrypted using member'spublic-keyand stored on database. -
When user requests for 'credentials shared with me', all the associated
encrypted-symmetric-keysthat were stored in point (6) are fetched, then deciphered using their ownprivate-key.
In this whole process
private-keyused for deciphering is NEVER shared with other(s) or ever reaches server. Admin or anyone can not view actual value of credentials as long as they do not have access to your crypto-keys.
Note : Permit.io integration is only available on docker image.


