2026-07-01 11:52:12 +02:00
|
|
|
## The OPAQUE key exchange protocol
|
2020-06-05 09:35:14 -07:00
|
|
|
|
2026-07-01 11:52:12 +02:00
|
|
|
[OPAQUE](https://eprint.iacr.org/2018/163.pdf) is an augmented password-authenticated key exchange protocol. It allows a
|
|
|
|
|
client to authenticate to a server using a password, without ever having to expose the plaintext password to the server.
|
2020-06-05 09:35:14 -07:00
|
|
|
|
2025-09-08 11:27:47 -07:00
|
|
|
This implementation is based on [RFC 9807](https://datatracker.ietf.org/doc/rfc9807/).
|
2020-06-05 09:35:14 -07:00
|
|
|
|
2026-07-01 11:52:12 +02:00
|
|
|
This is a fork of [facebook/opaque-ke](https://github.com/facebook/opaque-ke) maintained
|
|
|
|
|
by [VexaHub](https://github.com/vexahub), targeting the latest **RustCrypto ecosystem**.
|
|
|
|
|
|
2020-06-05 09:35:14 -07:00
|
|
|
Background
|
|
|
|
|
----------
|
|
|
|
|
|
2026-07-01 11:52:12 +02:00
|
|
|
Augmented Password Authenticated Key Exchange (aPAKE) protocols are designed to provide password authentication and
|
|
|
|
|
mutually authenticated key exchange without relying on PKI (except during user/password registration) and without
|
|
|
|
|
disclosing passwords to servers or other entities other than the client machine.
|
2020-06-05 09:35:14 -07:00
|
|
|
|
|
|
|
|
OPAQUE is a PKI-free aPAKE that is secure against pre-computation attacks and capable of using a secret salt.
|
|
|
|
|
|
|
|
|
|
Documentation
|
|
|
|
|
-------------
|
|
|
|
|
|
2026-07-02 23:21:28 +02:00
|
|
|
The API can be found [here](https://docs.rs/opaque-vx/) along with an example for usage. More examples can be found
|
2026-07-01 11:52:12 +02:00
|
|
|
in
|
|
|
|
|
the [examples](./examples) directory.
|
2020-06-05 09:35:14 -07:00
|
|
|
|
|
|
|
|
Installation
|
|
|
|
|
------------
|
|
|
|
|
|
|
|
|
|
Add the following line to the dependencies of your `Cargo.toml`:
|
|
|
|
|
|
|
|
|
|
```
|
2026-07-03 13:06:30 +02:00
|
|
|
opaque-vx = "1.0.0-rc.0"
|
2020-06-05 09:35:14 -07:00
|
|
|
```
|
|
|
|
|
|
2021-07-31 00:36:57 +02:00
|
|
|
### Minimum Supported Rust Version
|
|
|
|
|
|
2026-07-02 08:19:22 +02:00
|
|
|
Rust **1.90** or higher.
|
2021-07-31 00:36:57 +02:00
|
|
|
|
2021-12-13 15:29:06 -08:00
|
|
|
Audit
|
|
|
|
|
-----
|
|
|
|
|
|
2026-07-01 11:52:12 +02:00
|
|
|
This library was audited by NCC Group in June of 2021. The audit was sponsored by WhatsApp for its use
|
|
|
|
|
in [enabling end-to-end encrypted backups](https://engineering.fb.com/2021/09/10/security/whatsapp-e2ee-backups/).
|
2021-12-13 15:29:06 -08:00
|
|
|
|
2026-07-01 11:52:12 +02:00
|
|
|
The audit found issues in release `v0.5.0`, and the fixes were subsequently incorporated into release `v1.2.0`. See
|
|
|
|
|
the [full audit report here](https://research.nccgroup.com/2021/12/13/public-report-whatsapp-opaque-ke-cryptographic-implementation-review/).
|
2021-12-13 15:29:06 -08:00
|
|
|
|
2020-06-05 09:35:14 -07:00
|
|
|
Resources
|
|
|
|
|
---------
|
|
|
|
|
|
2026-07-01 11:52:12 +02:00
|
|
|
- [OPAQUE academic publication](https://eprint.iacr.org/2018/163.pdf), including formal definitions and a proof of
|
|
|
|
|
security
|
2025-09-08 11:27:47 -07:00
|
|
|
- [RFC 9807](https://datatracker.ietf.org/doc/rfc9807/), containing a detailed (byte-level) specification for OPAQUE
|
2026-07-01 11:52:12 +02:00
|
|
|
- ["Let's talk about PAKE"](https://blog.cryptographyengineering.com/2018/10/19/lets-talk-about-pake/), an introductory
|
|
|
|
|
blog post written by Matthew Green that covers OPAQUE
|
2023-07-16 05:44:47 +02:00
|
|
|
- [@serenity-kit/opaque](https://github.com/serenity-kit/opaque), a WebAssembly package for this library
|
2026-07-01 11:52:12 +02:00
|
|
|
- [opaque-wasm](https://github.com/marucjmar/opaque-wasm), a WebAssembly package for this library. A comparison between
|
|
|
|
|
`@serenity-kit/opaque` and `opaque-wasm` can be
|
|
|
|
|
found [here](https://opaque-documentation.netlify.app/docs/faq#how-does-it-compare-to-opaque-wasm)
|
|
|
|
|
- [react-native-opaque](https://github.com/serenity-kit/react-native-opaque), a React Native package for this library
|
|
|
|
|
matching the API of `@serenity-kit/opaque`
|
2020-06-05 09:35:14 -07:00
|
|
|
|
|
|
|
|
Contributors
|
|
|
|
|
------------
|
|
|
|
|
|
2026-07-01 11:52:12 +02:00
|
|
|
This fork is maintained by [VexaHub](https://github.com/vexahub).
|
|
|
|
|
|
|
|
|
|
The original authors are Kevin Lewi ([@kevinlewi](https://github.com/kevinlewi)) and François
|
|
|
|
|
Garillot ([@huitseeker](https://github.com/huitseeker)).
|
2020-06-05 09:35:14 -07:00
|
|
|
To learn more about contributing to this project, [see this document](./CONTRIBUTING.md).
|
|
|
|
|
|
|
|
|
|
#### Acknowledgments
|
|
|
|
|
|
2026-07-01 11:52:12 +02:00
|
|
|
Special thanks go to Hugo Krawczyk and Chris Wood for helping to clarify discrepancies and making suggestions for
|
|
|
|
|
improving
|
|
|
|
|
this implementation. Additional credit goes to @daxpedda for adding no_std support, p256 support, and making other
|
|
|
|
|
general
|
2021-09-25 16:36:00 -07:00
|
|
|
improvements to the library.
|
2020-06-05 09:35:14 -07:00
|
|
|
|
|
|
|
|
License
|
|
|
|
|
-------
|
|
|
|
|
|
2023-05-22 23:04:26 -07:00
|
|
|
This project is dual-licensed under either the [MIT license](./LICENSE-MIT)
|
|
|
|
|
or the [Apache License, Version 2.0](./LICENSE-APACHE).
|
|
|
|
|
You may select, at your option, one of the above-listed licenses.
|