cloak

package
v0.1.10 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2023 License: Unlicense Imports: 5 Imported by: 0

Documentation

Overview

Package cloak provides a cover for the public keys for which a node has a private key that prevents matching the keys between one message and another.

Index

Constants

View Source
const BlindLen = 3
View Source
const HashLen = 5
View Source
const Len = BlindLen + HashLen

Variables

This section is empty.

Functions

func Match

func Match(r PubKey, k pub.Bytes) bool

Match uses the cached public key and the provided blinding factor to match the source public key so the packet address field is only recognisable to the intended recipient.

Types

type Blinder

type Blinder [BlindLen]byte

type Hash

type Hash [HashLen]byte

type PubKey

type PubKey [Len]byte

PubKey is the blinded hash of a public key used to conceal a message public key from attackers.

func Cloak

func Cloak(b Blinder, key pub.Bytes) (c PubKey)

func GetCloak

func GetCloak(s *pub.Key) (c PubKey)

GetCloak returns a value which a receiver with the private key can identify the association of a message with the peer in order to retrieve the private key to generate the message cipher.

The three byte blinding factor concatenated in front of the public key generates the 5 bytes at the end of the PubKey code. In this way the source public key it relates to is hidden to any who don't have this public key, which only the parties know.

func (PubKey) CopyBlinder

func (c PubKey) CopyBlinder() (blinder Blinder)

Jump to

Keyboard shortcuts

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