Sprig Cryptographic & Security

Sprig Cryptographic & Security

adler32sum

func adler32sum(input string) string
Computes Adler-32 checksum.

bcrypt

func bcrypt(arg1 string) string
Receives a string, and generates its bcrypt hash.

buildCustomCert

func buildCustomCert(base64Cert string, base64PrivateKey string)
sprig.certificate
Allows customizing the certificate.

decryptAES

func decryptAES(encoded string, key string) string
Receives a base64 string encoded by the AES-256 CBC algorithm and
returns the decoded text.

derivePassword

func derivePassword(counter uint32, passwordType string, password string,
user string, site string) string
Derive a specific password based on some shared 'master password'
constraints.

encryptAES

func encryptAES(secret string, key string) string
Encrypts text with AES-256 CBC and returns a base64 encoded string.

genCA

func genCA(cn string, nbDays int) sprig.certificate
Generates a new, self-signed x509 certificate authority.

genCAWithKey

func genCAWithKey(cn string, nbDays int, arg3 string) sprig.certificate
Generates a new, self-signed x509 certificate authority.

genPrivateKey

func genPrivateKey(cn string) string
Generates a new, self-signed x509 certificate authority using a given
private key.

genSelfSignedCert

func genSelfSignedCert(cn string, ipList []interface{}, dnsList
[]interface{}, nbDays int) sprig.certificate
Generates a new, self-signed x509 certificate.

genSelfSignedCertWithKey

func genSelfSignedCertWithKey(cn string, ipList []interface{}, dnsList
[]interface{}, nbDays int, privatePEM string) sprig.certificate
Generates a new, self-signed x509 certificate using a given private
key.

genSignedCert

func genSignedCert(cn string, ipList []interface{}, dnsList []interface{},
nbDays int, ca sprig.certificate) sprig.certificate
Generates a new, x509 certificate signed by the specified CA.

genSignedCertWithKey

func genSignedCertWithKey(cn string, ipList []interface{}, dnsList
[]interface{}, nbDays int, ca sprig.certificate, privatePEM string)
sprig.certificate
Generates a new, x509 certificate signed by the specified CA, using a
given private key.

htpasswd

func htpasswd(user string, password string) string
Takes a username and password and generates a bcrypt hash of the
password. The result can be used for basic authentication on an Apache
HTTP Server.

randBytes

func randBytes(arg1 int) string
Accepts a count N and generates a cryptographically secure (uses
crypto/rand) random sequence of N bytes. The sequence is returned as a
base64 encoded string.

sha1sum

func sha1sum(input string) string
Computes SHA1 digest.

sha256sum

func sha256sum(input string) string
Computes SHA256 digest.