marcwebbie / passpie

:closed_lock_with_key: Multiplatform command-line password manager
http://passpie.readthedocs.org/
MIT License
921 stars 68 forks source link

Support multiple password generation configuration #80

Closed Aluriak closed 8 years ago

Aluriak commented 8 years ago

Some websites don't allow some characters, or, worst case, just allow a range of characters. Moreover, many websites don't allow too long passwords.

Is it possible to have, with the random password generation, an option for choose a method of generation ? Without this feature (or an equivalent), i can't manage all credentials i need to.

Just for be sure i'm clear, there is how it may looks in the .passpierc:

genpass_default:
  length: 32
  symbols: "_–#|+= "
genpass_simple:  # only numbers and lowercase, with a max size of 8
  length: 8
  symbols: ""
  uppercase: false
genpass_numbers:  # only numbers
  symbols: ""
  uppercase: false
  lowercase: false

And, for the generation:

 passpie add foo@badsecurity.com --random=simple
 passpie add bar@badsecurity.com --random=numbers
 passpie add doe@noproblem.com --random  # use the default/first in .rc

I read the README and some sources, but i can't find any option that implement that feature.

marcwebbie commented 8 years ago

Hello @Aluriak looks like an interesting feature but it would break the way that --random is implemented today. Thanks for adding this suggestion.

What about other name for this flag? and using a regular expression, like: --random-pattern="[0-9]"

Aluriak commented 8 years ago

Hi @marcwebbie, and thanks for the reply ! I really don't have preferences about the end-user API ; it was just an exemple.

Using regular expression is absolutely awesome ! It removes the need of any configuration in .passpierc, and is a lot more flexible.

marcwebbie commented 8 years ago

Hello @Aluriak

Take a look at development version of passpie.

pip install -U https://github.com/marcwebbie/passpie/tarball/master

Now you can generate passwords with patterns as with:

# Add credential with random password 
# using pattern: 5 lowercase letters, 5 uppercase letters, 5 digits
passpie add foo@bar --random --pattern "[a-z]{5}[A-Z]{5}[0-9]{5}"

Thanks for your contribution

Aluriak commented 8 years ago

Awesome ! Thank you :)