GithubHelp home page GithubHelp logo

cypherock / snap-passwordmanager Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ritave/snap-passwordmanager

0.0 0.0 0.0 171 KB

An example Metamask Snap that manages user passwords

Shell 2.27% JavaScript 48.07% HTML 49.66%

snap-passwordmanager's Introduction

Password Manager snap

This is an example Metamask Snap that allows the user to manage their passwords for websites and store them securely in Metamask.

Example.mov

How This Works

This Snap uses the entropy for Garlicoin to encrypt the user's passwords. It requests the following permissions:

"initialPermissions": {
  "snap_confirm": {},
  "snap_manageState": {},
  "snap_getBip44Entropy_69420": {}
},

* 69420 is the chain ID for Garlicoin.

It then uses @MetaMask/browser-passworder to encrypt the full state with the encryption key being the Bip44 entropy derived by MetaMask.

import * as passworder from '@metamask/browser-passworder';

const entropy = await wallet.request({
  method: 'snap_getBip44Entropy_69420',
});

const newState = {
  [website]: { username, password },
};

const encryptedState = {
  passwords: await passworder.encrypt(entropy.key, newState),
};

wallet.request({
  method: 'snap_manageState',
  params: ['update', encryptedState],
});

It also has some extra features like using async-mutex for async-safe state management and fuzzy searching for retrieving specific passwords. Follow the steps below to run this snap locally and see how it works.

Setup

yarn install
yarn build
yarn serve

Testing and Linting

Run yarn test to run the tests once.

Run yarn lint to run the linter, or run yarn lint:fix to run the linter and fix any automatically fixable issues.

snap-passwordmanager's People

Contributors

rekmarks avatar ritave avatar frederikbolding avatar brunocalmels avatar montoya avatar gudahtt avatar github-actions[bot] avatar koonopek avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.