Skip to content

Commit

Permalink
Add README
Browse files Browse the repository at this point in the history
  • Loading branch information
Kangaroux committed Jun 30, 2024
1 parent 80191b1 commit 9cda4dc
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 1 deletion.
34 changes: 34 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[![Go Reference](https://pkg.go.dev/badge/github.com/kangaroux/go-wow-srp6.svg)](https://pkg.go.dev/github.com/kangaroux/go-wow-srp6)

This library implements the SRP6 protocol used in World of Warcraft.

```
go get github.com/kangaroux/go-wow-srp6
```

Check out the [gomaggus](https://github.com/Kangaroux/gomaggus) authd server for a reference on how this library is used (sorry, but it's 2AM and I'm too tired to write up a full example, unlucky).

## SRP6 Overview

> The [Gtker guide](https://gtker.com/implementation-guide-for-the-world-of-warcraft-flavor-of-srp6/#srp6-overview) provides an approachable and comprehensive look at SRP6. This library is heavily based on this guide.
SRP6 is a protocol used to authenticate users over an insecure connection.
The client and server do a series of handshakes to prove to each other that
they know the user's password. At the end of the exchange, both parties will have
a shared session key.

Prior to login, the user registers an account. The server stores the username,
salt, and password verifier.

At the login screen, after the user has entered their username and password,
the handshaking begins:

1. Client sends the username (challenge).
2. Server responds with the salt, the server's public key, and some parameters (challenge reply).
- [gomaggus](https://github.com/Kangaroux/gomaggus/blob/fb845ea23e35ba9186a61a0865460fefdb6e5aa4/authd/handler/loginchallenge.go#L80) generates a fake salt if the username doesn't exist to protect against data mining, though this isn't necessary.
3. Client computes a proof and sends it (proof).
4. Server computes the same proof and compares it.
- Proofs match: auth success, the client/server now have a shared session key.
- Proofs don't match: auth failed, the client is kicked.

The session key is primarily used by the realm server for encryption (`realmd` in gomaggus, `worldd` in most other implementations). When the client connects to the realm server, they must once again prove they know the session key.
2 changes: 1 addition & 1 deletion srp.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Package srp implements the SRP6 variant used in World of Warcraft.
// Package srp implements the SRP6 protocol used in World of Warcraft.
//
// See the README for more info: https://github.com/kangaroux/go-wow-srp6
package srp
Expand Down

0 comments on commit 9cda4dc

Please sign in to comment.