Documentation ¶
Index ¶
- Constants
- func DecodeBase32(encoded string) ([]byte, error)
- func DecodeBase62(encoded string) ([]byte, error)
- func DecodeBase64(encoded string) ([]byte, error)
- func DecodeBase64Url(encoded string) ([]byte, error)
- func DecodeHex(encoded string) ([]byte, error)
- func DecryptAes(data []byte, key *Key) ([]byte, error)
- func DecryptSecretbox(data []byte, key *Key) ([]byte, error)
- func DecryptXChaPo(data []byte, key *Key) ([]byte, error)
- func EncodeBase32(data []byte) string
- func EncodeBase62(data []byte) string
- func EncodeBase64(data []byte) string
- func EncodeBase64Url(data []byte) string
- func EncodeHex(data []byte) string
- func EncryptAes(data []byte, key *Key) ([]byte, error)
- func EncryptSecretbox(data []byte, key *Key) ([]byte, error)
- func EncryptXChaPo(data []byte, key *Key) ([]byte, error)
- func NewSalt(length int) []byte
- func Unwrap(text string) string
- func Wrap(text string, length int) string
- type BoxKeyPair
- type BoxKeys
- type Key
Constants ¶
View Source
const ( SaltLength8 = 8 // size also used by OpenSSL, but 16 is also common SaltLength16 = 16 SaltLength24 = 24 SaltLength32 = 32 )
Variables ¶
This section is empty.
Functions ¶
func DecodeBase32 ¶
Base32 decoding (only uppercase, no special characters)
func DecodeBase64Url ¶
Base64 decoding (URL safe variant)
func EncodeBase32 ¶
Base32 encoding (only uppercase, no special characters)
func EncryptAes ¶
AES-256-GCM (~ AES-CTR-GMAC)
func EncryptSecretbox ¶
XSalsa20-Poly1305
Types ¶
type BoxKeyPair ¶
type Key ¶
type Key struct {
// contains filtered or unexported fields
}
func DeriveKeyArgon2id ¶
func DeriveKeyHkdf ¶
derive key using HKDF with SHA-256
func DeriveKeyPbkdf ¶
derive key using PBKDF2 with SHA-256
func DeriveKeyScrypt ¶
Click to show internal directories.
Click to hide internal directories.