pwman-python


Namepwman-python JSON
Version 2.10 PyPI version JSON
download
home_pagehttps://bues.ch/h/pwman
SummaryCommandline password manager
upload_time2023-05-13 15:33:47
maintainer
docs_urlNone
authorMichael Büsch
requires_python>=3.7
license
keywords password manager command line totp 2fa
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            pwman - Commandline password manager
====================================

`Homepage <https://bues.ch/h/pwman>`_

`Git repository <https://bues.ch/cgit/pwman.git>`_

`Github repository <https://github.com/mbuesch/pwman>`_

pwman is a commandline based password manager. It encrypts the password database file using strong AES-256 encryption.

pwman has support for the following things:

* Store arbitrary attributes and text data along with the passwords and login credentials.
* Generate two factor authentication tokens (`TOTP <https://en.wikipedia.org/wiki/Time-based_One-time_Password_algorithm>`_).
* Database search with Regular Expressions or SQL LIKE syntax.
* Database compare (diff). In pwman prompt, at pwman command line and as `git diff` extension.
* Shell-style Tab-completion for all commands.
* Custom Python scripts for arbitrary database processing.
* Export of the complete database as SQL text dump, CSV dump and human readable plain text dump.

Algorithms
==========

+--------------------------------+--------------------------------------------+
| Encryption algorithm:          | AES in CBC mode with 256 bit key.          |
+--------------------------------+--------------------------------------------+
| Key derivation function (KDF): | Argon2id with 24 MiB memory cost           |
|                                | or more (see environment variables below). |
+--------------------------------+--------------------------------------------+

Install pwman
=============

pwman does not have to be installed. The `pwman` script can be run directly from the source tree.
It is not recommended to install pwman into the operating system.

Installing pwman into a virtualenv
----------------------------------

If you want to install pwman into a Python virtualenv, run the following commands to create a new venv and install pwman from `PyPi <https://pypi.org/>`_:

.. code:: sh

	python3 -m venv --system-site-packages ./pwman-venv
	. ./pwman-venv/bin/activate
	pip3 install -U pwman-python

Run pwman
=========

Just run the `pwman` executable to start pwman.

Type `pwman -h` for help about the command line options.

pwman prompt
============

If started without options, pwman enters the command prompt:

.. code::

	pwman$

Type the command `help` and press enter to see help about all possible commands.

Command help
============

To get help about a specific command, enter the command into the prompt and append a question mark without spaces in between:

.. code::

	pwman$ find?

Using a custom script to process the database content
=====================================================

A custom Python script can be passed to `pwman` as command line option. Such a script can do anything to the content of the database.

Please see the example script `examplescript.py` for more information.

API documentation
=================

The API documentation can be found in the `API documentation directory <doc/api/>`_.

Crypto backends
===============

Pwman uses either `Cryptodome <https://pypi.org/project/pycryptodomex/>`_ or `pyaes <https://pypi.org/project/pyaes/>`_ for AES encryption.
Therefore, either one of these Python modules has to be installed.
Pwman first tries to use Cryptodome and then falls back to pyaes, if Cryptodome is not installed.

For key derivation either `argon2-cffi <https://pypi.org/project/argon2-cffi/>`_ or `argon2pure <https://pypi.org/project/argon2pure/>`_ can be used.
Preferably `argon2-cffi` shall be installed.
As an option `argon2pure` is supported.
`argon2pure` is a pure Python implementation of the algorithm and it is *extremely* slow.
Therefore, it will never be selected automatically.
See environment variables.

Environment variables
=====================

Environment variables that affect pwman operation are:

