Documentation
¶
Overview ¶
Package crypt contains a number of cryptographic functions
Index ¶
- Constants
- func GenerateSSHKey() ([]byte, error)
- func GetSSHPubKeyFromPem(privPem []byte) ([]byte, error)
- func InitTLSPairCa(hosts []string, caPath, keyPath, crtPath string) error
- func RandBytes(size int) (data []byte)
- func RandString(size int) string
- func RandStringCharset(size int, charset string) string
- type Hash
Constants ¶
View Source
const ( Argon2Algo = "Argon2id" // Default tuned to process at least 20 API requests/sec on 2CPU Argon2Memory = 64 * 1024 // 64MB Argon2Iterations = 1 Argon2Threads = 8 // Optimal to quickly execute one request, with not much overhead Argon2Saltlen = 8 Argon2Hashlen = 32 RandStringCharsetB58 = "abcdefghijkmnopqrstuvwxyz" + "ABCDEFGHJKLMNPQRSTUVWXYZ123456789" // Base58 RandStringCharsetAZ = "abcdefghijklmnopqrstuvwxyz" // Only a-z )
Default parameters for the Argon2 hashing and some charsets usable for representing the data
Variables ¶
This section is empty.
Functions ¶
func GenerateSSHKey ¶ added in v0.7.6
GenerateSSHKey creates a private key in pem format
func GetSSHPubKeyFromPem ¶ added in v0.7.6
func InitTLSPairCa ¶ added in v0.7.5
InitTLSPairCa creates a pair of asymmetric keys and CA if needed
func RandString ¶
RandString generates random string with base58 characters
func RandStringCharset ¶ added in v0.7.0
RandStringCharset creates random string of specified size
Types ¶
type Hash ¶
type Hash struct {
Algo string `json:"algo"`
Prop properties `json:"prop"`
Salt []byte `json:"salt"`
Hash []byte `json:"hash"`
}
Hash contains everything needed for storing and reproducing password hash
func NewHash ¶ added in v0.7.5
NewHash generates a salted hash for the input string with default parameters
func (*Hash) Deserialize ¶ added in v0.7.6
func (h *Hash) Deserialize(jsonHash util.UnparsedJSON) error
Click to show internal directories.
Click to hide internal directories.