Documentation
¶
Index ¶
- Variables
- func ConvertToSHA256(input []byte) []byte
- func DecryptAES(sealed, password []byte) ([]byte, error)
- func DeriveDatabaseKey(username, password string) ([]byte, error)
- func DeriveIdentityKey(username, password, network string) (ed25519.PrivateKey, error)
- func DeriveWalletSeed(identityKey ed25519.PrivateKey, network, username string) []byte
- func EncryptAES(plainData, password []byte) ([]byte, error)
- func GenerateKeyFromSeed(seed []byte) (ed25519.PrivateKey, error)
- func GenerateNoiseKey() (noise.DHKey, error)
- func LoadOrCreateNoiseStaticKey(path string) (noise.DHKey, error)
- func NewWeakPassword() ([]byte, error)
- func NoiseFingerprint(pub []byte) string
- func Sign(privKey, body []byte) string
- func VerifySignature(pubKey, body []byte, signatureStr string) error
- func Wipe(secret []byte)
- type FileSystem
- type NoiseSession
- type PSK
- type PrivateKey
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrCiphertextTooShort = errors.New("security: ciphertext too short") ErrEmptyPassword = errors.New("security: empty password") )
View Source
var ( ErrPSKNetworkRequired = errors.New("psk: network required") ErrPSKVersionRequired = errors.New("psk: version required") )
View Source
var ErrEmptySeed = errors.New("empty seed")
View Source
var ErrNoiseKeyCorrupted = errors.New("security: noise static key file is corrupted")
View Source
var ErrSignatureVerificationFailed = errors.New("signature verification failed")
Functions ¶
func ConvertToSHA256 ¶
func DecryptAES ¶ added in v0.8.77
func DeriveDatabaseKey ¶ added in v0.8.77
func DeriveIdentityKey ¶ added in v0.8.77
func DeriveIdentityKey(username, password, network string) (ed25519.PrivateKey, error)
func DeriveWalletSeed ¶ added in v0.8.77
func DeriveWalletSeed(identityKey ed25519.PrivateKey, network, username string) []byte
func EncryptAES ¶
EncryptAES seals plainData with AES-256-GCM under an Argon2id-derived key. The random salt and nonce are public and travel with the ciphertext.
func GenerateKeyFromSeed ¶
func GenerateKeyFromSeed(seed []byte) (ed25519.PrivateKey, error)
func GenerateNoiseKey ¶ added in v0.8.77
func LoadOrCreateNoiseStaticKey ¶ added in v0.8.77
func NewWeakPassword ¶ added in v0.8.77
NewWeakPassword draws a single-use password from the bounded space above: small enough that brute force stays possible, expensive enough that it costs a data centre. Wipe returns the bytes to zero once they have been used.
func NoiseFingerprint ¶ added in v0.8.77
func VerifySignature ¶ added in v0.4.18
Types ¶
type FileSystem ¶
type NoiseSession ¶ added in v0.8.77
type NoiseSession struct {
// contains filtered or unexported fields
}
func NoiseHandshake ¶ added in v0.8.77
func NoiseHandshakeInitiator ¶ added in v0.8.77
func (*NoiseSession) Decrypt ¶ added in v0.8.77
func (s *NoiseSession) Decrypt(frame []byte) ([]byte, error)
func (*NoiseSession) Encrypt ¶ added in v0.8.77
func (s *NoiseSession) Encrypt(plain []byte) ([]byte, error)
func (*NoiseSession) RemoteStatic ¶ added in v0.8.77
func (s *NoiseSession) RemoteStatic() []byte
type PSK ¶
type PSK []byte
func GeneratePSK ¶
GeneratePSK - Preshared Secret Key is public for Warpnet goals - it's just separate networks and versions
type PrivateKey ¶
Click to show internal directories.
Click to hide internal directories.