sparoid

package module
v0.0.0-...-58594d4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 10, 2026 License: MIT Imports: 16 Imported by: 0

README

SPAroid

Single Packet Authorization client library implementation in Go, only client library is implemented. SPA sends a single encrypted and HMACed UDP package to a server, the server upon receiving it verifies and decrypts it and then executes a command, most often opening the firewall for the client that sent the package. This allows you to employ a reject-all firewall but open the firewall for e.g. SSH access. It's a first line of defence, in the case of 0-day attacks on SSH or similar.

Develop

$ go mod tidy
$ go test
Using modd

Modd is a tool that continuesly monitors a set of files and runs commands on chagnes to those files. The configuration is done in modd.conf

You can install the development tool modd by running

$ go install github.com/cortesi/modd/cmd/modd@latest

After that you should be able to execute the command:

$ modd

Documentation

Index

Constants

View Source
const VERSION = "0.0.1"

VERSION is the current version of the client

Variables

View Source
var ErrKeyLength = fmt.Errorf("key must be 32 bytes")

ErrKeyLength is returned when the key is not 32 bytes

Functions

func Message

func Message(ip net.IP) ([]byte, error)

Message builds a v1 message for the given IP. Format: version(4) + timestamp(8) + nonce(16) + ip(4 or 16) IPv4: 32 bytes, IPv6: 44 bytes. Server distinguishes by length.

Types

type Client

type Client struct {
	IPs []net.IP
	// contains filtered or unexported fields
}

Client is the main struct for the client

func NewClient

func NewClient(key, hmacKey string) (c *Client, err error)

NewClient will return a new client

func (*Client) Auth

func (c *Client) Auth(host string, port int) (err error)

Auth is the main function for the client

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL