Liking cljdoc? Tell your friends :D

uniformity.crypto.core


aes-gcm-decryptclj/s

(aes-gcm-decrypt plaintext key nonce)

Decrypts ciphertext with key + nonce.

Returns channel containing plaintext as byte array.

Decrypts ciphertext with key + nonce.

Returns channel containing plaintext as byte array.
sourceraw docstring

aes-gcm-encryptclj/s

(aes-gcm-encrypt plaintext key & {:keys [nonce]})

Encrypts plaintext using AES in GCM with key + nonce. Key must be 128, 192, or 256 bits long. Nonce must be 96 bits long.

If no nonce provided, a random one will be generated.

Returns channel containing nonce and ciphertext (+ auth tag).

Encrypts plaintext using AES in GCM with key + nonce.
Key must be 128, 192, or 256 bits long.
Nonce must be 96 bits long.

If no nonce provided, a random one will be generated.

Returns channel containing nonce and ciphertext (+ auth tag).
sourceraw docstring

pbkdf2clj/s

(pbkdf2 password
        &
        {:keys [salt iterations hash key-length]
         :or {iterations 100000 hash :sha256 key-length 128}})

Derives a key using PBKDF2 on password with the following optional parameters:

:salt

  • byte array
  • default: 128 random bits :iterations
  • number
  • default: 100,000 :hash
  • keyword, one of :sha1, :sha256, :sha384, :sha512
  • default: :sha256 :key-length
  • number
  • one of: 128, 192, 256
  • should be less than or equal to hash length
  • default: 128

Returns a channel containing key as byte array.

Derives a key using PBKDF2 on password with the following optional parameters:

:salt
- byte array
- default: 128 random bits
:iterations
- number
- default: 100,000
:hash
- keyword, one of :sha1, :sha256, :sha384, :sha512
- default: :sha256
:key-length 
- number
- one of: 128, 192, 256
- should be less than or equal to hash length
- default: 128
            
Returns a channel containing key as byte array.
sourceraw docstring

rsa-decryptclj/s

(rsa-decrypt ciphertext private-key)

Takes a byte array ciphertext and an RSA private key as a PKCS#8-encoded byte array.

Returns a channel containing plaintext as a byte array.

Takes a byte array ciphertext and an RSA private key
as a PKCS#8-encoded byte array.

Returns a channel containing plaintext as a byte array.
sourceraw docstring

rsa-encryptclj/s

(rsa-encrypt plaintext public-key)

Takes a byte array plaintext and an RSA public key as an SPKI-encoded byte array.

Returns a channel containing ciphertext as a byte array.

Takes a byte array plaintext and an RSA public key
as an SPKI-encoded byte array.

Returns a channel containing ciphertext as a byte array.
sourceraw docstring

rsa-generate-keypairclj/s

(rsa-generate-keypair key-length)

Generates an RSA keypair with a key size of the number of bits specified. Only allows 2048-, 3072-, and 4096-bit keys to be generated.

Returns a map containing a channel each for the public and private keys, accessible via :public and :private

Generates an RSA keypair with a key size of the number of bits specified.
Only allows 2048-, 3072-, and 4096-bit keys to be generated.

Returns a map containing a channel each for the public and private keys,
accessible via :public and :private
sourceraw docstring

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

× close