# derivepassphrase
[](https://pypi.org/project/derivepassphrase)
[](https://pypi.org/project/derivepassphrase)
An almost faithful Python reimplementation of [James Coglan's `vault`][VAULT], a deterministic password manager/generator.
Using a master passphrase or a master SSH key, derive a passphrase for a given named service, subject to length, character and character repetition constraints.
The derivation is *strong*: derived passphrases have as much entropy as permitted by the master passphrase and the passphrase constraints (whichever is more restrictive), and even if multiple derived passphrases are compromised, the master passphrase remains cryptographically difficult to discern from these compromised passphrases.
The derivation is also *deterministic*, given the same inputs, thus the resulting passphrase need not be stored explicitly.
The service name and constraints themselves also need not be kept secret; the latter are usually stored in a world-readable file to ease repeated entry of passphrase constraints.
[VAULT]: https://www.npmjs.com/package/vault
-----
## Installation
`derivepassphrase` is a pure Python package, and may be easily installed with any `pip`-compatible Python package manager such as `pip`, `pipx`, or `uv`.
(`pip` is distributed with Python·3 by default.)
`derivepassphrase` requires Python·3.9 or higher as well as the [typing-extensions package][TYPING_EXTENSIONS] for its core functionality and programmatic interface, and [`click`][CLICK]·8.1 or higher for its command-line interface.
On Python 3.9 and 3.10 only, `derivepassphrase` additionally requires the [tomli package][TOMLI].
The installer should take care of installing these dependencies automatically for you.
Using the `export vault` subcommand additionally requires the [cryptography package][CRYPTOGRAPHY], version 38.0 or newer.
This must be separately requested at installation, via the `export` extra.
<div class="grid cards" markdown>
* **pipx**
Use `pipx install derivepassphrase` in general, or `pipx install "derivepassphrase[export]"` with the `export` extra.
* **uv**
Use `uv tool install derivepassphrase` in general, or `uv tool install "derivepassphrase[export]"` with the `export` extra.
* **pip**
First, manually create a [virtual environment][VENV] and activate it.
Then use `pip install derivepassphrase` in general, or `pip install "derivepassphrase[export]"` with the `export` extra.
</div>
`derivepassphrase` runs just fine on PyPy.
`derivepassphrase` *probably* also runs just fine on GraalPy, but this is untested.
(Feedback wanted!)
[TYPING_EXTENSIONS]: https://pypi.org/project/typing-extensions/