Documentation ¶
Index ¶
- Variables
- func Base64Decode(data string) ([]byte, error)
- func Base64Encode(data []byte) string
- func RandomBytes(saltLength int) ([]byte, error)
- func ReadRandom(data []byte) error
- func SplitOne(data string) (string, string)
- func SplitOneBytes(data []byte) ([]byte, []byte)
- type Pbkdf2Hash
- type Pbkdf2Settings
- type Secretbox
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultPbdkf2Settings = Pbkdf2Settings{
Hasher: "pbkdf2_sha256",
IterationCount: 180000,
SaltLen: 12,
KeyLength: 32,
}
Functions ¶
func Base64Decode ¶
func Base64Encode ¶
func RandomBytes ¶
func ReadRandom ¶
func SplitOneBytes ¶
Types ¶
type Pbkdf2Hash ¶
type Pbkdf2Hash struct { Settings Pbkdf2Settings Salt []byte Hash []byte }
func ParsePbkdf2Hash ¶
func ParsePbkdf2Hash(data string) (*Pbkdf2Hash, string, error)
func (*Pbkdf2Hash) String ¶
func (p *Pbkdf2Hash) String() string
func (*Pbkdf2Hash) Verify ¶
func (p *Pbkdf2Hash) Verify(pass []byte) bool
type Pbkdf2Settings ¶
func ParsePbkdf2Settings ¶
func ParsePbkdf2Settings(data string) (*Pbkdf2Settings, string, error)
func (Pbkdf2Settings) Hash ¶
func (p Pbkdf2Settings) Hash(pass []byte, salt []byte) *Pbkdf2Hash
func (Pbkdf2Settings) String ¶
func (p Pbkdf2Settings) String() string
type Secretbox ¶
type Secretbox struct { Settings Pbkdf2Settings PassSalt []byte Nonce [24]byte Data []byte }
func ParseSecretbox ¶
func SecretboxEncrypt ¶
Click to show internal directories.
Click to hide internal directories.