+----------------------+--------------------------------------------+------------------------------+----------------+
| Environment variable | Description                                | Possible values              | Default        |
+======================+============================================+==============================+================+
| PWMAN_CRYPTOLIB      | Select the crypto backend                  | "cryptodome", "pyaes"        | probe in order |
+----------------------+--------------------------------------------+------------------------------+----------------+
| PWMAN_ARGON2LIB      | Select the Argon2 backend                  | "argon2-cffi", "argon2pure"  | "argon2-cffi"  |
+----------------------+--------------------------------------------+------------------------------+----------------+
| PWMAN_ARGON2MEM      | Set the amount of memory (in KiB) used     | Number of KiB,               | 24584          |
|                      | for key derivation.                        | but not less than 24584.     |                |
|                      | Increasing this value improves security,   |                              |                |
|                      | but it also increases the amount of memory |                              |                |
|                      | required during encryption and decryption. |                              |                |
+----------------------+--------------------------------------------+------------------------------+----------------+
| PWMAN_ARGON2TIME     | Set the time used for key derivation.      | Number of iterations,        | 163            |
|                      | Increasing this value improves security,   | but not less than 2          |                |
|                      | but it also increases the time required    | and not less than            |                |
|                      | for encryption and decryption.             | 2500000 / PWMAN_ARGON2MEM.   |                |
+----------------------+--------------------------------------------+------------------------------+----------------+
| PWMAN_DATABASE       | Path to the default database               | any file path                | ~/.pwman.db    |
+----------------------+--------------------------------------------+------------------------------+----------------+
| PWMAN_RAWGETPASS     | If true, do not use safe master            | boolean                      | false          |
|                      | password input. Read directly              | (0, 1, true, false, yes, no) |                |
|                      | from stdin instead.                        |                              |                |
+----------------------+--------------------------------------------+------------------------------+----------------+

You probably don't need to set any environment variable to use pwman.
The default values are most likely what you want.

Out of memory errors
====================

Pwman uses a strong and memory hard algorithm (Argon2id) to derive the master encryption key from the user supplied master passphrase.
This algorithm uses lots of memory (and time) to make brute forcing the key expensive.
This significantly improves security, if the master passphrase has less entropy than the raw AES-256 key.

Pwman also locks all memory to RAM, so that no secrets and keys are written to swap disk space.
Therefore, pwman might crash if the actual memory usage during key derivation exceeds the system's memory lock limit.

To increase the locked memory available to applications, please increase the OS limits by installing a raised limit as follows:

.. code:: sh

	# as root:
	cp pwman-memlock-limits.conf /etc/security/limits.d/
	reboot

Swap partition
==============

Pwman locks all memory to ensure that no secrets are copied from RAM to possibly unencrypted swap disk space.

However, pwman can only lock its own memory.
It cannot lock memory owned by the window manager, X11, Wayland, the terminal emulator or anything else.
Therefore, it is *strongly* recommended to avoid using unencrypted swap disk space when using pwman.
If you have unencrypted swap space it is possible that (parts of) the database or the master passphrase end up being written to it.

Therefore, please use encrypted swap space, if you need swap space.
If you do not need swap space, please disable swap entirely.

Do *not* use unencrypted swap space.

Pwman currently only locks memory on Linux and Android platforms.
If pwman is unable to lock memory, it will print a warning message and give you a chance to abort.

License / Copyright
===================

Copyright (c) 2011-2023 Michael Büsch <m@bues.ch>

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

            

