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.
(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`.
(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`.
(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.
(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.
(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.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close