sbh

package module
v0.0.0-...-9c625ec Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 26, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

README

SecurityBaeHash

Why

Passwords are the most vital part of everyday life. Any individual can have numerous accounts across various applications, and each of those accounts has an associated password. Unfortunately as the number of accounts/passwords grows, people tend to re-use passwords. There are existing solutions in the form of password managers, like keypassxc or lastpass, but even those require an account/password. The issue that I have with password managers is if the master key is compromised, then the attackers have the keys to the kingdom.

SecurityBaeHash (SBH) is a stateless password manager, meaning it doesnt retain any information. It doesnt require an account, doesnt store any passwords, and it never will. A password only exists when its retrieved, and the same password can only be retrieved with the exact same inputs. No keys and no kingdom.


How it Works

SBH is a combination of two things: caesar cipher and a hash function. It takes three inputs: plaintext, a number of rotations, and a seed. SBH then generates a hash based on the result of applying X psuedo-randomly generated rotations (0 < n < 9223372036854775807) to the plaintext, where X is the specified number of rotations. The resulting hash is then used as the password.


Examples

See the examples directory.


Todo

  • Add different hashing algorithm options
  • Add ability to add symbols and/or capitalize letters
  • Add different cipher options
  • Change letter capitalization
  • Fix symbols bug with BASH and CLI implementation
  • Change where symbols are appended based on seed

Documentation

Index

Constants

View Source
const (
	LETTERS = "abcdefghijklmnopqrstuvwxyz"
	DIGITS  = "0123456789"
	SYMBOLS = "!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~"
)

LETTERS, DIGITS, and SYMBOLS are the string representations of all possible letters, digits, and symbols (minus some symbols).

Variables

This section is empty.

Functions

func Generate

func Generate(secbaehash SBH) string

Generate a hash using a caesarCipher with the specified hashing Algorithm. A pseudo-random rot is generated based on given Seed for number of rotations (NRots) specified. If Uppercase is set to true, capitalize the first rune that IsLetter for UppercaseTimes. If Symbols are given, append them to the hash.

Types

type SBH

type SBH struct {
	Plaintext      string
	NRots          int64
	Seed           int64
	Algorithm      string
	Uppercase      bool
	UppercaseTimes int
	Symbols        string
}

SBH is a struct containing all the required parts to create a SBH

Directories

Path Synopsis
examples
cli
web

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL