├── skin ├── passhash-overlay.css ├── logo.png ├── marker.png ├── unmask.png ├── marker-clicked.png ├── unmask-clicked.png ├── passhash-options.css ├── passhash-dialog.css ├── passhash-portable.css └── help.css ├── locale ├── it-IT │ ├── faq.html │ ├── about.html │ ├── dialog.html │ ├── changes.html │ ├── options.html │ ├── portable.html │ ├── tutorial.html │ ├── portable-blurb.html │ ├── passhash.properties │ └── passhash.dtd ├── en-US │ ├── portable-blurb.html │ ├── passhash.properties │ ├── portable.html │ ├── tutorial.html │ ├── dialog.html │ ├── about.html │ ├── options.html │ ├── changes.html │ ├── passhash.dtd │ └── faq.html └── de-DE │ ├── portable-blurb.html │ ├── passhash.properties │ ├── portable.html │ ├── tutorial.html │ ├── dialog.html │ ├── about.html │ ├── options.html │ ├── faq.html │ ├── changes.html │ └── passhash.dtd ├── screenshots ├── Passhash1.png ├── Passhash2.png ├── Passhash3.png ├── Passhash4.png └── Passhash5.png ├── README.md ├── chrome.manifest ├── demo └── index.html ├── blurb ├── update.rdf ├── content ├── passhash-overlay.xul ├── passhash-about.xul ├── passhash-sha1.js ├── passhash-portable.js ├── passhash-options.xul ├── passhash-overlay.js ├── passhash-options.js ├── passhash-dialog.xul ├── passhash-portable.html └── passhash-dialog.js ├── install.rdf ├── bin ├── install └── build ├── tools ├── passhash.py └── sha1.py └── license.txt /skin/passhash-overlay.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /skin/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wijjo/passhash/HEAD/skin/logo.png -------------------------------------------------------------------------------- /skin/marker.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wijjo/passhash/HEAD/skin/marker.png -------------------------------------------------------------------------------- /skin/unmask.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wijjo/passhash/HEAD/skin/unmask.png -------------------------------------------------------------------------------- /locale/it-IT/faq.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wijjo/passhash/HEAD/locale/it-IT/faq.html -------------------------------------------------------------------------------- /locale/it-IT/about.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wijjo/passhash/HEAD/locale/it-IT/about.html -------------------------------------------------------------------------------- /locale/it-IT/dialog.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wijjo/passhash/HEAD/locale/it-IT/dialog.html -------------------------------------------------------------------------------- /skin/marker-clicked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wijjo/passhash/HEAD/skin/marker-clicked.png -------------------------------------------------------------------------------- /skin/unmask-clicked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wijjo/passhash/HEAD/skin/unmask-clicked.png -------------------------------------------------------------------------------- /locale/it-IT/changes.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wijjo/passhash/HEAD/locale/it-IT/changes.html -------------------------------------------------------------------------------- /locale/it-IT/options.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wijjo/passhash/HEAD/locale/it-IT/options.html -------------------------------------------------------------------------------- /locale/it-IT/portable.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wijjo/passhash/HEAD/locale/it-IT/portable.html -------------------------------------------------------------------------------- /locale/it-IT/tutorial.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wijjo/passhash/HEAD/locale/it-IT/tutorial.html -------------------------------------------------------------------------------- /screenshots/Passhash1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wijjo/passhash/HEAD/screenshots/Passhash1.png -------------------------------------------------------------------------------- /screenshots/Passhash2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wijjo/passhash/HEAD/screenshots/Passhash2.png -------------------------------------------------------------------------------- /screenshots/Passhash3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wijjo/passhash/HEAD/screenshots/Passhash3.png -------------------------------------------------------------------------------- /screenshots/Passhash4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wijjo/passhash/HEAD/screenshots/Passhash4.png -------------------------------------------------------------------------------- /screenshots/Passhash5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wijjo/passhash/HEAD/screenshots/Passhash5.png -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Password Hasher Firefox extension 2 | 3 | This is still available as a Firefox add-on, but not actively maintained. 4 | 5 | Please feel free to fork or email about taking over responsibility for the code. 6 | 7 | ## Mozilla License 8 | -------------------------------------------------------------------------------- /skin/passhash-options.css: -------------------------------------------------------------------------------- 1 | .prompt1 { 2 | min-width: 200px; 3 | max-width: 200px; 4 | min-height: 32px; 5 | background-color: #bbbbbb; 6 | } 7 | 8 | .prompt2 { 9 | min-width: 200px; 10 | max-width: 200px; 11 | min-height: 32px; 12 | background-color: #bbbbbb; 13 | } 14 | 15 | .sizebox radio { 16 | min-width: 40px; 17 | } 18 | -------------------------------------------------------------------------------- /skin/passhash-dialog.css: -------------------------------------------------------------------------------- 1 | .formlabel { 2 | text-align: right; 3 | } 4 | 5 | .formfield { 6 | font-weight: bold; 7 | min-width: 240px; 8 | max-width: 240px; 9 | } 10 | 11 | .formcheck { 12 | } 13 | 14 | .fieldbutton { 15 | min-width: 90px; 16 | max-width: 90px; 17 | vertical-align: middle; 18 | } 19 | 20 | .formrow { 21 | margin: 2px; 22 | } 23 | -------------------------------------------------------------------------------- /chrome.manifest: -------------------------------------------------------------------------------- 1 | content passhash content/ 2 | content passhash content/ contentaccessible=yes 3 | overlay chrome://browser/content/browser.xul chrome://passhash/content/passhash-overlay.xul 4 | 5 | locale passhash en-US locale/en-US/ 6 | locale passhash de-DE locale/de-DE/ 7 | locale passhash it-IT locale/it-IT/ 8 | 9 | skin passhash classic/1.0 skin/ 10 | style chrome://global/content/customizeToolbar.xul chrome://passhash/skin/passhash-overlay.css 11 | -------------------------------------------------------------------------------- /demo/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Password Hasher Demo 7 | 8 | 9 | 10 | 11 | 12 |

