Liking cljdoc? Tell your friends :D

metabase.util.encryption

Utility functions for encrypting and decrypting strings using AES256 CBC + HMAC SHA512 and the MB_ENCRYPTION_SECRET_KEY env var.

Utility functions for encrypting and decrypting strings using AES256 CBC + HMAC SHA512 and the
`MB_ENCRYPTION_SECRET_KEY` env var.
raw docstring

decryptclj

(decrypt s)
(decrypt secret-key s)

Decrypt string s using a secret-key (a 64-byte byte array), by default the hashed value of MB_ENCRYPTION_SECRET_KEY.

Decrypt string `s` using a `secret-key` (a 64-byte byte array), by default the hashed value of
`MB_ENCRYPTION_SECRET_KEY`.
sourceraw docstring

encryptclj

(encrypt s)
(encrypt secret-key s)

Encrypt string s as hex bytes using a secret-key (a 64-byte byte array), by default the hashed value of MB_ENCRYPTION_SECRET_KEY.

Encrypt string `s` as hex bytes using a `secret-key` (a 64-byte byte array), by default the hashed value of
`MB_ENCRYPTION_SECRET_KEY`.
sourceraw docstring

maybe-decryptclj

(maybe-decrypt s)
(maybe-decrypt secret-key s)

If MB_ENCRYPTION_SECRET_KEY is set and s is encrypted, decrypt s; otherwise return s as-is.

If `MB_ENCRYPTION_SECRET_KEY` is set and `s` is encrypted, decrypt `s`; otherwise return `s` as-is.
sourceraw docstring

maybe-encryptclj

(maybe-encrypt s)
(maybe-encrypt secret-key s)

If MB_ENCRYPTION_SECRET_KEY is set, return an encrypted version of s; otherwise return s as-is.

If `MB_ENCRYPTION_SECRET_KEY` is set, return an encrypted version of `s`; otherwise return `s` as-is.
sourceraw docstring

secret-key->hashclj

(secret-key->hash secret-key)

Generate a 64-byte byte array hash of secret-key using 100,000 iterations of PBKDF2+SHA512.

Generate a 64-byte byte array hash of `secret-key` using 100,000 iterations of PBKDF2+SHA512.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close