View Source EctoEncryptedId.Encryption (EctoEncryptedId v0.1.0)

Module that allows to work with encrypted values directly.

Summary

Functions

Decode the value from Base62, then decrypt using AES256GCM cypher.

Encrypt the value using AES256GCM cypher, then encode using Base62

Functions

@spec decrypt(encrypted :: String.t(), key :: binary()) :: {:ok, integer()} | :error

Decode the value from Base62, then decrypt using AES256GCM cypher.

@spec encrypt(num :: integer(), key :: binary(), salt :: binary()) :: String.t()

Encrypt the value using AES256GCM cypher, then encode using Base62