The Password Hasher online tool is now 13 | here. 14 | Please bookmark the new location. 15 | Sorry for the inconvenience

16 | 17 | -------------------------------------------------------------------------------- /locale/en-US/portable-blurb.html: -------------------------------------------------------------------------------- 1 | 14 | -------------------------------------------------------------------------------- /locale/de-DE/portable-blurb.html: -------------------------------------------------------------------------------- 1 | 12 | -------------------------------------------------------------------------------- /locale/it-IT/portable-blurb.html: -------------------------------------------------------------------------------- 1 | 14 | -------------------------------------------------------------------------------- /blurb: -------------------------------------------------------------------------------- 1 | What good security practice demands: 2 | 3 | * Strong passwords that are hard to guess. 4 | * Different passwords at each site. 5 | * Periodically changing existing passwords. 6 | 7 | Why you probably aren't practicing good security: 8 | 9 | * Strong passwords are difficult to remember. 10 | * Juggling a multitude of passwords is a pain. 11 | * Updating passwords compounds the memorization problem. 12 | 13 | How Password Hasher helps: 14 | 15 | * Strong passwords are automatically generated. 16 | * The same master key produces different passwords at many sites. 17 | * You can quickly upgrade passwords by "bumping" the site tag. 18 | * You can upgrade the master key without updating all sites at once. 19 | * It supports different length passwords. 20 | * It supports special requirements, such as digit and punctuation characters. 21 | * All data is saved to the browser's secure password database. 22 | * It's extremely simple to use! 23 | -------------------------------------------------------------------------------- /update.rdf: -------------------------------------------------------------------------------- 1 | 2 | 5 | 7 | 8 | 9 | 10 | 11 | 12 | 16 | 17 | 18 | 23 | 24 | -------------------------------------------------------------------------------- /locale/en-US/passhash.properties: -------------------------------------------------------------------------------- 1 | passhashDisclosureLabel1=More Info >> 2 | passhashDisclosureLabel2=<< Less Info 3 | passhashOptionsLabel1=Options >> 4 | passhashOptionsLabel2=<< Options 5 | passhashMissingSiteTag=Please provide a starting site tag. 6 | passhashShowPortableTitle=Show Portable Page 7 | passhashNotTextFieldError=Please select an input field before using Password Hasher 8 | passhashMarkerTip=Click for Password Hasher 9 | passhashUnmaskTip=Click to unmask the password 10 | passhashPortableTitle=Password Hasher 11 | passhashPortableSiteTagListPrompt=Select from your previously-used site tags 12 | passhashPortableSiteTagPrompt=Site or other name, e.g. google 13 | passhashPortableMasterKeyPrompt=Master key 14 | passhashPortableHashWordPrompt=Ctrl-C to copy, Enter to start another 15 | passhashPortableSiteTagLabel=Site Tag 16 | passhashPortableMasterKeyLabel=Master Key 17 | passhashPortableHashWordLabel=Hash Word 18 | passhashPortableUnmaskLabel=Unmask 19 | passhashPortableAcceptLabel=OK 20 | passhashPortableBumpLabel=Bump 21 | passhashPortableRequirementsLabel=Requirements 22 | passhashPortableRestrictionsLabel=Restrictions 23 | passhashPortableDigitLabel=Digit 24 | passhashPortablePunctuationLabel=Punctuation 25 | passhashPortableMixedCaseLabel=Mixed Case 26 | passhashPortableNoSpecialLabel=No Special 27 | passhashPortableDigitsOnlyLabel=Digits Only 28 | passhashPortableHashWordSizeLabel=Size 29 | -------------------------------------------------------------------------------- /locale/it-IT/passhash.properties: -------------------------------------------------------------------------------- 1 | passhashDisclosureLabel1=Aiuto >> 2 | passhashDisclosureLabel2=<< Chiudi aiuto 3 | passhashOptionsLabel1=Opzioni >> 4 | passhashOptionsLabel2=<< Opzioni 5 | passhashMissingSiteTag=Inserire l'identificativo del sito. 6 | passhashShowPortableTitle=Mostra versione portabile (html) 7 | passhashNotTextFieldError=Posizionarsi su una casella di testo per rendere attivo il comando 8 | passhashMarkerTip=Password Hasher 9 | passhashUnmaskTip=Nascondi la password 10 | passhashPortableTitle=Password Hasher 11 | passhashPortableSiteTagListPrompt=Seleziona dal tuo precedentemente utilizzato sito-tag 12 | passhashPortableSiteTagPrompt=Sito o altro nome, e.g. google 13 | passhashPortableMasterKeyPrompt=Master key 14 | passhashPortableHashWordPrompt=Ctrl-C per copiare, Invio per avviare un altro 15 | passhashPortableSiteTagLabel=Id sito 16 | passhashPortableMasterKeyLabel=Master Key 17 | passhashPortableHashWordLabel=Password generata 18 | passhashPortableUnmaskLabel=Mostra 19 | passhashPortableAcceptLabel=OK 20 | passhashPortableBumpLabel=Varia 21 | passhashPortableRequirementsLabel=Attributi 22 | passhashPortableRestrictionsLabel=Limitazioni 23 | passhashPortableDigitLabel=Cifre 24 | passhashPortablePunctuationLabel=Punteggiatura 25 | passhashPortableMixedCaseLabel=Minuscole e maiuscole 26 | passhashPortableNoSpecialLabel=Non speciali 27 | passhashPortableDigitsOnlyLabel=Solo cifre 28 | passhashPortableHashWordSizeLabel=Dimensione 29 | -------------------------------------------------------------------------------- /locale/de-DE/passhash.properties: -------------------------------------------------------------------------------- 1 | passhashDisclosureLabel1=Mehr Info >> 2 | passhashDisclosureLabel2=<< Weniger Info 3 | passhashOptionsLabel1=Optionen >> 4 | passhashOptionsLabel2=<< Optionen 5 | passhashMissingSiteTag=Bitte geben Sie eine Seitenkennung an. 6 | passhashShowPortableTitle=Stickware-Seite zeigen 7 | passhashNotTextFieldError=Bitte wählen Sie ein Eingabefeld, bevor Sie Password Hasher verwenden. 8 | passhashMarkerTip=Anklicken für Password Hasher 9 | passhashUnmaskTip=Anklicken, um Passwort in Klartext anzuzeigen 10 | passhashPortableTitle=Password Hasher 11 | passhashPortableSiteTagListPrompt=Aus zuvor verwendeten Seitenkennungen auswählen 12 | passhashPortableSiteTagPrompt=Name der Seite, z.B. google 13 | passhashPortableMasterKeyPrompt=Master Key 14 | passhashPortableHashWordPrompt=Strg-C zum Kopieren, Enter generiert neu 15 | passhashPortableSiteTagLabel=Seitenkennung 16 | passhashPortableMasterKeyLabel=Master Key 17 | passhashPortableHashWordLabel=Hash-Wort 18 | passhashPortableUnmaskLabel=Klartext 19 | passhashPortableAcceptLabel=OK 20 | passhashPortableBumpLabel=Variieren 21 | passhashPortableRequirementsLabel=Anforderungen 22 | passhashPortableRestrictionsLabel=Einschränkungen 23 | passhashPortableDigitLabel=Wenigstens eine Ziffer 24 | passhashPortablePunctuationLabel=Wenigstens ein Satzzeichen 25 | passhashPortableMixedCaseLabel=Groß- und Kleinbuchstaben 26 | passhashPortableNoSpecialLabel=Keine Sonderzeichen 27 | passhashPortableDigitsOnlyLabel=Nur Ziffern 28 | passhashPortableHashWordSizeLabel=Größe 29 | -------------------------------------------------------------------------------- /content/passhash-overlay.xul: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 7 | 8 | 16 | 17 | 20 | 21 | 24 | 25 | 26 | 27 | 28 | 29 |
30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 47 | 48 | 49 | 55 | 56 | 57 | 58 | 59 | 60 | 66 | 67 | 68 | 69 | 70 | 71 | 77 | 78 | 79 | 86 | 92 | 93 | 94 | 102 | 103 | 104 | 148 | 149 | 150 | 181 | 182 | 183 | 290 | 291 | 292 |
${passhashPortableTitle}
${passhashPortableSiteTagLabel}
40 | 46 |
50 | 54 |
${passhashPortableMasterKeyLabel}
61 | 65 |
${passhashPortableHashWordLabel}
72 | 76 |
80 | 85 | 87 | 91 |
95 | 98 | 99 | ${passhashPortableUnmaskLabel} 100 | 101 |
105 | 106 | 107 | 112 | 113 | 114 | 123 | 124 | 125 | 134 | 135 | 136 | 145 | 146 |
108 |
109 | ${passhashPortableRequirementsLabel} 110 |
111 |
115 | 119 | 120 | ${passhashPortableDigitLabel} 121 | 122 |
126 | 130 | 131 | ${passhashPortablePunctuationLabel} 132 | 133 |
137 | 141 | 142 | ${passhashPortableMixedCaseLabel} 143 | 144 |
147 |
151 | 152 | 153 | 158 | 159 | 160 | 168 | 169 | 170 | 178 | 179 |
154 |
155 | ${passhashPortableRestrictionsLabel} 156 |
157 |
161 | 164 | 165 | ${passhashPortableNoSpecialLabel} 166 | 167 |
171 | 174 | 175 | ${passhashPortableDigitsOnlyLabel} 176 | 177 |
180 |
184 | 185 | 186 | 191 | 192 | 193 | 200 | 207 | 208 | 209 | 216 | 223 | 224 | 225 | 232 | 239 | 240 | 241 | 248 | 255 | 256 | 257 | 264 | 271 | 272 | 273 | 280 | 287 | 288 |
187 |
188 | ${passhashPortableHashWordSizeLabel} 189 |
190 |
194 | 198 | 4 199 | 201 | 205 | 16 206 |
210 | 214 | 6 215 | 217 | 221 | 18 222 |
226 | 230 | 8 231 | 233 | 237 | 20 238 |
242 | 246 | 10 247 | 249 | 253 | 22 254 |
258 | 262 | 12 263 | 265 | 269 | 24 270 |
274 | 278 | 14 279 | 281 | 285 | 26 286 |
289 |
293 |
294 |
295 |
296 | 297 |
298 |
299 | 300 | 301 | 302 | -------------------------------------------------------------------------------- /content/passhash-dialog.js: -------------------------------------------------------------------------------- 1 | /* ***** BEGIN LICENSE BLOCK ***** 2 | * Version: MPL 1.1/GPL 2.0/LGPL 2.1 3 | * 4 | * The contents of this file are subject to the Mozilla Public License Version 5 | * 1.1 (the "License"); you may not use this file except in compliance with 6 | * the License. You may obtain a copy of the License at 7 | * http://www.mozilla.org/MPL/ 8 | * 9 | * Software distributed under the License is distributed on an "AS IS" basis, 10 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 11 | * for the specific language governing rights and limitations under the 12 | * License. 13 | * 14 | * The Original Code is Password Hasher 15 | * 16 | * The Initial Developer of the Original Code is Steve Cooper. 17 | * Portions created by the Initial Developer are Copyright (C) 2006 18 | * the Initial Developer. All Rights Reserved. 19 | * 20 | * Contributor(s): (none) 21 | * 22 | * Alternatively, the contents of this file may be used under the terms of 23 | * either the GNU General Public License Version 2 or later (the "GPL"), or 24 | * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 25 | * in which case the provisions of the GPL or the LGPL are applicable instead 26 | * of those above. If you wish to allow use of your version of this file only 27 | * under the terms of either the GPL or the LGPL, and not to allow others to 28 | * use your version of this file under the terms of the MPL, indicate your 29 | * decision by deleting the provisions above and replace them with the notice 30 | * and other provisions required by the GPL or the LGPL. If you do not delete 31 | * the provisions above, a recipient may use your version of this file under 32 | * the terms of any one of the MPL, the GPL or the LGPL. 33 | * 34 | * ***** END LICENSE BLOCK ***** */ 35 | 36 | var PassHash = 37 | { 38 | // These variables track whether or not dialog regions are hidden. 39 | optionsHidden: true, 40 | notesHidden: true, 41 | 42 | // These variables are initialized to preference defaults and some are kept 43 | // in sync with control state, as appropriate. 44 | guessSiteTag: null, 45 | rememberSiteTag: null, 46 | rememberMasterKey: null, 47 | revealSiteTag: null, 48 | revealHashWord: null, 49 | guessFullDomain: null, 50 | requireDigit: null, 51 | requirePunctuation: null, 52 | requireMixedCase: null, 53 | restrictSpecial: null, 54 | restrictDigits: null, 55 | hashWordSize: null, 56 | 57 | onLoad: function() 58 | { 59 | var ctlSiteTag = document.getElementById("site-tag"); 60 | var ctlMasterKey = document.getElementById("master-key"); 61 | var ctlRequireDigit = document.getElementById("digit"); 62 | var ctlRequirePunctuation = document.getElementById("punctuation"); 63 | var ctlRequireMixedCase = document.getElementById("mixedCase"); 64 | var ctlRestrictSpecial = document.getElementById("noSpecial"); 65 | var ctlRestrictDigits = document.getElementById("digitsOnly"); 66 | var ctlHashWordSize = document.getElementById("hashWordSize"); 67 | 68 | var prefs = PassHashCommon.loadOptions(); 69 | this.guessSiteTag = prefs.guessSiteTag; 70 | this.rememberSiteTag = prefs.rememberSiteTag; 71 | this.rememberMasterKey = prefs.rememberMasterKey; 72 | this.revealSiteTag = prefs.revealSiteTag; 73 | this.revealHashWord = prefs.revealHashWord; 74 | this.guessFullDomain = prefs.guessFullDomain; 75 | this.requireDigit = prefs.digitDefault; 76 | this.requirePunctuation = prefs.punctuationDefault; 77 | this.requireMixedCase = prefs.mixedCaseDefault; 78 | this.restrictSpecial = false; 79 | this.restrictDigits = false; 80 | this.hashWordSize = prefs.hashWordSizeDefault; 81 | 82 | this.onUnmask(); 83 | 84 | var defaultSiteTag = ""; 85 | var domain = PassHashCommon.getDomain(window.arguments[0].input); 86 | var defaultSiteTag = ""; 87 | if (this.guessSiteTag && domain != null) 88 | defaultSiteTag = (this.guessFullDomain ? domain : domain.split(".")[0]); 89 | ctlSiteTag.value = PassHashCommon.loadSecureValue( 90 | this.rememberSiteTag, 91 | "site-tag", 92 | domain, 93 | defaultSiteTag); 94 | ctlMasterKey.value = PassHashCommon.loadSecureValue( 95 | this.rememberMasterKey, 96 | "master-key", 97 | domain, 98 | ""); 99 | 100 | // Assume if there's a master key present without an options string 101 | // that we're on a site that was last accessed under an older version 102 | // of this extension, i.e. before hash word options were supported. If 103 | // so, force it to start with cleared options for backward 104 | // compatibility. Otherwise use the preferences as the default. 105 | var strDefOptions = (ctlMasterKey.value ? "" : this.getOptionString()); 106 | var strOptions2 = PassHashCommon.loadSecureValue(true, "options", domain, strDefOptions); 107 | this.parseOptionString(strOptions2); 108 | // This is the only time we write to the option controls. Otherwise we 109 | // just react to their state changes. 110 | ctlRequireDigit.checked = this.requireDigit; 111 | ctlRequirePunctuation.checked = this.requirePunctuation; 112 | ctlRequireMixedCase.checked = this.requireMixedCase; 113 | ctlRestrictSpecial.checked = this.restrictSpecial; 114 | ctlRestrictDigits.checked = this.restrictDigits; 115 | this.updateCheckboxes(); 116 | 117 | var btn = document.getElementById("hashWordSize"+this.hashWordSize); 118 | // Protect against bad saved hashWordSize value. 119 | if (btn == null) 120 | { 121 | btn = document.getElementById("hashWordSize8"); 122 | this.hashWordSize = 8; 123 | } 124 | ctlHashWordSize.selectedItem = btn; 125 | 126 | this.updateOptionsVisibility(); // Hide the options 127 | this.updateNotesVisibility(); // Hide the notes 128 | 129 | if (ctlSiteTag.value) 130 | { 131 | ctlMasterKey.select(); 132 | ctlMasterKey.focus(); 133 | } 134 | else 135 | { 136 | ctlSiteTag.select(); 137 | ctlSiteTag.focus(); 138 | } 139 | 140 | this.updateHashWord(); 141 | }, 142 | 143 | onAccept: function() 144 | { 145 | if (this.update()) 146 | { 147 | var domain = PassHashCommon.getDomain(window.arguments[0].input); 148 | PassHashCommon.saveSecureValue( 149 | this.rememberSiteTag, 150 | "site-tag", 151 | domain, 152 | document.getElementById("site-tag").value); 153 | PassHashCommon.saveSecureValue( 154 | this.rememberMasterKey, 155 | "master-key", 156 | domain, 157 | document.getElementById("master-key").value); 158 | var strOptions = this.getOptionString(); 159 | PassHashCommon.saveSecureValue(true, "options", domain, strOptions); 160 | window.arguments[0].output = document.getElementById("hash-word" ).value; 161 | return true; 162 | } 163 | return false; 164 | }, 165 | 166 | onOptions: function() 167 | { 168 | this.optionsHidden = !this.optionsHidden; 169 | this.updateOptionsVisibility(); 170 | }, 171 | 172 | onDisclosure: function() 173 | { 174 | this.notesHidden = !this.notesHidden; 175 | this.updateNotesVisibility(); 176 | }, 177 | 178 | updateOptionsVisibility: function() 179 | { 180 | document.getElementById("options-box").hidden = this.optionsHidden; 181 | var strName = (this.optionsHidden ? "passhashOptionsLabel1" : "passhashOptionsLabel2"); 182 | var label = document.getElementById("passhash_strings").getString(strName); 183 | document.getElementById("options").label = label; 184 | window.sizeToContent(); 185 | }, 186 | 187 | updateNotesVisibility: function() 188 | { 189 | document.getElementById("notes").hidden = this.notesHidden; 190 | var strName = (this.notesHidden ? "passhashDisclosureLabel1" : "passhashDisclosureLabel2"); 191 | var label = document.getElementById("passhash_strings").getString(strName); 192 | document.documentElement.getButton("disclosure").label = label; 193 | window.sizeToContent(); 194 | }, 195 | 196 | onUnmask: function() 197 | { 198 | var ctlSiteTag = document.getElementById("site-tag"); 199 | var ctlMasterKey = document.getElementById("master-key"); 200 | var ctlHashWord = document.getElementById("hash-word"); 201 | if (document.getElementById("unmask").checked) 202 | { 203 | ctlSiteTag .setAttribute("type", ""); 204 | ctlMasterKey.setAttribute("type", ""); 205 | ctlHashWord .setAttribute("type", ""); 206 | } 207 | else 208 | { 209 | ctlSiteTag .setAttribute("type", this.revealSiteTag ? "" : "password"); 210 | ctlMasterKey.setAttribute("type", "password"); 211 | ctlHashWord .setAttribute("type", this.revealHashWord ? "" : "password"); 212 | } 213 | this.update(); 214 | }, 215 | 216 | onBlurSiteTag: function() 217 | { 218 | var ctlSiteTag = document.getElementById("site-tag"); 219 | ctlSiteTag.value = ctlSiteTag.value.replace(/^[ \t]*(.*)[ \t]*$/, "$1"); 220 | }, 221 | 222 | onBumpSiteTag: function() 223 | { 224 | var ctlSiteTag = document.getElementById("site-tag"); 225 | ctlSiteTag.value = PassHashCommon.bumpSiteTag(ctlSiteTag.value); 226 | this.update(); 227 | }, 228 | 229 | // Generate hash word if possible 230 | // Returns: 231 | // 0 = Hash word ok, but unchanged 232 | // 1 = Site tag bad or missing 233 | // 2 = Master key bad or missing 234 | // 3 = Hash word successfully generated 235 | updateHashWord: function() 236 | { 237 | var ctlSiteTag = document.getElementById("site-tag" ); 238 | var ctlMasterKey = document.getElementById("master-key"); 239 | var ctlHashWord = document.getElementById("hash-word" ); 240 | if (!ctlSiteTag.value) 241 | return 1; 242 | if (!ctlMasterKey.value) 243 | return 2; 244 | // Change the hash word and determine whether or not it was modified. 245 | var hashWordOrig = ctlHashWord.value; 246 | ctlHashWord.value = PassHashCommon.generateHashWord( 247 | ctlSiteTag.value, 248 | ctlMasterKey.value, 249 | this.hashWordSize, 250 | this.requireDigit, 251 | this.requirePunctuation, 252 | this.requireMixedCase, 253 | this.restrictSpecial, 254 | this.restrictDigits); 255 | if (ctlHashWord.value != hashWordOrig) 256 | return 3; // It was modified 257 | return 0; // It was not modified 258 | }, 259 | 260 | onRequireDigitChanged: function() 261 | { 262 | this.requireDigit = document.getElementById("digit").checked; 263 | this.update(); 264 | }, 265 | 266 | onRequirePunctuationChanged: function() 267 | { 268 | this.requirePunctuation = document.getElementById("punctuation").checked; 269 | this.update(); 270 | }, 271 | 272 | onRequireMixedCaseChanged: function() 273 | { 274 | this.requireMixedCase = document.getElementById("mixedCase").checked; 275 | this.update(); 276 | }, 277 | 278 | onRestrictSpecialChanged: function() 279 | { 280 | this.restrictSpecial = document.getElementById("noSpecial").checked; 281 | this.update(); 282 | }, 283 | 284 | onRestrictDigitsChanged: function() 285 | { 286 | this.restrictDigits = document.getElementById("digitsOnly").checked; 287 | this.update(); 288 | }, 289 | 290 | onHashWordSizeChanged: function() 291 | { 292 | this.hashWordSize = document.getElementById("hashWordSize").selectedItem.value; 293 | this.update(); 294 | }, 295 | 296 | updateCheckboxes: function() 297 | { 298 | document.getElementById("digit").disabled = 299 | this.restrictDigits; 300 | document.getElementById("punctuation").disabled = 301 | (this.restrictSpecial || this.restrictDigits); 302 | document.getElementById("mixedCase").disabled = 303 | this.restrictDigits; 304 | document.getElementById("noSpecial").disabled = 305 | this.restrictDigits; 306 | document.getElementById("digitsOnly").disabled = 307 | false; // Can always add digits-only as a further restriction 308 | }, 309 | 310 | // Determines where to focus and generates the hash word when adequate 311 | // information is available. 312 | update: function() 313 | { 314 | this.updateCheckboxes() 315 | switch (this.updateHashWord()) 316 | { 317 | case 1: 318 | document.getElementById("site-tag").focus(); 319 | return false; 320 | case 2: 321 | document.getElementById("master-key").focus(); 322 | return false; 323 | case 3: 324 | document.documentElement.getButton("accept").focus(); 325 | return false; 326 | } 327 | document.documentElement.getButton("accept").focus(); 328 | return true; 329 | }, 330 | 331 | parseOptionString: function(s) 332 | { 333 | this.requireDigit = (s.search(/d/i) >= 0); 334 | this.requirePunctuation = (s.search(/p/i) >= 0); 335 | this.requireMixedCase = (s.search(/m/i) >= 0); 336 | this.restrictSpecial = (s.search(/r/i) >= 0); 337 | this.restrictDigits = (s.search(/g/i) >= 0); 338 | var sizeMatch = s.match(/[0-9]+/); 339 | this.hashWordSize = (sizeMatch != null && sizeMatch.length > 0 340 | ? parseInt(sizeMatch[0]) 341 | : 8); 342 | }, 343 | 344 | getOptionString: function() 345 | { 346 | var opts = ''; 347 | if (this.requireDigit) 348 | opts += 'd'; 349 | if (this.requirePunctuation) 350 | opts += 'p'; 351 | if (this.requireMixedCase) 352 | opts += 'm'; 353 | if (this.restrictSpecial) 354 | opts += 'r'; 355 | if (this.restrictDigits) 356 | opts += 'g'; 357 | opts += this.hashWordSize.toString(); 358 | return opts; 359 | } 360 | 361 | } 362 | -------------------------------------------------------------------------------- /license.txt: -------------------------------------------------------------------------------- 1 | Mozilla Public License, version 2.0 2 | 3 | 1. Definitions 4 | 5 | 1.1. "Contributor" 6 | 7 | means each individual or legal entity that creates, contributes to the 8 | creation of, or owns Covered Software. 9 | 10 | 1.2. "Contributor Version" 11 | 12 | means the combination of the Contributions of others (if any) used by a 13 | Contributor and that particular Contributor's Contribution. 14 | 15 | 1.3. "Contribution" 16 | 17 | means Covered Software of a particular Contributor. 18 | 19 | 1.4. "Covered Software" 20 | 21 | means Source Code Form to which the initial Contributor has attached the 22 | notice in Exhibit A, the Executable Form of such Source Code Form, and 23 | Modifications of such Source Code Form, in each case including portions 24 | thereof. 25 | 26 | 1.5. "Incompatible With Secondary Licenses" 27 | means 28 | 29 | a. that the initial Contributor has attached the notice described in 30 | Exhibit B to the Covered Software; or 31 | 32 | b. that the Covered Software was made available under the terms of 33 | version 1.1 or earlier of the License, but not also under the terms of 34 | a Secondary License. 35 | 36 | 1.6. "Executable Form" 37 | 38 | means any form of the work other than Source Code Form. 39 | 40 | 1.7. "Larger Work" 41 | 42 | means a work that combines Covered Software with other material, in a 43 | separate file or files, that is not Covered Software. 44 | 45 | 1.8. "License" 46 | 47 | means this document. 48 | 49 | 1.9. "Licensable" 50 | 51 | means having the right to grant, to the maximum extent possible, whether 52 | at the time of the initial grant or subsequently, any and all of the 53 | rights conveyed by this License. 54 | 55 | 1.10. "Modifications" 56 | 57 | means any of the following: 58 | 59 | a. any file in Source Code Form that results from an addition to, 60 | deletion from, or modification of the contents of Covered Software; or 61 | 62 | b. any new file in Source Code Form that contains any Covered Software. 63 | 64 | 1.11. "Patent Claims" of a Contributor 65 | 66 | means any patent claim(s), including without limitation, method, 67 | process, and apparatus claims, in any patent Licensable by such 68 | Contributor that would be infringed, but for the grant of the License, 69 | by the making, using, selling, offering for sale, having made, import, 70 | or transfer of either its Contributions or its Contributor Version. 71 | 72 | 1.12. "Secondary License" 73 | 74 | means either the GNU General Public License, Version 2.0, the GNU Lesser 75 | General Public License, Version 2.1, the GNU Affero General Public 76 | License, Version 3.0, or any later versions of those licenses. 77 | 78 | 1.13. "Source Code Form" 79 | 80 | means the form of the work preferred for making modifications. 81 | 82 | 1.14. "You" (or "Your") 83 | 84 | means an individual or a legal entity exercising rights under this 85 | License. For legal entities, "You" includes any entity that controls, is 86 | controlled by, or is under common control with You. For purposes of this 87 | definition, "control" means (a) the power, direct or indirect, to cause 88 | the direction or management of such entity, whether by contract or 89 | otherwise, or (b) ownership of more than fifty percent (50%) of the 90 | outstanding shares or beneficial ownership of such entity. 91 | 92 | 93 | 2. License Grants and Conditions 94 | 95 | 2.1. Grants 96 | 97 | Each Contributor hereby grants You a world-wide, royalty-free, 98 | non-exclusive license: 99 | 100 | a. under intellectual property rights (other than patent or trademark) 101 | Licensable by such Contributor to use, reproduce, make available, 102 | modify, display, perform, distribute, and otherwise exploit its 103 | Contributions, either on an unmodified basis, with Modifications, or 104 | as part of a Larger Work; and 105 | 106 | b. under Patent Claims of such Contributor to make, use, sell, offer for 107 | sale, have made, import, and otherwise transfer either its 108 | Contributions or its Contributor Version. 109 | 110 | 2.2. Effective Date 111 | 112 | The licenses granted in Section 2.1 with respect to any Contribution 113 | become effective for each Contribution on the date the Contributor first 114 | distributes such Contribution. 115 | 116 | 2.3. Limitations on Grant Scope 117 | 118 | The licenses granted in this Section 2 are the only rights granted under 119 | this License. No additional rights or licenses will be implied from the 120 | distribution or licensing of Covered Software under this License. 121 | Notwithstanding Section 2.1(b) above, no patent license is granted by a 122 | Contributor: 123 | 124 | a. for any code that a Contributor has removed from Covered Software; or 125 | 126 | b. for infringements caused by: (i) Your and any other third party's 127 | modifications of Covered Software, or (ii) the combination of its 128 | Contributions with other software (except as part of its Contributor 129 | Version); or 130 | 131 | c. under Patent Claims infringed by Covered Software in the absence of 132 | its Contributions. 133 | 134 | This License does not grant any rights in the trademarks, service marks, 135 | or logos of any Contributor (except as may be necessary to comply with 136 | the notice requirements in Section 3.4). 137 | 138 | 2.4. Subsequent Licenses 139 | 140 | No Contributor makes additional grants as a result of Your choice to 141 | distribute the Covered Software under a subsequent version of this 142 | License (see Section 10.2) or under the terms of a Secondary License (if 143 | permitted under the terms of Section 3.3). 144 | 145 | 2.5. Representation 146 | 147 | Each Contributor represents that the Contributor believes its 148 | Contributions are its original creation(s) or it has sufficient rights to 149 | grant the rights to its Contributions conveyed by this License. 150 | 151 | 2.6. Fair Use 152 | 153 | This License is not intended to limit any rights You have under 154 | applicable copyright doctrines of fair use, fair dealing, or other 155 | equivalents. 156 | 157 | 2.7. Conditions 158 | 159 | Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in 160 | Section 2.1. 161 | 162 | 163 | 3. Responsibilities 164 | 165 | 3.1. Distribution of Source Form 166 | 167 | All distribution of Covered Software in Source Code Form, including any 168 | Modifications that You create or to which You contribute, must be under 169 | the terms of this License. You must inform recipients that the Source 170 | Code Form of the Covered Software is governed by the terms of this 171 | License, and how they can obtain a copy of this License. You may not 172 | attempt to alter or restrict the recipients' rights in the Source Code 173 | Form. 174 | 175 | 3.2. Distribution of Executable Form 176 | 177 | If You distribute Covered Software in Executable Form then: 178 | 179 | a. such Covered Software must also be made available in Source Code Form, 180 | as described in Section 3.1, and You must inform recipients of the 181 | Executable Form how they can obtain a copy of such Source Code Form by 182 | reasonable means in a timely manner, at a charge no more than the cost 183 | of distribution to the recipient; and 184 | 185 | b. You may distribute such Executable Form under the terms of this 186 | License, or sublicense it under different terms, provided that the 187 | license for the Executable Form does not attempt to limit or alter the 188 | recipients' rights in the Source Code Form under this License. 189 | 190 | 3.3. Distribution of a Larger Work 191 | 192 | You may create and distribute a Larger Work under terms of Your choice, 193 | provided that You also comply with the requirements of this License for 194 | the Covered Software. If the Larger Work is a combination of Covered 195 | Software with a work governed by one or more Secondary Licenses, and the 196 | Covered Software is not Incompatible With Secondary Licenses, this 197 | License permits You to additionally distribute such Covered Software 198 | under the terms of such Secondary License(s), so that the recipient of 199 | the Larger Work may, at their option, further distribute the Covered 200 | Software under the terms of either this License or such Secondary 201 | License(s). 202 | 203 | 3.4. Notices 204 | 205 | You may not remove or alter the substance of any license notices 206 | (including copyright notices, patent notices, disclaimers of warranty, or 207 | limitations of liability) contained within the Source Code Form of the 208 | Covered Software, except that You may alter any license notices to the 209 | extent required to remedy known factual inaccuracies. 210 | 211 | 3.5. Application of Additional Terms 212 | 213 | You may choose to offer, and to charge a fee for, warranty, support, 214 | indemnity or liability obligations to one or more recipients of Covered 215 | Software. However, You may do so only on Your own behalf, and not on 216 | behalf of any Contributor. You must make it absolutely clear that any 217 | such warranty, support, indemnity, or liability obligation is offered by 218 | You alone, and You hereby agree to indemnify every Contributor for any 219 | liability incurred by such Contributor as a result of warranty, support, 220 | indemnity or liability terms You offer. You may include additional 221 | disclaimers of warranty and limitations of liability specific to any 222 | jurisdiction. 223 | 224 | 4. Inability to Comply Due to Statute or Regulation 225 | 226 | If it is impossible for You to comply with any of the terms of this License 227 | with respect to some or all of the Covered Software due to statute, 228 | judicial order, or regulation then You must: (a) comply with the terms of 229 | this License to the maximum extent possible; and (b) describe the 230 | limitations and the code they affect. Such description must be placed in a 231 | text file included with all distributions of the Covered Software under 232 | this License. Except to the extent prohibited by statute or regulation, 233 | such description must be sufficiently detailed for a recipient of ordinary 234 | skill to be able to understand it. 235 | 236 | 5. Termination 237 | 238 | 5.1. The rights granted under this License will terminate automatically if You 239 | fail to comply with any of its terms. However, if You become compliant, 240 | then the rights granted under this License from a particular Contributor 241 | are reinstated (a) provisionally, unless and until such Contributor 242 | explicitly and finally terminates Your grants, and (b) on an ongoing 243 | basis, if such Contributor fails to notify You of the non-compliance by 244 | some reasonable means prior to 60 days after You have come back into 245 | compliance. Moreover, Your grants from a particular Contributor are 246 | reinstated on an ongoing basis if such Contributor notifies You of the 247 | non-compliance by some reasonable means, this is the first time You have 248 | received notice of non-compliance with this License from such 249 | Contributor, and You become compliant prior to 30 days after Your receipt 250 | of the notice. 251 | 252 | 5.2. If You initiate litigation against any entity by asserting a patent 253 | infringement claim (excluding declaratory judgment actions, 254 | counter-claims, and cross-claims) alleging that a Contributor Version 255 | directly or indirectly infringes any patent, then the rights granted to 256 | You by any and all Contributors for the Covered Software under Section 257 | 2.1 of this License shall terminate. 258 | 259 | 5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user 260 | license agreements (excluding distributors and resellers) which have been 261 | validly granted by You or Your distributors under this License prior to 262 | termination shall survive termination. 263 | 264 | 6. Disclaimer of Warranty 265 | 266 | Covered Software is provided under this License on an "as is" basis, 267 | without warranty of any kind, either expressed, implied, or statutory, 268 | including, without limitation, warranties that the Covered Software is free 269 | of defects, merchantable, fit for a particular purpose or non-infringing. 270 | The entire risk as to the quality and performance of the Covered Software 271 | is with You. Should any Covered Software prove defective in any respect, 272 | You (not any Contributor) assume the cost of any necessary servicing, 273 | repair, or correction. This disclaimer of warranty constitutes an essential 274 | part of this License. No use of any Covered Software is authorized under 275 | this License except under this disclaimer. 276 | 277 | 7. Limitation of Liability 278 | 279 | Under no circumstances and under no legal theory, whether tort (including 280 | negligence), contract, or otherwise, shall any Contributor, or anyone who 281 | distributes Covered Software as permitted above, be liable to You for any 282 | direct, indirect, special, incidental, or consequential damages of any 283 | character including, without limitation, damages for lost profits, loss of 284 | goodwill, work stoppage, computer failure or malfunction, or any and all 285 | other commercial damages or losses, even if such party shall have been 286 | informed of the possibility of such damages. This limitation of liability 287 | shall not apply to liability for death or personal injury resulting from 288 | such party's negligence to the extent applicable law prohibits such 289 | limitation. Some jurisdictions do not allow the exclusion or limitation of 290 | incidental or consequential damages, so this exclusion and limitation may 291 | not apply to You. 292 | 293 | 8. Litigation 294 | 295 | Any litigation relating to this License may be brought only in the courts 296 | of a jurisdiction where the defendant maintains its principal place of 297 | business and such litigation shall be governed by laws of that 298 | jurisdiction, without reference to its conflict-of-law provisions. Nothing 299 | in this Section shall prevent a party's ability to bring cross-claims or 300 | counter-claims. 301 | 302 | 9. Miscellaneous 303 | 304 | This License represents the complete agreement concerning the subject 305 | matter hereof. If any provision of this License is held to be 306 | unenforceable, such provision shall be reformed only to the extent 307 | necessary to make it enforceable. Any law or regulation which provides that 308 | the language of a contract shall be construed against the drafter shall not 309 | be used to construe this License against a Contributor. 310 | 311 | 312 | 10. Versions of the License 313 | 314 | 10.1. New Versions 315 | 316 | Mozilla Foundation is the license steward. Except as provided in Section 317 | 10.3, no one other than the license steward has the right to modify or 318 | publish new versions of this License. Each version will be given a 319 | distinguishing version number. 320 | 321 | 10.2. Effect of New Versions 322 | 323 | You may distribute the Covered Software under the terms of the version 324 | of the License under which You originally received the Covered Software, 325 | or under the terms of any subsequent version published by the license 326 | steward. 327 | 328 | 10.3. Modified Versions 329 | 330 | If you create software not governed by this License, and you want to 331 | create a new license for such software, you may create and use a 332 | modified version of this License if you rename the license and remove 333 | any references to the name of the license steward (except to note that 334 | such modified license differs from this License). 335 | 336 | 10.4. Distributing Source Code Form that is Incompatible With Secondary 337 | Licenses If You choose to distribute Source Code Form that is 338 | Incompatible With Secondary Licenses under the terms of this version of 339 | the License, the notice described in Exhibit B of this License must be 340 | attached. 341 | 342 | Exhibit A - Source Code Form License Notice 343 | 344 | This Source Code Form is subject to the 345 | terms of the Mozilla Public License, v. 346 | 2.0. If a copy of the MPL was not 347 | distributed with this file, You can 348 | obtain one at 349 | http://mozilla.org/MPL/2.0/. 350 | 351 | If it is not possible or desirable to put the notice in a particular file, 352 | then You may include the notice in a location (such as a LICENSE file in a 353 | relevant directory) where a recipient would be likely to look for such a 354 | notice. 355 | 356 | You may add additional accurate notices of copyright ownership. 357 | 358 | Exhibit B - "Incompatible With Secondary Licenses" Notice 359 | 360 | This Source Code Form is "Incompatible 361 | With Secondary Licenses", as defined by 362 | the Mozilla Public License, v. 2.0. 363 | --------------------------------------------------------------------------------