EddTally

EddTally

I have a Java class which is stored as an encrypted class for important security reasons then only decrypted at application startup, this is completed by various Java tools, I would like the same to happen to my Elixir Module.
Is there a similar/recommended thing in Elixir/Erlang?

Showing Posts 1 to 8

cmo

cmo

So you write a module, encrypt and save to disk/db, application reads it and loads module? Where does the encryption key live?

EddTally

EddTally OP

Currently on the encrypted file which isn’t good.
So I would change my question to, what is the best way to go about securing an important module, so that if I am hacked, the hacker cannot see the encryption methods I am using, and therefore decrypt all data.

hauleth

hauleth

If the module is unencrypted in memory, then they can dump all of that. If you encrypted the module, then you also have key for that encryption stored anywhere in the memory or in a file that is readable by current application.

In short, it doesn’t really make sense to me to encrypt the BEAM files.

EddTally

EddTally OP

The module would be created then encrypted and the original deleted, the module would not be stored anywhere in an unencrypted format, but I can dismiss this idea if you think it doesn’t make sense, because as you stated key storage is a problem.
Would you suggest a different method of keeping my elixir encryption method secret in case of a dump?

harmon25

harmon25

You must secure the keys. Not the methods.

A motivated attacker can likely guess or infer the method based on structure of the encrypted blob.

EddTally

EddTally OP

I see, this was in-part motivated by the recent Twitch dump… Really don’t want that happening to me.

hauleth

hauleth

Just use method properly, then even if there will be a breach, as long as the key do not leak, you will be safe. There is little to no point of keeping encryption method secret. It can help with slowing down attack, but itself it does nothing. As long as your protocol do not have flaws and keys are secure then forcing yourself with hiding encryption method is pointless. See at the TLS where encryption method is actually public.

f0rest8

f0rest8

I’d like to second what @hauleth said.

You should be able to reveal how you encrypt data (minus the key) and that data should still remain effectively safe. That is the overall meaning or expectation behind strong/good encryption (I’m “colloquializing” but for simplicity’s sake).

You don’t want to have an encryption method that’s strength is due to the obfuscation of the method. That would render it effectively weak or not good encryption and would provide a false sense of security for you and the people depending on the encryption.

I’m not sure for your particular use-case what strategy you may want to take, but the enacl library mentioned in my other post is an elixir library that enables you to work with the world class NaCl/libsodium libraries.

So, storing keys separately is typically how it’s done. There are even key management services you can use that are more sophisticated ways of, again, storing keys separately so that if your encrypted data is obtained, it’s not necessarily obtained with the keys to decrypt it.

Cloak is another elixir library that is geared more toward what it sounds like you’re trying to do: encrypted at rest in the db (cloak_ecto too if dealing specifically with ecto).

— All posts loaded —

Where Next? Top

Trending in Questions Top

stjefim
Hello! Suppose you are building workflow (order / task / payment) processing system with the following requirements: Each workflow con...
New
Blokh
Hey guys, I’ve got a huge CSV ( around 10 GB ) that needs to be processed hourly Do you guys have any suggestions what is the best prac...
New
kszambelanczyk
Hello! Could someone please give me a help/sample code, how to delete a file from s3 using waffle/waffle_ecto from Phoenix app. I creat...
New
Onor.io
I have what I’ve heard referred to as a “lookup table” in my database. This is a way of assigning codes to common values. One common lo...
New
jaybe78
Hello, I’m developing a online persistent chat system (what’s app) like using elixir/dynamodb/aws for a mobile app(flutter). The diffic...
New
Trolleger
What approach to take when sending live updates to “random” users Hi! I have a question, I have a little chat app, and when I create a DM...
New
widianto
I think I’ve found a small improvement I could contribute to <%= web_namespace %>.CoreComponents (installer/templates/phx_web/compo...
New

Other Trending Topics Top

garrison
Hobbes is a low-level distributed database for the Elixir programming language. Hobbes provides a simple, safe, and scalable storage lay...
New
mcass19
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New
Damirados
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve. They are GUI (Emerge) and State management (S...
New
netoum
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
wintermeyer
There are three potential reasons for members of this forum to have a look at https://vutuv.de You are tired or annoyed of LinkedIn. Yo...
New
webofbits
Aludel - LLM Evaluation Workbench Aludel is an embeddable Phoenix LiveView dashboard for evaluating and comparing LLM prompts across mult...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews