Giter VIP home page Giter VIP logo

larsniet / paswords Goto Github PK

View Code? Open in Web Editor NEW
4.0 4.0 0.0 3.33 MB

Paswords allows users from all over the world to share passwords in a secure way. Using our one-time-only link feature no-one gets access to your password except the people you choose.

Home Page: https://paswords.link

License: GNU General Public License v3.0

JavaScript 10.03% TypeScript 88.19% CSS 0.28% Shell 1.50%
algorithms firebase hacktoberfest nextjs password-generator typescript

paswords's Introduction

Hi there, I'm Lars van der Niet ๐Ÿ‘‹

Visitors

What I do

  • ๐Ÿ”ญ Working @Adswag.
  • ๐Ÿ‘ฏ Iโ€™m always looking for new businesses that have a great idea but not the technical capabilities to get started (contact me if you are this new business)

Hit me up

๐ŸŒ Lars van der Niet LinkedIn Lars van der Niet Discord Lars van der Niet | Instagram

Languages and Tools

Visual Studio Code

HTML5

CSS3

Sass

JavaScript

React

Gatsby

GraphQL

Node.js

SQL

MySQL

Git

GitHub

Terminal



Holopin badges

@larsniet's Holopin board

paswords's People

Contributors

dependabot[bot] avatar larsniet avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

paswords's Issues

A secret key for encrypting passwords should be secret, even for the server owner

Currently crypto is used to encrypt and decrypt passwords:

const crypto = require("crypto");
const algorithm = "aes-256-cbc";
const secretKey = process.env.SECRET_KEY;
export type CipherType = {
iv: string;
content: string;
};
export const encryptPass = (text: string) => {
const iv = crypto.randomBytes(16);
const cipher = crypto.createCipheriv(algorithm, secretKey, iv);
const encrypted = Buffer.concat([cipher.update(text), cipher.final()]);
const data: CipherType = {
iv: iv.toString("hex"),
content: encrypted.toString("hex"),
};
return data;
};
export const decryptPass = (data: CipherType) => {
const decipher = crypto.createDecipheriv(
algorithm,
secretKey,
Buffer.from(data.iv, "hex")
);
const decrpyted = Buffer.concat([
decipher.update(Buffer.from(data.content, "hex")),
decipher.final(),
]);
return decrpyted.toString();
};

The issue with this is that the secret key is known to the server owner in order to encrypt and decrypt passwords.

Fix internal server error

When the user navigates to /pwd/[pwd]/iv/[iv], and the iv is wrong, a server error occurs. This is because the iv does not match content and when the decryption is ran it returns an error.

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.