compromise

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeProof

func MakeProof(seckey string) (string, error)

MakeProof derives the pubkey from seckey and returns a Schnorr signature over the proof message as a hex-encoded string.

func ProofMessage

func ProofMessage(pk string) string

ProofMessage returns the message that should be signed by the secret key to prove the compromise of the given pubkey.

Types

type Confirmed

type Confirmed struct {
	DetectedAt *int64 `json:"detected_at,omitempty"`
	Proof      string `json:"proof"`
}

Confirmed is a compromise result backed by a cryptographic proof. The proof is a Schnorr signature over "this-key-was-compromised-<pubkey>", produced with the compromised private key. Call [Confirmed.Verify] to check it.

func (Confirmed) MarshalJSON

func (c Confirmed) MarshalJSON() ([]byte, error)

func (Confirmed) Validate

func (c Confirmed) Validate(pubkey string) error

Validate checks the Proof against the given pubkey. Returns nil if the proof is a valid Schnorr signature over the expected message.

type Result

type Result interface {
	// contains filtered or unexported methods
}

Result is the interface implemented by all compromise results. A Result is either a Confirmed or a Suspected value.

type Suspected

type Suspected struct {
	DetectedAt *int64  `json:"detected_at,omitempty"`
	Confidence float64 `json:"confidence"`
}

Suspected is a compromise result inferred from heuristic signals. It carries no cryptographic proof; clients should treat it as advisory.

func (Suspected) MarshalJSON

func (s Suspected) MarshalJSON() ([]byte, error)

func (Suspected) Validate

func (s Suspected) Validate() error

Validate returns an error if the Suspected result is invalid.

Jump to

Keyboard shortcuts

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