From 9a70f88a3eb2ec5b7143ada056ace745875e0909 Mon Sep 17 00:00:00 2001 From: Erik van `t Wout Date: Fri, 4 Oct 2019 05:52:54 +0200 Subject: [PATCH] Initial commit --- ewpass.js | 207 ++++++++++++++++++++++++++++++++++++++++++++ index.html | 72 +++++++++++++++ jquery-3.4.1.min.js | 2 + sha256.js | 4 + 4 files changed, 285 insertions(+) create mode 100644 ewpass.js create mode 100644 index.html create mode 100644 jquery-3.4.1.min.js create mode 100644 sha256.js diff --git a/ewpass.js b/ewpass.js new file mode 100644 index 0000000..16b1b70 --- /dev/null +++ b/ewpass.js @@ -0,0 +1,207 @@ +var ewpass = {}; + +(function(ns) { + const SEED_PREFIX = 'E. W. Password Generator Seed/'; + const DERIVE_PREFIX = 'Domain Password/'; + const Storage = window.localStorage; + + const BASIC_MAP = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'; + const EXTENDED_MAP = BASIC_MAP + '`~!@#$%^&*()-_=+[{]}\\|;:\'",<.>/?'; + + var settings = { + 'checksum': undefined, + 'DEFAULT': [ 16, 1, true ], + 'domains': {} + }; + var currentDomain = undefined; + var seedValid = false; + + var checkSeedChecksum = () => { + const valid = $('#checksum').text() === settings.checksum; + + $('#chkok').html(valid ? '✓' : '✗'); + $('#chkset').prop('disabled', valid ? 'disabled' : ''); + + seedValid = valid; + }; + + var setDomains = () => { + $domainlist = $("#domainlist") + + $domainlist.html(''); + for (domain in settings.domains) { + $domainlist.append($('