logoalt Hacker News

dangoodmanUT • yesterday at 8:53 PM • 5 replies • view on HN

A trick i've started doing is encrypting my env vars, then hard-code the decryption key in the code

that way if the provider gets popped, they need my binary to decrypt it

it shouldn't be necessary and it sounds stupid, but in cases like this, it proves invaluable (it appears they don't have customer code/binary access, but maybe that wasn't important enough to mention)


Replies

steelframe • yesterday at 11:16 PM

I think this is a great example of temporarily effective "security through obscurity." It's also a trick that will only continue to work so long as it doesn't get adopted too widely.

➕ show 1 reply
Ey7NFZ3P0nzAe • yesterday at 10:16 PM

Been doing something like this for a while with a single self contained .sh file that contains a python script:

https://github.com/thiswillbeyourgithub/envlocker

harvey7 • today at 2:39 AM

lock your env vars in hardware. even the whole server and code is compromised, the secrets are still safe.

so you dont need env2 to decrypt env1.

https://seal.zone/ does this

➕ show 1 reply
Geof25 • yesterday at 11:53 PM

I will give you one better - encrypt the variables and move the secrets to a different server running hashicorp. Then load the secrets and keep them only in RAM.

➕ show 1 reply
ikrenji • today at 12:39 AM

if the provider gets popped doesn't the binary get popped too? then simply use an LLM to reverse engineer the binary and get the key?

➕ show 1 reply