File: README.md

package info (click to toggle)
pwdsphinx 2.0.4-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 832 kB
  • sloc: python: 3,807; javascript: 1,001; sh: 238; makefile: 74
file content (188 lines) | stat: -rw-r--r-- 8,069 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
<!--
SPDX-FileCopyrightText: 2018, Marsiske Stefan

SPDX-License-Identifier: CC-BY-SA-4.0
-->

# SPHINX: A Password **S**tore that **P**erfectly **H**ides from **I**tself (**N**o **X**aggeration)

SPHINX is a cryptographic password storage protocol that provides information-theoretic security. pwdsphinx is a Python wrapper around [liboprf](https://github.com/stef/liboprf) - a cryptographic password storage
as described in https://eprint.iacr.org/2015/1099.

Unlike traditional password managers, SPHINX only stores random numbers unrelated to your actual passwords, ensuring the server learns nothing about them.

**Key Features:**

- 🔒 **Information-theoretic security**: Mathematically proven protection
- 🌐 **Zero-trust architecture**: Server knows nothing about your passwords  
- 🚫 **Offline bruteforce resistance**: Your passwords are safe even if the server is compromised
- 🏠 **Self-hostable**: Run your own server or use someone else's
- 📱 **Cross-platform**: CLI, browser extensions, Android app, and X11 integration
- 🔑 **Password generation**: Creates strong passwords according to site requirements

## Also on Radicle

To clone this repo on [Radicle](https://radicle.xyz):

```bash
rad clone rad:z3rjK2hk7ckb1thexdsuyaM7e4FwS
```

## Dependencies

### Required Dependencies

- **[liboprf](https://github.com/stef/liboprf)**: An Oblivious Pseudo-Random Function (OPRF) is a cryptographic protocol where a client can evaluate a pseudo-random function on their input using a key held by a server, without the server learning the client's input or the function's output. liboprf implements OPRFs, which is used to enables SPHINX's zero-knowledge password storage.
- **[libequihash](https://github.com/stef/equihash/)**: This provides rate limiting proof-of-work with fast verification
- **pysodium** and **pyoprf**: Python cryptographic bindings. Both can be installed using either
your OS package manager or pip.

### Optional Dependencies

**For browser extensions:**
If you also want to use the websphinx browser extension, you
also need to install an X11 variant of pinentry from the GnuPG project.

```bash
# Install any one of these, using the equivalent of `apt-get` on your operating system:
apt-get install pinentry-qt        # For KDE/Qt environments
apt-get install pinentry-gtk2      # For older GNOME/GTK environments
apt-get install pinentry-gnome3    # For modern GNOME environments
apt-get install pinentry-fltk      # Lightweight option
```

**For X11 integration:**

- **xdotool**: Keyboard/mouse automation
- **xinput**: Input device control  
- **dmenu**: Interactive menus

**For extended storage:**
If you want to store other "secrets" that are longer than just 77 chars, you
can install OPAQUE-Store:

- **[opaque-store](https://github.com/stef/opaque-store/)**:  Encrypted file storage: `pip3 install opaquestore`
- **[OPAQUE-Store](https://github.com/stef/libopaque)**:  OPAQUE protocol implementation, a dependency for OPAQUE-Store above.

## Installation

```bash
pip3 install pwdsphinx
```

On Debian-based systems, you can also do:

```bash
sudo apt install pwdsphinx
```

## Architecture

SPHINX uses a client-server architecture where:

### Server (Oracle)

The server stores only cryptographic blobs that are useless without your master password. Even if compromised, your actual passwords remain secure.

**Host your own server:** See [`oracle(1)`](man/oracle.md) or the [Server Installation Guide](GettingStarted.md#hosting-your-own-oracle) for how to configure your server.

### Client

The client combines your master password with the server's response to regenerate your actual passwords deterministically.

**Supported platforms:**

- **Command Line:** Full-featured CLI client (see [`sphinx(1)`](man/sphinx.md) for how to configure a client)
- **Browser:** [Firefox and Chromium extensions](./GettingStarted.md#setting-up-browser-extensions) with native messaging
- **Desktop:** [X11 integration scripts](./contrib/README.md) for form filling
- **Mobile:** Android app ([androsphinx](https://github.com/dnet/androsphinx))

## Usage

SPHINX provides a complete lifecycle for password management:

### Core Operations

- **`create`**: Generate new password for a site
- **`get`**: Retrieve existing password  
- **`change`**: Update password (two-phase commit)
- **`commit`**: Activate changed password
- **`undo`**: Revert to previous password
- **`delete`**: Remove password record
- **`list`**: Show usernames for a site

### Management Operations  

- **`init`**: Initialize client with new master key. It also sets up browser extensions if `~/.mozilla` or `~/.config/chromium` directories are found.
- **`healthcheck`**: Test server connectivity
- **`qr`**: Export configuration as QR code

See [`sphinx(1)`](man/sphinx.md) for detailed command syntax and examples.

## OPAQUE-Store Client Integration

If you have OPAQUE-Store installed and configured correctly, you get a number of
additional operations, which allow you to store traditionally encrypted blobs
of information. For a gentle introduction on how this works using the OPAQUE protocol, have a look at this post: https://www.ctrlc.hu/~stef/blog/posts/How_to_recover_static_secrets_using_OPAQUE.html

The following operations will be available if OPAQUE-Store is setup correctly:

```sh
echo -n 'password' | sphinx store <keyid> file-to-store
echo -n 'password' | sphinx read <keyid>
echo -n 'password' | sphinx replace [force] <keyid> file-to-store
echo -n 'password' | sphinx edit [force] <keyid>
echo -n 'password' | sphinx changepwd [force] <keyid>
echo -n 'password' | sphinx erase [force] <keyid>
echo -n 'password' | sphinx recovery-tokens <keyid>
echo -n 'password' | sphinx unlock <keyid> <recovery-token>
```

See the [OPAQUE-Store X11 integration](https://sphinx.pm/opaque-store_integration.html) documentation for more details on these operations and how the integration
works with SPHINX.  

## Browser Integration

There is WebSphinx, our browser extension that provides
seamless password filling. See the [browser extension instructions](./GettingStarted.md#Setting-Up-Browser-Extensions) on how to set it up
on Firefox and Chrome/Chromium browsers

## X11 Desktop Integration

SPHINX includes shell scripts for X11 desktop integration using `dmenu`, `xdotool`, `xinput`, and `pinentry`.

The main script [`dmenu-sphinx.sh`](./contrib/dmenu-sphinx) provides interactive password filling with a dmenu interface. It stores hostname history in `~/.sphinx-hosts` (link to `/dev/null` if you consider this sensitive).

The integration enables automatic form filling in X11 applications through keyboard automation for password entry. It works with pinentry for secure password input.

See [`contrib/README.md`](contrib/README.md) for setup examples and script combinations.

## More documentation

### For Users

- **[Getting Started Guide](GettingStarted.md)**: Complete setup and usage tutorial
- **[Manual Pages](man/)**: Detailed command reference
  - [`sphinx(1)`](man/sphinx.md): Main client commands
  - [`oracle(1)`](man/oracle.md): Server configuration and management  
  - [`getpwd(1)`](man/getpwd.md): Secure password input utility

### For Developers & Advanced Users

- **[X11 Integration](https://sphinx.pm/x11-integration.html)**: Desktop automation scripts
- **[OPAQUE-Store Integration](https://sphinx.pm/opaque-store_integration.html)**: Encrypted file storage
- **[Contributing Scripts](contrib/README.md)**: Helper utilities and examples

## Credits

This project was funded through the NGI0 PET Fund, a fund established
by NLnet with financial support from the European Commission's Next
Generation Internet programme, under the aegis of DG Communications
Networks, Content and Technology under grant agreement No 825310.

This project was funded through the e-Commons Fund, a fund established by NLnet
with financial support from the Netherlands Ministry of the Interior and
Kingdom Relations.

Everlasting gratuity to asciimoo, dnet, jonathan and hugo for their
contributions, patience, and support.