initial commit
This commit is contained in:
commit
21df5e97a4
19
main.go
Normal file
19
main.go
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
// Generate key pair for onion service auth
|
||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"crypto/ecdh"
|
||||||
|
"crypto/rand"
|
||||||
|
"encoding/base32"
|
||||||
|
"fmt"
|
||||||
|
)
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
|
||||||
|
key, err := ecdh.X25519().GenerateKey(rand.Reader)
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
fmt.Printf("private key : %s\n", base32.StdEncoding.EncodeToString(key.Bytes())[:52])
|
||||||
|
fmt.Printf("public descriptor : descriptor:x25519:%s\n", base32.StdEncoding.EncodeToString(key.PublicKey().Bytes())[:52])
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user