proletariat.crypto

Opinionated cryptographic functions library

+default-charset+

Default Charset

+symmetric-key-algo+

Default Symmetric Key Algorithm

+symmetric-key-length+

Default Symmetric Key Length

decrypt

(decrypt key encrypted)

Decryptes the encrypted hexadecimal string with the provided hexadecimal encoded string key and returns the decrypted byte array.

decrypt*

(decrypt* algo key encrypted)

Decrypts the encrypted bytes with the provided byte array key and algorithm and returns the decrypted bytes.

decrypt-str

(decrypt-str key encrypted)

Decryptes the encrypted hexadecimal string with the provided hexadecimal encoded string key and returns the decrypted data as a String.

encrypt

(encrypt key data)

Encrypts the input data byte array with the provided hexadecimal encoded string key and returns the hexadecimal encoded string result.

encrypt*

(encrypt* algo key data)

Encrypts the input data bytes with the provided byte array key and algorithm and returns the encrypted bytes.

encrypt-str

(encrypt-str key data)

Encrypts the input data string with the provided hexadecimal encoded string key and returns the hexadecimal encoded string result.

symmetric-key

(symmetric-key)

Generates a symmetric key with the SecureRandom implementation of the highest-priority installed provider as the source of randomness. This can be configured in the java.security file in the JDK to specify a specific implementation. Uses the AES algorithm with 256 keysize. Returns a hexadecimal encoded String representing the Key.

symmetric-key*

(symmetric-key* algo key-len)

Generates a symmetric key with the provided algorithm and key length and uses the SecureRandom implementation of the highest-priority installed provider as the source of randomness. This can be configured in the java.security file in the JDK to specify a specific implementation. Returns the key as a byte array.