Documentation
¶
Overview ¶
Package security provides scoped standard cryptographic utilities.
Index ¶
- func CheckPassword(hash, password []byte) error
- func Equal(a, b []byte) bool
- func HashPassword(password []byte, cost int) ([]byte, error)
- func RandomBytes(n int) ([]byte, error)
- func Redact(v any) any
- func SHA256(b []byte) [32]byte
- func Sensitive(key string) bool
- func Sign(key, data []byte) ([]byte, error)
- func Token(n int) (string, error)
- func Verify(key, data, tag []byte) bool
- func Zero(b []byte)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckPassword ¶
CheckPassword verifies a bcrypt password hash.
func HashPassword ¶
HashPassword hashes a password with an explicit validated bcrypt cost.
func RandomBytes ¶
RandomBytes returns cryptographically secure random bytes of a bounded positive length.
func Redact ¶
Redact returns a recursively redacted copy of JSON-like data. Free text must not contain secrets.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.