Raw data

            {
    "_id": null,
    "home_page": "https://bues.ch/h/pwman",
    "name": "pwman-python",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "password manager command line TOTP 2FA",
    "author": "Michael B\u00fcsch",
    "author_email": "m@bues.ch",
    "download_url": "https://files.pythonhosted.org/packages/bc/66/dbb1b6a14505bd4ee1f1f1d2e331c2e4b8c9d5e9c62e586e22c9326aa2fc/pwman-python-2.10.tar.gz",
    "platform": null,
    "description": "pwman - Commandline password manager\n====================================\n\n`Homepage <https://bues.ch/h/pwman>`_\n\n`Git repository <https://bues.ch/cgit/pwman.git>`_\n\n`Github repository <https://github.com/mbuesch/pwman>`_\n\npwman is a commandline based password manager. It encrypts the password database file using strong AES-256 encryption.\n\npwman has support for the following things:\n\n* Store arbitrary attributes and text data along with the passwords and login credentials.\n* Generate two factor authentication tokens (`TOTP <https://en.wikipedia.org/wiki/Time-based_One-time_Password_algorithm>`_).\n* Database search with Regular Expressions or SQL LIKE syntax.\n* Database compare (diff). In pwman prompt, at pwman command line and as `git diff` extension.\n* Shell-style Tab-completion for all commands.\n* Custom Python scripts for arbitrary database processing.\n* Export of the complete database as SQL text dump, CSV dump and human readable plain text dump.\n\nAlgorithms\n==========\n\n+--------------------------------+--------------------------------------------+\n| Encryption algorithm:          | AES in CBC mode with 256 bit key.          |\n+--------------------------------+--------------------------------------------+\n| Key derivation function (KDF): | Argon2id with 24 MiB memory cost           |\n|                                | or more (see environment variables below). |\n+--------------------------------+--------------------------------------------+\n\nInstall pwman\n=============\n\npwman does not have to be installed. The `pwman` script can be run directly from the source tree.\nIt is not recommended to install pwman into the operating system.\n\nInstalling pwman into a virtualenv\n----------------------------------\n\nIf you want to install pwman into a Python virtualenv, run the following commands to create a new venv and install pwman from `PyPi <https://pypi.org/>`_:\n\n.. code:: sh\n\n\tpython3 -m venv --system-site-packages ./pwman-venv\n\t. ./pwman-venv/bin/activate\n\tpip3 install -U pwman-python\n\nRun pwman\n=========\n\nJust run the `pwman` executable to start pwman.\n\nType `pwman -h` for help about the command line options.\n\npwman prompt\n============\n\nIf started without options, pwman enters the command prompt:\n\n.. code::\n\n\tpwman$\n\nType the command `help` and press enter to see help about all possible commands.\n\nCommand help\n============\n\nTo get help about a specific command, enter the command into the prompt and append a question mark without spaces in between:\n\n.. code::\n\n\tpwman$ find?\n\nUsing a custom script to process the database content\n=====================================================\n\nA custom Python script can be passed to `pwman` as command line option. Such a script can do anything to the content of the database.\n\nPlease see the example script `examplescript.py` for more information.\n\nAPI documentation\n=================\n\nThe API documentation can be found in the `API documentation directory <doc/api/>`_.\n\nCrypto backends\n===============\n\nPwman uses either `Cryptodome <https://pypi.org/project/pycryptodomex/>`_ or `pyaes <https://pypi.org/project/pyaes/>`_ for AES encryption.\nTherefore, either one of these Python modules has to be installed.\nPwman first tries to use Cryptodome and then falls back to pyaes, if Cryptodome is not installed.\n\nFor key derivation either `argon2-cffi <https://pypi.org/project/argon2-cffi/>`_ or `argon2pure <https://pypi.org/project/argon2pure/>`_ can be used.\nPreferably `argon2-cffi` shall be installed.\nAs an option `argon2pure` is supported.\n`argon2pure` is a pure Python implementation of the algorithm and it is *extremely* slow.\nTherefore, it will never be selected automatically.\nSee environment variables.\n\nEnvironment variables\n=====================\n\nEnvironment variables that affect pwman operation are:\n\n+----------------------+--------------------------------------------+------------------------------+----------------+\n| Environment variable | Description                                | Possible values              | Default        |\n+======================+============================================+==============================+================+\n| PWMAN_CRYPTOLIB      | Select the crypto backend                  | \"cryptodome\", \"pyaes\"        | probe in order |\n+----------------------+--------------------------------------------+------------------------------+----------------+\n| PWMAN_ARGON2LIB      | Select the Argon2 backend                  | \"argon2-cffi\", \"argon2pure\"  | \"argon2-cffi\"  |\n+----------------------+--------------------------------------------+------------------------------+----------------+\n| PWMAN_ARGON2MEM      | Set the amount of memory (in KiB) used     | Number of KiB,               | 24584          |\n|                      | for key derivation.                        | but not less than 24584.     |                |\n|                      | Increasing this value improves security,   |                              |                |\n|                      | but it also increases the amount of memory |                              |                |\n|                      | required during encryption and decryption. |                              |                |\n+----------------------+--------------------------------------------+------------------------------+----------------+\n| PWMAN_ARGON2TIME     | Set the time used for key derivation.      | Number of iterations,        | 163            |\n|                      | Increasing this value improves security,   | but not less than 2          |                |\n|                      | but it also increases the time required    | and not less than            |                |\n|                      | for encryption and decryption.             | 2500000 / PWMAN_ARGON2MEM.   |                |\n+----------------------+--------------------------------------------+------------------------------+----------------+\n| PWMAN_DATABASE       | Path to the default database               | any file path                | ~/.pwman.db    |\n+----------------------+--------------------------------------------+------------------------------+----------------+\n| PWMAN_RAWGETPASS     | If true, do not use safe master            | boolean                      | false          |\n|                      | password input. Read directly              | (0, 1, true, false, yes, no) |                |\n|                      | from stdin instead.                        |                              |                |\n+----------------------+--------------------------------------------+------------------------------+----------------+\n\nYou probably don't need to set any environment variable to use pwman.\nThe default values are most likely what you want.\n\nOut of memory errors\n====================\n\nPwman uses a strong and memory hard algorithm (Argon2id) to derive the master encryption key from the user supplied master passphrase.\nThis algorithm uses lots of memory (and time) to make brute forcing the key expensive.\nThis significantly improves security, if the master passphrase has less entropy than the raw AES-256 key.\n\nPwman also locks all memory to RAM, so that no secrets and keys are written to swap disk space.\nTherefore, pwman might crash if the actual memory usage during key derivation exceeds the system's memory lock limit.\n\nTo increase the locked memory available to applications, please increase the OS limits by installing a raised limit as follows:\n\n.. code:: sh\n\n\t# as root:\n\tcp pwman-memlock-limits.conf /etc/security/limits.d/\n\treboot\n\nSwap partition\n==============\n\nPwman locks all memory to ensure that no secrets are copied from RAM to possibly unencrypted swap disk space.\n\nHowever, pwman can only lock its own memory.\nIt cannot lock memory owned by the window manager, X11, Wayland, the terminal emulator or anything else.\nTherefore, it is *strongly* recommended to avoid using unencrypted swap disk space when using pwman.\nIf you have unencrypted swap space it is possible that (parts of) the database or the master passphrase end up being written to it.\n\nTherefore, please use encrypted swap space, if you need swap space.\nIf you do not need swap space, please disable swap entirely.\n\nDo *not* use unencrypted swap space.\n\nPwman currently only locks memory on Linux and Android platforms.\nIf pwman is unable to lock memory, it will print a warning message and give you a chance to abort.\n\nLicense / Copyright\n===================\n\nCopyright (c) 2011-2023 Michael B\u00fcsch <m@bues.ch>\n\nThis program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.\n\nThis program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Commandline password manager",
    "version": "2.10",
    "project_urls": {
        "Homepage": "https://bues.ch/h/pwman"
    },
    "split_keywords": [
        "password",
        "manager",
        "command",
        "line",
        "totp",
        "2fa"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "bc66dbb1b6a14505bd4ee1f1f1d2e331c2e4b8c9d5e9c62e586e22c9326aa2fc",
                "md5": "1b033a16ac1fde5cbe17ee8bf8499fe0",
                "sha256": "7ef0d12a72c11e50435f6974f316fc323999b70358f221878732cf065e0047f5"
            },
            "downloads": -1,
            "filename": "pwman-python-2.10.tar.gz",
            "has_sig": true,
            "md5_digest": "1b033a16ac1fde5cbe17ee8bf8499fe0",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 84059,
            "upload_time": "2023-05-13T15:33:47",
            "upload_time_iso_8601": "2023-05-13T15:33:47.057275Z",
            "url": "https://files.pythonhosted.org/packages/bc/66/dbb1b6a14505bd4ee1f1f1d2e331c2e4b8c9d5e9c62e586e22c9326aa2fc/pwman-python-2.10.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-05-13 15:33:47",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "pwman-python"
}
        
Elapsed time: 0.89871s