acrolink

acrolink

Storing sensitive information in the database

How to protect sensitive information (personal details and medical records) in database (PostgreSQL)? How to encrypt that data in the database and decrypt it only for authorized logged in users? Any libraries can help to achieve this? Where and how to store the key needed to decrypt the data?

Thank you.

Most Liked

kokolegorille

kokolegorille

I did not use it yet, but cloak seems a good choice…

https://github.com/danielberkompas/cloak

stefanchrobot

stefanchrobot

:+1: We use cloak and it’s Ecto integration cloak-ecto to encrypt sensitive data in the DB.

acrolink

acrolink

@kokolegorille @stefanchrobot @Allyedge

Thank you. I have already installed cloak and cloak-ecto.

May I ask, how do you provide the application with the base_64 encoded encryption key? By some credential manager, as environment variable or using another method? What is the safest manner to pass the encryption key to the application? Thank you.

Last Post!

stefanchrobot

stefanchrobot

We pass the key via an ENV variable in the runtime (System.fetch_env! in runtime.exs). Currently we’re using Ansible Vault to store the keys.

Where Next?

Popular in Questions Top

hariharasudhan94
lets say i have a sample like a = 20; b = 10; if (a > b) do {:ok, "a"} end if (a < b) do {:ok, b} end if (a == b) do {:ok, "equa...
New
lanycrost
Hi everyone! I need implement if…else if…else condition from my elixir code, and anymore of this control flow structures not work proper...
New
openscript
Hello! Sorry for this astonishing simple question, but I’m really stuck. I try to set up the intellij-elixir plugin, but I don’t know ho...
New
dokuzbir
I want to highlight html closing tags when i click a html tag. That works in .html files but doesnt work for html.eex templates. How can...
New
sen
Hi All, I set a environment variables in dev.exs , like below code. when i start server, how can i set the ${enable} value? thanks. d...
New
freewebwithme
Using vs code and installed ElixirLS: support and debugger. And I got an error popped up on start up says Failed to run ‘elixir’ comma...
New
JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New

Other popular topics Top

KronicDeth
Elixir plugin for JetBrain’s IntelliJ Platform (including Rubymine) This is a plugin that adds support for Elixir to JetBrains IntelliJ...
289 36820 110
New
nobody
Hi! In PHP: $_SERVER[‘SERVER_ADDR’] - in Elixir? Searched the docs for ip address and the web, no good results. Thanks!
New
JeremM34
Hello, how can I check the Phoenix version ? Thanks !
New
JakeBecker
TL;DR: I’ve just released an implementation of Microsoft’s IDE-independent Language Server Protocol for Elixir. It adds language support ...
1144 55125 245
New
openscript
Hello! Sorry for this astonishing simple question, but I’m really stuck. I try to set up the intellij-elixir plugin, but I don’t know ho...
New
gausby
I asked this very same question on twitter and got some interesting feedback, but I thought it would be a good question to ask here as we...
1207 40165 209
New

We're in Beta

About us Mission Statement