crypt

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type State

type State struct {
	// contains filtered or unexported fields
}

State manages cryptographic operations for skill check validation

func NewState

func NewState() (*State, error)

NewState creates a new crypt State with a randomly generated secret

func (*State) Decrypt

func (s *State) Decrypt(encrypted string, expectedTurn int, result any) error

Decrypt decrypts and validates encrypted data, unmarshaling into the provided result

func (*State) Encrypt

func (s *State) Encrypt(data any, turn int) (string, error)

Encrypt encrypts any JSON-serializable data with turn number for tamper protection

Jump to

Keyboard shortcuts

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