编写我的银行脚本
我想编写访问我的网上银行数据的脚本。大多数是只读的东西,用于绘制图表和发送警报等。
但我不想在脚本中以明文形式编写我的网上银行登录详细信息。
我该如何解决这个困境?
如果可能的话,我希望能够从 cronjobs/定期运行一些东西。
I want to write scripts which access my internet banking data. Mostly read-only stuff for drawing graphs and sending alerts and so on.
But I don't want to write my internet banking login details in plaintext in a script.
How do I resolve this dilemma?
I'd like to be able to run things from cronjobs/periodically if possible.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
您应该检查boobank,这是一个网站scraper,已经支持银行范围广泛(嗯,我想主要是法国银行)。但是添加您的模块将是一个巨大的贡献,并且您无需编写所有命令行内容的麻烦。
对于您问题的另一部分,boobank 会将您的密码存储在
~/.config/weboob/backends
中的一个明文文件中,只有您可读。这对你来说可能还不够。但这肯定比在命令行上提供密码要好得多!You should check boobank, this is a web site scraper that already support a wide range of bank (hum, mostly French banks, I figure). But adding your module would be a great contribution and you don't have the hassle of making all the command line stuff.
For the other part of your question, boobank will store your password in
~/.config/weboob/backends
, in a file, cleartext, only readable by you. This might not be enough for you. But this is surely much better than providing the password on the command line!让您的脚本接受用户名和密码的命令行参数并使用传入的值。
Make your script accept command line arguments for username and password and use the passed in values.
虽然 Oded 提出了一个很好的建议,但唯一的问题在于向程序/脚本提供命令行参数时,它们将在进程运行时显示在 top(1) 和 ps(1) 中。当然,这可能会在您的个人计算机上使用,您是唯一登录的用户,但在多用户系统上,这会相当危险。
While a good suggestion from Oded, the only problem lies when supplying command-line arguments to a program/script, they will show up in top(1) and ps(1) while the process is running. Granted, this is probably going to be used on your personal computer, where you are the only user logged on, but on multi-user systems, this would be rather risky.
经过一段时间的思考后,似乎最好的答案是找一家可以在交易发生时向您发送电子邮件的银行。然后,解析这些电子邮件。
这不是理想的解决方案,但唯一一个既可能(当交易发生超过 20 美元时,我的银行至少会向我发送电子邮件)又安全(如果该脚本损坏,最糟糕的情况就是向我提供虚假信息)的解决方案。
After having thought about it for a while, it seems like the best answer is to get a bank which can email you when transactions occur. Then, parse those emails.
Not the ideal solution, but the only one that is both likely (my bank will at least email me when transactions > $20 happen) and safe (if that script breaks, the worst it can do is provide me with false information).
使用某种双向加密算法,例如 AES 或 DES。
Use some two way encryption algorithm like AES or DES.