session

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2023 License: Unlicense Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MagicString = "ss"
	Len         = magicbytes.Len + nonce.IDLen + pub.KeyLen*2
)

Variables

View Source
var (
	Magic = slice.Bytes(MagicString)
)

Functions

This section is empty.

Types

type OnionSkin

type OnionSkin struct {
	nonce.ID
	HeaderKey, PayloadKey *pub.Key
	types.Onion
}

OnionSkin session is a message containing two public keys which identify to a relay how to decrypt the header in a Reverse message, using the HeaderKey, and the payload, which uses the PayloadKey. There is two keys in order to prevent the Exit node from being able to decrypt the header, but enable it to encrypt the payload, and Reverse relay hops have these key pairs and identify the HeaderKey and then know they can unwrap their layer of the payload using the PayloadKey.

Clients use the HeaderKey, cloaked, in their messages for the seller relay, in the header, and use the PayloadKey as the public key half with ECDH and their generated private key which produces the public key that is placed in the header associated with the payload, using the same nonce.IV as well.

func (*OnionSkin) Decode

func (x *OnionSkin) Decode(b slice.Bytes, c *slice.Cursor) (e error)

func (*OnionSkin) Encode

func (x *OnionSkin) Encode(b slice.Bytes, c *slice.Cursor)

func (*OnionSkin) Inner

func (x *OnionSkin) Inner() types.Onion

func (*OnionSkin) Insert

func (x *OnionSkin) Insert(o types.Onion)

func (*OnionSkin) Len

func (x *OnionSkin) Len() int

Jump to

Keyboard shortcuts

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