NotQuiteLagom

NotQuiteLagom

I’m wondering about the best approach to “obfuscating” Elixir source code that needs to be available for a group of software developers as they need to use the components/functions but just the component API as the internals should be a black box.
I had a recent case of a group leaving the company and taking source code with them.
So, I was thinking…

  1. pre-compiled Deps?
  2. Obfuscating source code like in Javacscript but with the Mix format…
    So, if you use a component/modular approach where each component/module has one owner but it’s needed for the global project and developers can customise those components (for example in the presentation layer like a button, but not only) in their code, what would be the best approach.
    Thank you in advance!

Showing Posts 1 to 7

cmo

cmo

You can give them a service to hit rather than the code. Most things can be decompiled these days.

Lawyers instead?

NotQuiteLagom

NotQuiteLagom OP

:slight_smile:
Yes, but I prefer to avoid having troubles.
And remember I want to have an “internal/component” API so that they can customise components that they use in their source code.
I believe this is an interesting question…can we control what our extended developer team can access in terms of source code?

cmo

cmo

Sound to me this topic is entirely about creating troubles for yourself :stuck_out_tongue:

hst337

hst337

Obfuscated code like in JavaScript can still be easily deobfuscated. Providing .beam is not secure because they can be easily decompiled (even by hand).

dimitarvp

dimitarvp

The BEAM languages are compiled into a fairly transparent bytecode so you absolutely cannot make it as opaque as you would like.

w0rd-driven

w0rd-driven

I would definitely approach this from what decompilation tools are available and how user friendly they are. With .NET (though this may not be true now), I could decompile a release into somewhat full featured source code files and their respective project containers. Like beam languages, the code is interpreted as MSIL but being able to read that bytecode or put it in my IDE of choice is no simple task.

If tools existed to only view MSIL I’d personally consider it a small threat because the average developer isn’t going to choose to work at that level. The same would be true for Erlang’s bytecode. If code can be decompiled to a relatively working project, that’s when I’d be concerned with obfuscation.

I suspect the average Elixir developer when confronted with a release and no source is likely not too concerned to reverse engineer intellectual property from bytecode. There will always be determined hackers. As an anecdote, JavaScript obfuscation absolutely does not stop me from changing Vue to developer mode so I can use Vue tools extensions to analyze the components of popular websites. JS can obfuscate function names but magic strings have to leak through.

Taking your API example, anyone using your library would have to be obfuscated with it. Otherwise they’d have to use function names like MyModule.c() or some random thing that would ideally change every obfuscation run. Obfuscation in JS works because the source is bundled together then minified. If I were a developer presented with a library that required I also obfuscate my application, I’d likely look for a new library. What about connecting with iex? Would I have to run MyModule.my_function() or MyModule.c()? I’d use .c() exactly once before I ripped it out. You could be in the enterprise space where I’d be forced to use your library but I wouldn’t willfully choose something that put those kind of stumbling blocks in my path. That’s only my 2 cents but those would be the things I wrestled with.

Having said all that, you may want to look at DockYard’s BeaconCMS (https://github.com/BeaconCMS/beacon/tree/main/lib/beacon/loader) as pages and components are generated with unique names. Its been a minute since I analyzed how the modules in that directory worked but in the console you can see your components have hashed names to prevent collisions. My guess is this is so one CMS can handle multi-tenancy or multiple sites without one page or component stepping on the other. This may be what you’re looking for but the word “obfuscate” obviously triggers some things with me.

mindok

mindok

IP protection is an org-level discussion, not just a technical one. Obfuscation is way down the list of things to think about - code is always exposed to being copied, decompiled etc by someone working on the codebase and honestly, the vast majority of the time it really makes no difference.

Really, the focus should be on the “secret sauce” unique to your application (hopefully there is such a thing). Secret sauce can be algorithms, datasets (e.g. used to train ML models), customer data etc, so understanding where and how value is created is key to any IP protection strategy. A lot of wiring up code is common to a large number of applications and if folks steal it, well, whatever - it shouldn’t make or break your company if it’s taken.

How you protect the secret sauce is then a combination of legal, social & technical. I have seen “inner-circle” developers who are “motivated” (better pay, equity, proven trustworthy, explicit legal threats or whatever) to be “stay close” being the only ones allowed to work on the core algorithms and outer-circle developers (e.g. contractors, new hires) only access the core algorithms via well defined APIs. This can be taken a step further if the algorithms are particularly valuable by, for example, offering an alternate, inferior algorithm with the same API for the purpose of building and testing integrations / UIs etc, but only deploying the real one into production to minimise the possibility of reverse-engineering.

Also, if an algorithm is valuable enough to want to prevent casual IP theft, it’s probably valuable enough to build some bits in a different language where the build artefacts are harder to reverse-engineer.

— 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
jonnycharles
I’m in search of an Elixir library that offers PDF generation capabilities similar to Ruby’s Prawn. While there have been discussions abo...
New
spammy
I’m looking to build a personal workflow to quickly deploy web applications written in elixir/phoenix, for local consumption (ie not on t...
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
dli
Before I dive in myself, did anyone successfully sprinkle Hologram into their existing LiveView app? Looking for hints regarding: Addi...
New
roeland
Kia ora, We have been using elixir-google-api to connect to Google Drive. However, with the updates to Tesla due to CVEs this is now bro...
New
bottlenecked
Hi all, I wanted to ask how the community is dealing with post-release steps. Today we have Ecto migrations, which make sure that the db...
New

Other Trending Topics Top

JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
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
netoum
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
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
ausimian
Emily is an Elixir library that runs Nx computations on Apple’s MLX. Install it as the default Nx backend and Nx, defn, Axon, Nx.Serving,...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews