Magik.Crypto (Magik v0.11.0) View Source
Provide some basic encrypt/decrypt function
Link to this section Summary
Functions
Decode cipher data which encrypted using encrypt/2
Decode cipher data which encrypted using encrypt/2
Encrypt data using :aes_128_cbc
mode, and return base64 encrypted string
Encrypt data using :aes_128_cbc
mode, and return base64 encrypted string
Generates a random 16 byte and encode base64 secret key.
Link to this section Functions
Specs
Decode cipher data which encrypted using encrypt/2
key = generate_secret()
{:ok, cipher} = encrypt("hello", key)
decrypt(cipher, key)
Specs
Decode cipher data which encrypted using encrypt/2
key = generate_secret()
{:ok, cipher} = encrypt_aead("hello", key)
decrypt_aead(cipher, key)
Specs
Specs
Encrypt data using :aes_128_cbc
mode, and return base64 encrypted string
key = generate_secret()
encrypt("hello", key)
Specs
Specs
Encrypt data using :aes_128_cbc
mode, and return base64 encrypted string
key = generate_secret()
encrypt_aead("hello", key)
Specs
Generates a random 16 byte and encode base64 secret key.