New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extract Ecto components to cloak_ecto hex package #77

Closed
danielberkompas opened this Issue Sep 19, 2018 · 0 comments

Comments

Projects
None yet
1 participant
@danielberkompas
Copy link
Owner

danielberkompas commented Sep 19, 2018

Cloak provides enough useful functionality outside of Ecto that it might be useful to have two packages. This would make it possible to rely on Cloak without bringing in Ecto as a dependency, and also make it easier to reuse Cloak in other persistence libraries.

cloak

This package would contain Cipher and Vault. These are the reasons you might use it in addition to :crypto:

  • Vaults provide a standardized way to configure your algorithms and keys
  • Ciphers encapsulate best practices for each algorithm
    • Random IVs
    • Tagged ciphertexts
  • Vaults expose a simpler API for encrypt and decrypt than :crypto
  • Algorithms can be easily swapped, because Vaults can decrypt old cipher text with the an old key and encrypt it with a new key.

cloak_ecto

This package would contain all the Ecto.Type modules, and the mix cloak.migrate task. The task would probably be renamed to cloak_ecto.migrate or similar.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment