Documentation
¶
Index ¶
- func ComparePasswordHash(pwd, hash, salt string) (bool, error)
- func Decrypt(key, text string) (string, error)
- func Encrypt(key, text string) (string, error)
- func MD5(b []byte) string
- func NewEncryptionKey(size uint8) (string, error)
- func NewPersistedED25519() ([]byte, []byte, error)
- func ParseEdPrivateKey(d []byte) (ed25519.PrivateKey, error)
- func ParseEdPublicKey(d []byte) (ed25519.PublicKey, error)
- func PasswordHash(pwd string) (hash, salt string, err error)
- func RandomBytes(length uint8) ([]byte, error)
- func RandomBytesHex(length uint8) (string, error)
- func SHA256(b []byte) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ComparePasswordHash ¶
func NewEncryptionKey ¶
NewEncryptionKey will generate new key as base64 encoded string
should be of 16, 24 or 32 bytes in length
func NewPersistedED25519 ¶
NewPersistedED25519 public & private keys
func ParseEdPrivateKey ¶
func ParseEdPrivateKey(d []byte) (ed25519.PrivateKey, error)
func PasswordHash ¶
PasswordHash using Argon2id
https://cheatsheetseries.owasp.org/cheatsheets/Password_Storage_Cheat_Sheet.html#argon2id
func RandomBytes ¶
RandomBytes generates totally random bytes, each byte is generated by [0,255] range
func RandomBytesHex ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.