Open jannecederberg opened 6 years ago
Of course if a machine is compromized sufficiently badly, the attacker can read live memory and obtain _apikey and _apisecret that way but if attack surface is limited for example to the ability of reading files from disk (say due to some other compromised webapp), then using encryption for credentials will at least make it more work for an attacker to obtain the key and secret.
And forgot to say this initially: thank you for the great work on the module!
Sorry @jannecederberg , I have been absent for a while.
Personally I do not use the decrypt functionality provided by this module. And in the interest of operation security I will not say what I do to replace it. 😃
To me your change seems reasonable. My only concern is how it might impact other users of the current scheme. I have no sense of how much it is used (beyond the single user who contributed it).
My inclination is to merge and to bump the bittrex library version.
Pretty late to this conversation, but I was the contributor for the encrypt/decrypt portion. First, I have to say I am not really a security expert.
The original intent was to just have the option of encrypting the contents of secrets.json. A design goal was to minimize the deviation from how the package would normally work without it.
With this scheme, the difference between using an encrypted secrets.json versus one that is not is just adding my_bittrex.decrypt()
after initializing my_bittrex
with credentials.
Hope this gives more clarity for the rationale. My apologies if I've introduced someting unintuitive to this awesome repo.
The decrypt method on the Bittrex class was not actually reading credentials from secrets.json. This commit adds that.
Justification: I don't currently understand how the decrypt method is supposed to be used. The way I understand this and would personally use python-bittrex in production is as follows:
In summary: this commit aims to make the above a reality.
Suggested further improvements: standalone secrets.json generator