File: README.md

package info (click to toggle)
golang-github-protonmail-go-srp 0.0.7%2Bds-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 152 kB
  • sloc: sh: 13; makefile: 2
file content (66 lines) | stat: -rw-r--r-- 1,856 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
# go-srp

## Introduction

Golang implementation of the [SRP protocol](https://datatracker.ietf.org/doc/html/rfc5054), used for authentication of ProtonMail users.

## License

Copyright (c) 2019 Proton Technologies AG

Please see [LICENSE](LICENSE.txt) file for the license.

## Doc 

- [Technical blog post](https://protonmail.com/blog/encrypted_email_authentication/)
- [RFC 5054](https://datatracker.ietf.org/doc/html/rfc5054)

## .NET Wrapper

The `windows` folder contains the wrapper for .net.

## Build for mobile apps

Setup Go Mobile and build/bind the source code:

Go Mobile repo: https://github.com/golang/mobile

Go Mobile wiki: https://github.com/golang/go/wiki/Mobile

1. Install Go: `brew install go`
2. Install Gomobile: `go get -u golang.org/x/mobile/cmd/gomobile`
3. Install Gobind: `go install golang.org/x/mobile/cmd/gobind`
4. Install Android SDK and NDK using Android Studio
5. Set env: `export ANDROID_HOME="/AndroidSDK"` (path to your SDK)
6. Init gomobile: `gomobile init -ndk /AndroidSDK/ndk-bundle/` (path to your NDK)
7. Copy Go module dependencies to the vendor directory: `go mod vendor`
8. Build examples:
   `gomobile build -target=android  #or ios`

   Bind examples:
   `gomobile bind -target ios -o frameworks/name.framework`
   `gomobile bind -target android`

   The bind will create framework for iOS and jar&aar files for Android (x86_64 and ARM).

#### Other notes

If you wish to use `build.sh`, you may need to modify the paths in it.

```go
go mod vendor
```

```bash
./build.sh
```

## Dependencies

[github.com/ProtonMail/bcrypt (fork of github.com/jameskeane/bcrypt)](https://github.com/ProtonMail/bcrypt)

[golang.org/x/mobile](https://golang.org/x/mobile)

[github.com/ProtonMail/go-crypto](https://github.com/ProtonMail/go-crypto)

[github.com/cronokirby/saferith](https://github.com/cronokirby/saferith)