danielberkompas / cloak

Elixir encryption library designed for Ecto
MIT License
582 stars 55 forks source link

Use with mnesia? #55

Closed beardedeagle closed 6 years ago

beardedeagle commented 6 years ago

This lib has a hard dep on ecto and unfortunately the ecto_mnesia lib isn't fully there yet. Any tips on what would need to be done to decouple this from ecto to be used with mnesia?

danielberkompas commented 6 years ago

Cloak provides a usable module API that you could call directly. You could call Cloak.encrypt and Cloak.decrypt directly to encrypt or decrypt binaries and not use any of the Ecto Types.

I haven't used Mnesia in production, so I don't know it's API well enough to know if mix cloak.migrate could work without Ecto.

beardedeagle commented 6 years ago

I can give that a try and see how it works. Baring that I can create a sister package that deals with mnesia/ets

danielberkompas commented 6 years ago

If you went the second route, I'd rather split out the ecto-specific code into cloak_ecto, and then we could make cloak_ets, cloak_mnesia etc.