Bitcoin Forum

Bitcoin => Project Development => Topic started by: tradebtcdotus on October 11, 2015, 12:24:39 PM



Title: hide connect rpc in code
Post by: tradebtcdotus on October 11, 2015, 12:24:39 PM
Hello everybody!
When I use php connect with bitcoind via rpc
I must write user/password rpc in code
problem: when hacker hack code, they will get my bitcoin.
how can I hide connect rpc in code?


Title: Re: hide connect rpc in code
Post by: sellscript on October 11, 2015, 12:25:42 PM
I think you can use database


Title: Re: hide connect rpc in code
Post by: achow101 on October 11, 2015, 02:42:24 PM
Hello everybody!
When I use php connect with bitcoind via rpc
I must write user/password rpc in code
problem: when hacker hack code, they will get my bitcoin.
how can I hide connect rpc in code?
Make sure you setup the rpc so that both port 8332 is not available from the outside and that the rpc server only accepts connections from whatever ip the webserver is hosted on. (probably localhost)


Title: Re: hide connect rpc in code
Post by: goregrind on October 13, 2015, 03:50:14 AM
There is no easy solution here, just write secure scripts.
As long as your script has access to your bitcoins so will any attacker that gets access to your script.


Title: Re: hide connect rpc in code
Post by: coinpr0n on October 13, 2015, 10:04:04 AM
If someone hacks the server that's pretty much it. But you can avoid putting the password directly into the source code by using the server's environment variables or some other mechanism of separating it out and only read on loading / execution of the script.