https://github.com/buffrr/hsig0
Go library to validate DNS messages using Handshake sig0. You can use it to resolve names over the handshake network and verify them using the node's public key.
https://github.com/buffrr/hsig0
Last synced: 4 months ago
JSON representation
Go library to validate DNS messages using Handshake sig0. You can use it to resolve names over the handshake network and verify them using the node's public key.
- Host: GitHub
- URL: https://github.com/buffrr/hsig0
- Owner: buffrr
- License: mit
- Created: 2020-09-28T22:33:29.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-09-28T22:35:51.000Z (over 5 years ago)
- Last Synced: 2025-10-11T11:58:03.455Z (8 months ago)
- Language: Go
- Size: 4.88 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# HSig0
Go library to validate dns messages using Handshake sig0. You can use it to resolve names over the handshake network and verify them using the node's public key.
## Usage
~~~Go
package main
import (
"fmt"
"github.com/buffrr/hsig0"
"github.com/miekg/dns"
"log"
)
func main() {
k, err := hsig0.ParsePublicKey("aj7bjss4ae6hd3kdxzl4f6klirzla377uifxu5mnzczzk2v7p76ek")
if err != nil {
log.Fatal(err)
}
// basic dns query
client := new(dns.Client)
query := new(dns.Msg)
query.SetQuestion("proofofconcept.", dns.TypeA)
msg, _, err := client.Exchange(query, "192.168.1.21:8181") // node ip:port
if err != nil {
log.Fatal(err)
}
if err := hsig0.Verify(msg, k) ; err != nil {
log.Fatal(err)
}
fmt.Println("Success ✔️")
fmt.Println(msg)
}
~~~
## Other languages
* Javascript: https://github.com/handshake-org/hdns
* C: https://github.com/handshake-org/libhns
## License
MIT