3 ms·
You could still store your secret keys in ENV but encrypt them. Only your program has the method to decrypt them so in the case of an ImageMagick sub process it
by jmnicolas 12y ago
You could still store your secret keys in ENV but encrypt them. Only your program has the method to decrypt them so in the case of an ImageMagick sub process it would access only your encrypted secret key with no knowledge to decrypt it.
Same thing while debugging : only the encrypted key is printed.
- hawleyal 12y agoYou would need the key to decrypt somewhere also not in your code.
- jmnicolas 12y agoWhy not in the code ? As I see it we're not trying to fend off Mr Über attacker, just avoid that your keys become public by mistake. And instead of a secret key which is easily searchable, your method could just do some substitutions, something a bit more complicated than a Caesar cypher. Yes it's really weak but it beats an unencrypted secret key. I know security minded people are not gonna like it, but until we have a real battle tested solution it's better than nothing. A determined attacker will almost always win against our best defenses. I think we have to do our best to make their job hard, but at one point we have to accept that offense is really easier than defense.