Skip to content

Commit

Permalink
Add optional AEP generation method for enhanced site compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
adrium committed Jun 14, 2020
1 parent f24724c commit cccdea8
Show file tree
Hide file tree
Showing 10 changed files with 34 additions and 8 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Differences to the original version:
* Show the passwords concealed to use drag and drop
* Smaller theme with accent color
* Sync works, but disabled due to missing API keys
* Add new AEP password generation method to ensure 2 characters of every charset and symbol compatibility (with sites like ebay.com)

Using multiple master passwords
-------------------------------
Expand Down
19 changes: 18 additions & 1 deletion lib/crypto.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,8 @@ export function derivePasswordUniversal(params)
{
let types = {
generated: {hasher: deriveBitsLegacy, stringifier: toPassword},
generated2: {hasher: deriveBits, stringifier: toPassword}
generated2: {hasher: deriveBits, stringifier: toPassword},
generatedAep: {hasher: deriveBits, stringifier: toPasswordAep}
};

let impl = types[params.type];
Expand Down Expand Up @@ -251,6 +252,22 @@ function toPassword(array, lower, upper, number, symbol)
return toPasswordUniversal(array, charsettings);
}

function toPasswordAep(array, lower, upper, number, symbol)
{
let charsettings = [];

if (lower)
charsettings.push({charset: "abcdefghijklmnopqrstuvwxyz", min: 2, max: 1024});
if (upper)
charsettings.push({charset: "ABCDEFGHIJKLMNOPQRSTUVWXYZ", min: 2, max: 1024});
if (number)
charsettings.push({charset: "0123456789", min: 2, max: 1024});
if (symbol)
charsettings.push({charset: "!#$%&*+-?@", min: 2, max: 1024});

return toPasswordUniversal(array, charsettings);
}

function toPasswordUniversal(array, charsettings)
{
for (let s of charsettings)
Expand Down
4 changes: 2 additions & 2 deletions lib/passwords.js
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ export function setSite(entry)
});
}

export function addGenerated({site, name, revision, length, lower, upper, number, symbol, notes}, replaceExisting)
export function addGenerated({site, name, revision, length, lower, upper, number, symbol, notes, type_aep}, replaceExisting)
{
return lock.acquire().then(() => _ensureSiteData(site)).then(() =>
{
Expand All @@ -362,7 +362,7 @@ export function addGenerated({site, name, revision, length, lower, upper, number
if (exists)
throw "alreadyExists";

let type = "generated2";
let type = type_aep ? "generatedAep" : "generated2";
let data = {
site, name, revision, type, length, lower, upper, number, symbol
};
Expand Down
2 changes: 2 additions & 0 deletions locale/en_US/panel/components/GeneratedPassword.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
"replace_warning": "Making this a generated password will change its value. Make sure that you already filled in \"current password\" in the website's password change form.",
"keep_notes": "Keep notes from original password",
"length_label": "Length:",
"type_aep_label": "AEP generation method",
"type_aep_title": "Generates passwords that are more compatible with certain sites (ensures 2 characters of every charset and uses less symbols)",
"allowed_characters_label": "Allowed characters:",
"submit": "Generate password",

Expand Down
1 change: 1 addition & 0 deletions locale/en_US/panel/components/PasswordEntry.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"password_menu": "All actions",
"password_type_generatedAep": "Generated AEP password",
"password_type_generated2": "Generated password",
"password_type_stored": "Stored password",
"password_length": "Length:",
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"description": "__MSG_description__",
"author": "Wladimir Palant / Adrium",
"homepage_url": "https://github.com/adrium/easypass",
"version": "2.2.3",
"version": "2.2.3.2020",
"permissions": [
"activeTab",
"storage",
Expand Down
Binary file modified media/screenshot2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions ui/allpasswords/components/PasswordInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
<iconic-link class="password-remove-link" :title="$t('/(panel)(components)(PasswordMenu)remove_password')" @click="removePassword" />
</div>
<div class="password-info">
<template v-if="password.type == 'generated2'">
<div class="password-type">{{ $t("/(panel)(components)(PasswordEntry)password_type_generated2") }}</div>
<template v-if="password.type.indexOf('generated') == 0">
<div class="password-type">{{ $t("/(panel)(components)(PasswordEntry)password_type_" + password.type) }}</div>
<div>{{ $t("/(panel)(components)(PasswordEntry)password_length") }} {{ password.length }}</div>
<div>{{ $t("/(panel)(components)(PasswordEntry)allowed_characters") }} {{ allowedChars }}</div>
</template>
Expand Down
5 changes: 5 additions & 0 deletions ui/panel/components/GeneratedPassword.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@
<label><input v-model="number" type="checkbox">789</label>
<label><input v-model="symbol" type="checkbox">+^;</label>
</div>
<div class="charsets-container">
<label :title="$t('type_aep_title')"><input v-model="type_aep" type="checkbox">{{ $t("type_aep_label") }}</label>
</div>

<!-- Charset checkboxes are aggregated into a single hidden input to simplify validation -->
<validated-input v-model="charsets" :error.sync="charsetsError" :visible="false" @validate="validateCharsets" />
Expand Down Expand Up @@ -98,6 +101,7 @@ export default {
upper: getProp("upper", true),
number: getProp("number", true),
symbol: getProp("symbol", true),
type_aep: getProp("type_aep", false),
charsets: "",
charsetsError: null,
keepNotes: !!this.password
Expand Down Expand Up @@ -148,6 +152,7 @@ export default {
upper: this.upper,
number: this.number,
symbol: this.symbol,
type_aep: this.type_aep,
notes: this.keepNotes ? this.password.notes : null
}, this.options.replacing).then(pwdList =>
{
Expand Down
4 changes: 2 additions & 2 deletions ui/panel/components/PasswordEntry.vue
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ export default {
{
let tooltip = "";
let password = this.password;
if (password.type == "generated2")
if (password.type.indexOf("generated") == 0)
{
tooltip = this.$t("password_type_generated2");
tooltip = this.$t("password_type_" + password.type);
tooltip += "\n" + this.$t("password_length");
tooltip += " " + password.length;
Expand Down

0 comments on commit cccdea8

Please sign in to comment.