Liking cljdoc? Tell your friends :D

buddy.core.crypto

Crypto engines low-level abstraction.

Crypto engines low-level abstraction.
raw docstring

-decryptcljmultimethod


-encryptcljmultimethod


block-cipherclj

(block-cipher alg mode)

Block cipher engine constructor.

Block cipher engine constructor.
raw docstring

block-sizeclj

(block-size engine)

Return the block size of the block cipher.

Return the block size of the block cipher.
raw docstring

decryptclj

(decrypt input key iv)
(decrypt input
         key
         iv
         {:keys [algorithm alg] :or {alg :aes128-cbc-hmac-sha256} :as options})

Decrypt data encrypted using the encrypt function.

The input, key and iv parameters should be of any type that can be coerced to byte array.

Decrypt data encrypted using the `encrypt` function.

The input, key and iv parameters should be of any type that can be
coerced to byte array.
raw docstring

encryptclj

(encrypt input key iv)
(encrypt input
         key
         iv
         {:keys [algorithm alg] :or {alg :aes128-cbc-hmac-sha256} :as options})

Encrypt arbitrary length data using one of the supported encryption scheme. The default encryption scheme is: :aes128-cbc-hmac-sha256.

Example: (encrypt "hello world" mykey myiv)

You can specify an other encryption scheme passing an additional parameter.

Example: (encrypt "hello world" mykey myiv {:alg :aes128-cbc-hmac-sha512})

See the documentation for know the complete list of supported encryption schemes.

The input, key and iv parameters should be of any type that can be coerced to byte array.

Encrypt arbitrary length data using one of the supported encryption
scheme. The default encryption scheme is: `:aes128-cbc-hmac-sha256`.

Example: `(encrypt "hello world" mykey myiv)`

You can specify an other encryption scheme passing an additional
parameter.

Example: `(encrypt "hello world" mykey myiv {:alg :aes128-cbc-hmac-sha512})`

See the documentation for know the complete list of supported
encryption schemes.

The input, key and iv parameters should be of any type
that can be coerced to byte array.
raw docstring

end!clj

(end! engine output offset)

End the encryption process. This is only usefull for aead block ciphers, for the rest it always return 0 and does nothing.

End the encryption process.
This is only usefull for aead block ciphers, for the
rest it always return `0` and does nothing.
raw docstring

get-block-sizeclj

A backward compatibility alias for output-size function.

A backward compatibility alias for `output-size` function.
raw docstring

get-output-sizeclj

A backward compatibility alias for output-size function.

A backward compatibility alias for `output-size` function.
raw docstring

IBlockCipherLikecljprotocol


ICipherInitcljprotocol

-endclj

(-end engine out offset)

Finalize cipher engine.

Finalize cipher engine.

-initclj

(-init engine params)

Initialize cipher engine.

Initialize cipher engine.

init!clj

(init! engine params)

Initialize the cipher engine.

Initialize the cipher engine.
raw docstring

initialize!clj

A backward compatibility alias for init!

A backward compatibility alias for `init!`
raw docstring

IStreamCipherLikecljprotocol


output-sizeclj

(output-size engine length)

Get the output size of the aead block cipher.

Get the output size of the aead block cipher.
raw docstring

process-block!clj

(process-block! engine in)
(process-block! engine in inoff out outoff)

Encrypt or decrypt a bytes using the specified engine. The length of the block to encrypt or decrypt depends on the used crypto engine.

Encrypt or decrypt a bytes using the specified engine.
The length of the block to encrypt or decrypt depends on the used
crypto engine.
raw docstring

process-bytes!clj

(process-bytes! engine in)
(process-bytes! engine in inoff out outoff)
(process-bytes! engine in inoff inlen out outoff)

Encrypt or decrypt a bytes using the specified engine. Is a specialized version of process-block! for stream ciphers and aead ciphers.

Encrypt or decrypt a bytes using the specified engine.
Is a specialized version of `process-block!` for stream ciphers
and aead ciphers.
raw docstring

split-by-blocksizeclj

(split-by-blocksize input blocksize)
(split-by-blocksize input blocksize additional)

Split a byte array in blocksize blocks.

Given a arbitrary size bytearray and block size in bytes, returns a vector of bytearray blocks of blocksize size. If last block does not have enought data for fill all block, it is padded using zerobyte padding.

Split a byte array in blocksize blocks.

Given a arbitrary size bytearray and block size in bytes, returns a
vector of bytearray blocks of blocksize size. If last block does not
have enought data for fill all block, it is padded using zerobyte
padding.
raw docstring

stream-cipherclj

(stream-cipher alg)

Stream cipher engine constructor.

Stream cipher engine constructor.
raw docstring

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

× close