├── .gitignore
├── icon
├── MasterPasswordJS_256.png
└── MasterPasswordJS_512.png
├── fonts
├── glyphicons-halflings-regular.eot
├── glyphicons-halflings-regular.ttf
├── glyphicons-halflings-regular.woff
└── glyphicons-halflings-regular.woff2
├── js
├── npm.js
└── bootstrap.min.js
├── manifest.json
├── bootstrap-touchspin
├── jquery.bootstrap-touchspin.min.css
├── jquery.bootstrap-touchspin.css
├── jquery.bootstrap-touchspin.min.js
└── jquery.bootstrap-touchspin.js
├── crunch.js
├── sw.js
├── css
├── bootstrap-theme.min.css.map
├── bootstrap-theme.min.css
└── bootstrap-theme.css
├── sha256.js
├── README.md
├── index.html
├── masterpassword.js
└── LICENSE
/.gitignore:
--------------------------------------------------------------------------------
1 | nbproject
--------------------------------------------------------------------------------
/icon/MasterPasswordJS_256.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ns130291/MasterPasswordJS/master/icon/MasterPasswordJS_256.png
--------------------------------------------------------------------------------
/icon/MasterPasswordJS_512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ns130291/MasterPasswordJS/master/icon/MasterPasswordJS_512.png
--------------------------------------------------------------------------------
/fonts/glyphicons-halflings-regular.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ns130291/MasterPasswordJS/master/fonts/glyphicons-halflings-regular.eot
--------------------------------------------------------------------------------
/fonts/glyphicons-halflings-regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ns130291/MasterPasswordJS/master/fonts/glyphicons-halflings-regular.ttf
--------------------------------------------------------------------------------
/fonts/glyphicons-halflings-regular.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ns130291/MasterPasswordJS/master/fonts/glyphicons-halflings-regular.woff
--------------------------------------------------------------------------------
/fonts/glyphicons-halflings-regular.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ns130291/MasterPasswordJS/master/fonts/glyphicons-halflings-regular.woff2
--------------------------------------------------------------------------------
/js/npm.js:
--------------------------------------------------------------------------------
1 | // This file is autogenerated via the `commonjs` Grunt task. You can require() this file in a CommonJS environment.
2 | require('../../js/transition.js')
3 | require('../../js/alert.js')
4 | require('../../js/button.js')
5 | require('../../js/carousel.js')
6 | require('../../js/collapse.js')
7 | require('../../js/dropdown.js')
8 | require('../../js/modal.js')
9 | require('../../js/tooltip.js')
10 | require('../../js/popover.js')
11 | require('../../js/scrollspy.js')
12 | require('../../js/tab.js')
13 | require('../../js/affix.js')
--------------------------------------------------------------------------------
/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "Masterpassword",
3 | "name": "MasterPasswordJS",
4 | "description": "Masterpassword algorithm implemented in JavaScript",
5 | "display": "standalone",
6 | "icons": [
7 | {
8 | "src": "icon/MasterPasswordJS_256.png",
9 | "type": "image/png",
10 | "sizes": "256x256"
11 | },
12 | {
13 | "src": "icon/MasterPasswordJS_512.png",
14 | "type": "image/png",
15 | "sizes": "512x512"
16 | }
17 | ],
18 | "start_url": ".",
19 | "theme_color": "#7e7e7e",
20 | "background_color": "white"
21 | }
22 |
--------------------------------------------------------------------------------
/bootstrap-touchspin/jquery.bootstrap-touchspin.min.css:
--------------------------------------------------------------------------------
1 | /*
2 | * Bootstrap TouchSpin - v3.1.1
3 | * A mobile and touch friendly input spinner component for Bootstrap 3.
4 | * http://www.virtuosoft.eu/code/bootstrap-touchspin/
5 | *
6 | * Made by István Ujj-Mészáros
7 | * Under Apache License v2.0 License
8 | */
9 |
10 | .bootstrap-touchspin .input-group-btn-vertical{position:relative;white-space:nowrap;width:1%;vertical-align:middle;display:table-cell}.bootstrap-touchspin .input-group-btn-vertical>.btn{display:block;float:none;width:100%;max-width:100%;padding:8px 10px;margin-left:-1px;position:relative}.bootstrap-touchspin .input-group-btn-vertical .bootstrap-touchspin-up{border-radius:0;border-top-right-radius:4px}.bootstrap-touchspin .input-group-btn-vertical .bootstrap-touchspin-down{margin-top:-2px;border-radius:0;border-bottom-right-radius:4px}.bootstrap-touchspin .input-group-btn-vertical i{position:absolute;top:3px;left:5px;font-size:9px;font-weight:400}
--------------------------------------------------------------------------------
/bootstrap-touchspin/jquery.bootstrap-touchspin.css:
--------------------------------------------------------------------------------
1 | /*
2 | * Bootstrap TouchSpin - v3.1.1
3 | * A mobile and touch friendly input spinner component for Bootstrap 3.
4 | * http://www.virtuosoft.eu/code/bootstrap-touchspin/
5 | *
6 | * Made by István Ujj-Mészáros
7 | * Under Apache License v2.0 License
8 | */
9 |
10 | .bootstrap-touchspin .input-group-btn-vertical {
11 | position: relative;
12 | white-space: nowrap;
13 | width: 1%;
14 | vertical-align: middle;
15 | display: table-cell;
16 | }
17 |
18 | .bootstrap-touchspin .input-group-btn-vertical > .btn {
19 | display: block;
20 | float: none;
21 | width: 100%;
22 | max-width: 100%;
23 | padding: 8px 10px;
24 | margin-left: -1px;
25 | position: relative;
26 | }
27 |
28 | .bootstrap-touchspin .input-group-btn-vertical .bootstrap-touchspin-up {
29 | border-radius: 0;
30 | border-top-right-radius: 4px;
31 | }
32 |
33 | .bootstrap-touchspin .input-group-btn-vertical .bootstrap-touchspin-down {
34 | margin-top: -2px;
35 | border-radius: 0;
36 | border-bottom-right-radius: 4px;
37 | }
38 |
39 | .bootstrap-touchspin .input-group-btn-vertical i {
40 | position: absolute;
41 | top: 3px;
42 | left: 5px;
43 | font-size: 9px;
44 | font-weight: normal;
45 | }
46 |
--------------------------------------------------------------------------------
/crunch.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2014,2016,2017 ns130291
3 | *
4 | * This file is part of MasterPasswordJS.
5 | *
6 | * MasterPasswordJS is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU General Public License as published by
8 | * the Free Software Foundation, either version 3 of the License, or
9 | * (at your option) any later version.
10 | *
11 | * MasterPasswordJS is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU General Public License
17 | * along with MasterPasswordJS. If not, see .
18 | *
19 | */
20 |
21 | "use strict";
22 |
23 | importScripts("scrypt.js");
24 |
25 | function intToByteArray(intA) {
26 | let arr = new Uint8Array(4);
27 | for (let i = 3; i >= 0; i--) {
28 | arr[i] = intA % 16;
29 | intA = intA / 16;
30 | }
31 | return arr;
32 | }
33 |
34 | function Uint8ArrayConcat(array1, array2) {
35 | let array = new Uint8Array(array1.byteLength + array2.byteLength);
36 | array.set(new Uint8Array(array1), 0);
37 | array.set(new Uint8Array(array2), array1.byteLength);
38 | return array;
39 | }
40 |
41 | function stringLength(str) {
42 | let length = 0;
43 | for (let i = 0; i < str.length; i++) {
44 | length++;
45 | if (str.charCodeAt(i) > 127) {
46 | length++;
47 | if (str.charCodeAt(i) > 2047) {
48 | length++;
49 | }
50 | }
51 | }
52 | return length;
53 | }
54 |
55 | self.onmessage = function(e) {
56 | let scrypt = scrypt_module_factory(Math.pow(2, 26));
57 |
58 | let masterName = e.data.name;
59 | let masterPW = scrypt.encode_utf8(e.data.pw);
60 |
61 | let N = 32768;
62 | let r = 8;
63 | let p = 2;
64 | let l = 64;
65 |
66 | let masterSalt1 = scrypt.encode_utf8("com.lyndir.masterpassword");
67 | let masterSalt2 = intToByteArray(masterName.length);
68 | let masterSalt3 = scrypt.encode_utf8(masterName);
69 | let masterSalt = Uint8ArrayConcat(Uint8ArrayConcat(masterSalt1, masterSalt2), masterSalt3);
70 |
71 | let masterKey = scrypt.crypto_scrypt(masterPW, masterSalt, N, r, p, l);
72 | masterKey = scrypt.to_hex(masterKey);
73 |
74 | let masterSalt2v3 = intToByteArray(stringLength(masterName));
75 | let masterSaltv3 = Uint8ArrayConcat(Uint8ArrayConcat(masterSalt1, masterSalt2v3), masterSalt3);
76 |
77 | let masterKeyv3 = scrypt.crypto_scrypt(masterPW, masterSaltv3, N, r, p, l);
78 | masterKeyv3 = scrypt.to_hex(masterKeyv3);
79 |
80 | let keys = {};
81 | keys.key = masterKey;
82 | keys.key_v3 = masterKeyv3;
83 |
84 | self.postMessage(keys);
85 | };
86 |
87 |
88 |
--------------------------------------------------------------------------------
/sw.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2014-2023 ns130291
3 | *
4 | * This file is part of MasterPasswordJS.
5 | *
6 | * MasterPasswordJS is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU General Public License as published by
8 | * the Free Software Foundation, either version 3 of the License, or
9 | * (at your option) any later version.
10 | *
11 | * MasterPasswordJS is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU General Public License
17 | * along with MasterPasswordJS. If not, see .
18 | *
19 | */
20 |
21 | "use strict";
22 |
23 | var CACHE_NAME = 'masterpassword-cache-v10';
24 | var urlsToCache = [
25 | '/MasterPasswordJS/',
26 | 'index.html',
27 | 'masterpassword.js',
28 | 'css/bootstrap.min.css',
29 | 'css/bootstrap-theme.min.css',
30 | 'bootstrap-touchspin/jquery.bootstrap-touchspin.min.css',
31 | 'https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js',
32 | 'js/bootstrap.min.js',
33 | 'bootstrap-touchspin/jquery.bootstrap-touchspin.min.js',
34 | 'crunch.js',
35 | 'scrypt.js',
36 | 'sha256.js',
37 | ];
38 |
39 | // TODO cache font files: https://googlechrome.github.io/samples/service-worker/selective-caching/service-worker.js
40 | // or do it automatically - see below
41 |
42 | self.addEventListener('install', function (event) {
43 | // Immediate installation of new service worker
44 | self.skipWaiting();
45 | // Perform install steps
46 | event.waitUntil(
47 | caches.open(CACHE_NAME)
48 | .then(function (cache) {
49 | console.log('Opened cache ' + CACHE_NAME);
50 | return cache.addAll(urlsToCache);
51 | })
52 | );
53 | });
54 |
55 | self.addEventListener('activate', function(event) {
56 | event.waitUntil(
57 | caches.keys().then(function(cacheNames) {
58 | return Promise.all(
59 | cacheNames.filter(function(cacheName) {
60 | // remove old caches
61 | return CACHE_NAME !== cacheName;
62 | }).map(function (cacheName) {
63 | console.log('Deleting cache ' + cacheName);
64 | return caches.delete(cacheName);
65 | })
66 | );
67 | })
68 | );
69 | });
70 |
71 | self.addEventListener('fetch', function (event) {
72 | event.respondWith(
73 | caches.match(event.request)
74 | .then(function (response) {
75 | // Cache hit - return response
76 | if (response) {
77 | return response;
78 | }
79 |
80 | // IMPORTANT: Clone the request. A request is a stream and
81 | // can only be consumed once. Since we are consuming this
82 | // once by cache and once by the browser for fetch, we need
83 | // to clone the response.
84 | var fetchRequest = event.request.clone();
85 |
86 | return fetch(fetchRequest).then(
87 | function (response) {
88 | // Check if we received a valid response
89 | if (!response || response.status !== 200 || response.type !== 'basic') {
90 | return response;
91 | }
92 |
93 | // IMPORTANT: Clone the response. A response is a stream
94 | // and because we want the browser to consume the response
95 | // as well as the cache consuming the response, we need
96 | // to clone it so we have two streams.
97 | var responseToCache = response.clone();
98 |
99 | caches.open(CACHE_NAME)
100 | .then(function (cache) {
101 | cache.put(event.request, responseToCache);
102 | });
103 |
104 | return response;
105 | }
106 | );
107 | })
108 | );
109 | });
110 |
111 |
112 |
113 |
114 |
--------------------------------------------------------------------------------
/css/bootstrap-theme.min.css.map:
--------------------------------------------------------------------------------
1 | {"version":3,"sources":["less/theme.less","less/mixins/vendor-prefixes.less","less/mixins/gradients.less","less/mixins/reset-filter.less"],"names":[],"mappings":";;;;AAmBA,YAAA,aAAA,UAAA,aAAA,aAAA,aAME,YAAA,EAAA,KAAA,EAAA,eC2CA,mBAAA,MAAA,EAAA,IAAA,EAAA,sBAAA,EAAA,IAAA,IAAA,iBACQ,WAAA,MAAA,EAAA,IAAA,EAAA,sBAAA,EAAA,IAAA,IAAA,iBDvCR,mBAAA,mBAAA,oBAAA,oBAAA,iBAAA,iBAAA,oBAAA,oBAAA,oBAAA,oBAAA,oBAAA,oBCsCA,mBAAA,MAAA,EAAA,I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Q,WAAA,EAAA,IAAA,IAAA,iBDgLV,wBAAA,8BAAA,8BAGE,YAAA,EAAA,KAAA,EAAA,QEnOE,iBAAA,oDACA,iBAAA,+CACA,iBAAA,wEAAA,iBAAA,kDACA,OAAA,+GACA,kBAAA,SFiOF,aAAA,QALF,+BAAA,qCAAA,qCAQI,YAAA,KAUJ,OCnME,mBAAA,EAAA,IAAA,IAAA,gBACQ,WAAA,EAAA,IAAA,IAAA,gBD4MV,8BE5PI,iBAAA,oDACA,iBAAA,+CACA,iBAAA,wEAAA,iBAAA,kDACA,OAAA,+GACA,kBAAA,SFyPJ,8BE7PI,iBAAA,oDACA,iBAAA,+CACA,iBAAA,wEAAA,iBAAA,kDACA,OAAA,+GACA,kBAAA,SF0PJ,8BE9PI,iBAAA,oDACA,iBAAA,+CACA,iBAAA,wEAAA,iBAAA,kDACA,OAAA,+GACA,kBAAA,SF2PJ,2BE/PI,iBAAA,oDACA,iBAAA,+CACA,iBAAA,wEAAA,iBAAA,kDACA,OAAA,+GACA,kBAAA,SF4PJ,8BEhQI,iBAAA,oDACA,iBAAA,+CACA,iBAAA,wEAAA,iBAAA,kDACA,OAAA,+GACA,kBAAA,SF6PJ,6BEjQI,iBAAA,oDACA,iBAAA,+CACA,iBAAA,wEAAA,iBAAA,kDACA,OAAA,+GACA,kBAAA,SFoQJ,MExQI,iBAAA,oDACA,iBAAA,+CACA,iBAAA,wEAAA,iBAAA,kDACA,OAAA,+GACA,kBAAA,SFsQF,aAAA,QC3NA,mBAAA,MAAA,EAAA,IAAA,IAAA,gBAAA,EAAA,IAAA,EAAA,qBACQ,WAAA,MAAA,EAAA,IAAA,IAAA,gBAAA,EAAA,IAAA,EAAA"}
--------------------------------------------------------------------------------
/sha256.js:
--------------------------------------------------------------------------------
1 | /*
2 | A JavaScript implementation of the SHA family of hashes, as
3 | defined in FIPS PUB 180-2 as well as the corresponding HMAC implementation
4 | as defined in FIPS PUB 198a
5 |
6 | Copyright Brian Turek 2008-2013
7 | Distributed under the BSD License
8 | See http://caligatio.github.com/jsSHA/ for more information
9 |
10 | Several functions taken from Paul Johnston
11 | */
12 | (function(B){function r(a,c,b){var f=0,e=[0],g="",h=null,g=b||"UTF8";if("UTF8"!==g&&"UTF16"!==g)throw"encoding must be UTF8 or UTF16";if("HEX"===c){if(0!==a.length%2)throw"srcString of HEX type must be in byte increments";h=u(a);f=h.binLen;e=h.value}else if("ASCII"===c||"TEXT"===c)h=v(a,g),f=h.binLen,e=h.value;else if("B64"===c)h=w(a),f=h.binLen,e=h.value;else throw"inputFormat must be HEX, TEXT, ASCII, or B64";this.getHash=function(a,c,b,g){var h=null,d=e.slice(),l=f,m;3===arguments.length?"number"!==
13 | typeof b&&(g=b,b=1):2===arguments.length&&(b=1);if(b!==parseInt(b,10)||1>b)throw"numRounds must a integer >= 1";switch(c){case "HEX":h=x;break;case "B64":h=y;break;default:throw"format must be HEX or B64";}if("SHA-224"===a)for(m=0;mm/8&&(d[b]&=4294967040);for(l=0;l<=b;l+=1)A[l]=d[l]^909522486,s[l]=d[l]^1549556828;c=q(s.concat(q(A.concat(e),a+f,c)),a+n,c);return h(c,
15 | z(k))}}function v(a,c){var b=[],f,e=[],g=0,h;if("UTF8"===c)for(h=0;h>>12,e[1]=128|(f&4032)>>>6,e[2]=128|f&63):128>>6,e[1]=128|f&63):e[0]=f,f=0;f>>2]|=e[f]<<24-g%4*8,g+=1;else if("UTF16"===c)for(h=0;h>>2]|=a.charCodeAt(h)<<16-g%4*8,g+=2;return{value:b,binLen:8*g}}function u(a){var c=[],b=a.length,f,e;if(0!==b%2)throw"String of HEX type must be in byte increments";for(f=0;f<
16 | b;f+=2){e=parseInt(a.substr(f,2),16);if(isNaN(e))throw"String of HEX type contains invalid characters";c[f>>>3]|=e<<24-f%8*4}return{value:c,binLen:4*b}}function w(a){var c=[],b=0,f,e,g,h,k;if(-1===a.search(/^[a-zA-Z0-9=+\/]+$/))throw"Invalid character in base-64 string";f=a.indexOf("=");a=a.replace(/\=/g,"");if(-1!==f&&f>2]|=(h>>>16-8*g&255)<<24-b%4*8,b+=1}return{value:c,binLen:8*b}}function x(a,c){var b="",f=4*a.length,e,g;for(e=0;e>>2]>>>8*(3-e%4),b+="0123456789abcdef".charAt(g>>>4&15)+"0123456789abcdef".charAt(g&15);return c.outputUpper?b.toUpperCase():b}function y(a,c){var b="",f=4*a.length,e,g,h;for(e=0;e>>2]>>>8*(3-e%4)&255)<<16|(a[e+1>>>2]>>>8*(3-(e+1)%4)&255)<<8|a[e+2>>>2]>>>8*(3-(e+2)%4)&255,g=0;4>g;g+=1)b=8*e+6*g<=32*a.length?b+
18 | "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(h>>>6*(3-g)&63):b+c.b64Pad;return b}function z(a){var c={outputUpper:!1,b64Pad:"="};try{a.hasOwnProperty("outputUpper")&&(c.outputUpper=a.outputUpper),a.hasOwnProperty("b64Pad")&&(c.b64Pad=a.b64Pad)}catch(b){}if("boolean"!==typeof c.outputUpper)throw"Invalid outputUpper formatting option";if("string"!==typeof c.b64Pad)throw"Invalid b64Pad formatting option";return c}function k(a,c){return a>>>c|a<<32-c}function I(a,c,b){return a&
19 | c^~a&b}function J(a,c,b){return a&c^a&b^c&b}function K(a){return k(a,2)^k(a,13)^k(a,22)}function L(a){return k(a,6)^k(a,11)^k(a,25)}function M(a){return k(a,7)^k(a,18)^a>>>3}function N(a){return k(a,17)^k(a,19)^a>>>10}function O(a,c){var b=(a&65535)+(c&65535);return((a>>>16)+(c>>>16)+(b>>>16)&65535)<<16|b&65535}function P(a,c,b,f){var e=(a&65535)+(c&65535)+(b&65535)+(f&65535);return((a>>>16)+(c>>>16)+(b>>>16)+(f>>>16)+(e>>>16)&65535)<<16|e&65535}function Q(a,c,b,f,e){var g=(a&65535)+(c&65535)+(b&
20 | 65535)+(f&65535)+(e&65535);return((a>>>16)+(c>>>16)+(b>>>16)+(f>>>16)+(e>>>16)+(g>>>16)&65535)<<16|g&65535}function q(a,c,b){var f,e,g,h,k,q,r,C,u,d,l,m,n,A,s,p,v,w,x,y,z,D,E,F,G,t=[],H,B=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,
21 | 3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];d=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428];f=[1779033703,3144134277,1013904242,
22 | 2773480762,1359893119,2600822924,528734635,1541459225];if("SHA-224"===b||"SHA-256"===b)l=64,A=16,s=1,G=Number,p=O,v=P,w=Q,x=M,y=N,z=K,D=L,F=J,E=I,d="SHA-224"===b?d:f;else throw"Unexpected error in SHA-2 implementation";a[c>>>5]|=128<<24-c%32;a[(c+65>>>9<<4)+15]=c;H=a.length;for(m=0;mn?new G(a[n*s+m],a[n*s+m+1]):v(y(t[n-2]),t[n-7],x(t[n-15]),t[n-16]),C=w(r,D(h),E(h,k,q),B[n],t[n]),u=p(z(c),F(c,f,e)),r=q,q=k,k=
23 | h,h=p(g,C),g=e,e=f,f=c,c=p(C,u);d[0]=p(c,d[0]);d[1]=p(f,d[1]);d[2]=p(e,d[2]);d[3]=p(g,d[3]);d[4]=p(h,d[4]);d[5]=p(k,d[5]);d[6]=p(q,d[6]);d[7]=p(r,d[7])}if("SHA-224"===b)a=[d[0],d[1],d[2],d[3],d[4],d[5],d[6]];else if("SHA-256"===b)a=d;else throw"Unexpected error in SHA-2 implementation";return a}"function"===typeof define&&typeof define.amd?define(function(){return r}):"undefined"!==typeof exports?"undefined"!==typeof module&&module.exports?module.exports=exports=r:exports=r:B.jsSHA=r})(this);
24 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # MasterPasswordJS
2 | https://masterpasswordapp.com implementation in JavaScript.
3 |
4 | Try it [here](https://ns130291.github.io/MasterPasswordJS/).
5 |
6 | Currently supports the v1, v2 and v3 algorithm for Unicode characters from `0x0000 - 0xFFFF`.
7 |
8 | ## License
9 | ```
10 | Copyright (C) 2014,2016,2017 ns130291
11 |
12 | MasterPasswordJS is free software: you can redistribute it and/or modify
13 | it under the terms of the GNU General Public License as published by
14 | the Free Software Foundation, either version 3 of the License, or
15 | (at your option) any later version.
16 |
17 | MasterPasswordJS is distributed in the hope that it will be useful,
18 | but WITHOUT ANY WARRANTY; without even the implied warranty of
19 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 | GNU General Public License for more details.
21 |
22 | You should have received a copy of the GNU General Public License
23 | along with MasterPasswordJS. If not, see .
24 | ```
25 |
26 | License for [jsSHA](https://github.com/Caligatio/jsSHA) (sha256.js)
27 | ```
28 | Copyright (c) 2008-2013, Brian Turek
29 | All rights reserved.
30 |
31 | Redistribution and use in source and binary forms, with or without
32 | modification, are permitted provided that the following conditions are met:
33 |
34 | * Redistributions of source code must retain the above copyright notice, this
35 | list of conditions and the following disclaimer.
36 | * Redistributions in binary form must reproduce the above copyright notice,
37 | this list of conditions and the following disclaimer in the documentation
38 | and/or other materials provided with the distribution.
39 | * The names of the contributors may not be used to endorse or promote products
40 | derived from this software without specific prior written permission.
41 |
42 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
43 | ANDANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
44 | IMPLIEDWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
45 | DISCLAIMED.IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
46 | ANY DIRECT,INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
47 | (INCLUDING,BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
48 | LOSS OF USE,DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
49 | ANY THEORY OFLIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
50 | (INCLUDING NEGLIGENCEOR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
51 | SOFTWARE, EVEN IF ADVISEDOF THE POSSIBILITY OF SUCH DAMAGE.
52 | ```
53 |
54 | [js-scrypt](https://github.com/tonyg/js-scrypt) is written by Tony Garnock-Jones
55 | and is licensed under the [2-clause BSD license](http://opensource.org/licenses/BSD-2-Clause):
56 | ```
57 | Copyright (c) 2013, Tony Garnock-Jones
58 | All rights reserved.
59 |
60 | Redistribution and use in source and binary forms, with or without
61 | modification, are permitted provided that the following conditions
62 | are met:
63 |
64 | 1. Redistributions of source code must retain the above copyright
65 | notice, this list of conditions and the following disclaimer.
66 |
67 | 2. Redistributions in binary form must reproduce the above copyright
68 | notice, this list of conditions and the following disclaimer in
69 | the documentation and/or other materials provided with the
70 | distribution.
71 |
72 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
73 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
74 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
75 | FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
76 | COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
77 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
78 | BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
79 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
80 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
81 | LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
82 | ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
83 | POSSIBILITY OF SUCH DAMAGE.
84 | ```
85 |
86 | js-scrypt relies on `scrypt` itself, which is written by Colin
87 | Percival and licensed as follows:
88 | ```
89 | Copyright 2009 Colin Percival
90 | All rights reserved.
91 |
92 | Redistribution and use in source and binary forms, with or without
93 | modification, are permitted provided that the following conditions
94 | are met:
95 |
96 | 1. Redistributions of source code must retain the above copyright
97 | notice, this list of conditions and the following disclaimer.
98 | 2. Redistributions in binary form must reproduce the above copyright
99 | notice, this list of conditions and the following disclaimer in the
100 | documentation and/or other materials provided with the distribution.
101 |
102 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
103 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
104 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
105 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
106 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
107 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
108 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
109 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
110 | LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
111 | OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
112 | SUCH DAMAGE.
113 | ```
114 |
115 | License for [Bootstrap](http://getbootstrap.com/)
116 | ```
117 | The MIT License (MIT)
118 |
119 | Copyright (c) 2011-2016 Twitter, Inc.
120 |
121 | Permission is hereby granted, free of charge, to any person obtaining a copy
122 | of this software and associated documentation files (the "Software"), to deal
123 | in the Software without restriction, including without limitation the rights
124 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
125 | copies of the Software, and to permit persons to whom the Software is
126 | furnished to do so, subject to the following conditions:
127 |
128 | The above copyright notice and this permission notice shall be included in
129 | all copies or substantial portions of the Software.
130 |
131 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
132 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
133 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
134 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
135 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
136 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
137 | THE SOFTWARE.
138 | ```
139 |
140 | Bootstrap TouchSpin
141 | v3.1.1
142 |
143 | A mobile and touch friendly input spinner component for Bootstrap 3.
144 |
145 | https://github.com/istvan-ujjmeszaros/bootstrap-touchspin
146 | http://www.virtuosoft.eu/code/bootstrap-touchspin/
147 |
148 | ```
149 | Copyright 2013-2015 István Ujj-Mészáros
150 |
151 | Licensed under the Apache License, Version 2.0 (the "License");
152 | you may not use this file except in compliance with the License.
153 | You may obtain a copy of the License at
154 |
155 | http://www.apache.org/licenses/LICENSE-2.0
156 |
157 | Unless required by applicable law or agreed to in writing, software
158 | distributed under the License is distributed on an "AS IS" BASIS,
159 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
160 | See the License for the specific language governing permissions and
161 | limitations under the License.
162 | ```
163 |
164 |
165 |
--------------------------------------------------------------------------------
/bootstrap-touchspin/jquery.bootstrap-touchspin.min.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Bootstrap TouchSpin - v3.1.1
3 | * A mobile and touch friendly input spinner component for Bootstrap 3.
4 | * http://www.virtuosoft.eu/code/bootstrap-touchspin/
5 | *
6 | * Made by István Ujj-Mészáros
7 | * Under Apache License v2.0 License
8 | */
9 | !function(a){"use strict";function b(a,b){return a+".touchspin_"+b}function c(c,d){return a.map(c,function(a){return b(a,d)})}var d=0;a.fn.TouchSpin=function(b){if("destroy"===b)return void this.each(function(){var b=a(this),d=b.data();a(document).off(c(["mouseup","touchend","touchcancel","mousemove","touchmove","scroll","scrollstart"],d.spinnerid).join(" "))});var e={min:0,max:100,initval:"",replacementval:"",step:1,decimals:0,stepinterval:100,forcestepdivisibility:"round",stepintervaldelay:500,verticalbuttons:!1,verticalupclass:"glyphicon glyphicon-chevron-up",verticaldownclass:"glyphicon glyphicon-chevron-down",prefix:"",postfix:"",prefix_extraclass:"",postfix_extraclass:"",booster:!0,boostat:10,maxboostedstep:!1,mousewheel:!0,buttondown_class:"btn btn-default",buttonup_class:"btn btn-default",buttondown_txt:"-",buttonup_txt:"+"},f={min:"min",max:"max",initval:"init-val",replacementval:"replacement-val",step:"step",decimals:"decimals",stepinterval:"step-interval",verticalbuttons:"vertical-buttons",verticalupclass:"vertical-up-class",verticaldownclass:"vertical-down-class",forcestepdivisibility:"force-step-divisibility",stepintervaldelay:"step-interval-delay",prefix:"prefix",postfix:"postfix",prefix_extraclass:"prefix-extra-class",postfix_extraclass:"postfix-extra-class",booster:"booster",boostat:"boostat",maxboostedstep:"max-boosted-step",mousewheel:"mouse-wheel",buttondown_class:"button-down-class",buttonup_class:"button-up-class",buttondown_txt:"button-down-txt",buttonup_txt:"button-up-txt"};return this.each(function(){function g(){if(!J.data("alreadyinitialized")){if(J.data("alreadyinitialized",!0),d+=1,J.data("spinnerid",d),!J.is("input"))return void console.log("Must be an input.");j(),h(),u(),m(),p(),q(),r(),s(),D.input.css("display","block")}}function h(){""!==B.initval&&""===J.val()&&J.val(B.initval)}function i(a){l(a),u();var b=D.input.val();""!==b&&(b=Number(D.input.val()),D.input.val(b.toFixed(B.decimals)))}function j(){B=a.extend({},e,K,k(),b)}function k(){var b={};return a.each(f,function(a,c){var d="bts-"+c;J.is("[data-"+d+"]")&&(b[a]=J.data(d))}),b}function l(b){B=a.extend({},B,b)}function m(){var a=J.val(),b=J.parent();""!==a&&(a=Number(a).toFixed(B.decimals)),J.data("initvalue",a).val(a),J.addClass("form-control"),b.hasClass("input-group")?n(b):o()}function n(b){b.addClass("bootstrap-touchspin");var c,d,e=J.prev(),f=J.next(),g=''+B.prefix+"",h=''+B.postfix+"";e.hasClass("input-group-btn")?(c='",e.append(c)):(c='",a(c).insertBefore(J)),f.hasClass("input-group-btn")?(d='",f.prepend(d)):(d='",a(d).insertAfter(J)),a(g).insertBefore(J),a(h).insertAfter(J),C=b}function o(){var b;b=B.verticalbuttons?'