【发布时间】:2010-12-23 00:30:22
【问题描述】:
我正在实现一个 API。我需要提供 API 将连接到的帐户的用户名和密码。
profile.APIUsername = "myusername";
profile.APIPassword = "mypassword";
API 文档中有这个警告。
/*
WARNING: Do not embed plaintext credentials in your application code.
Doing so is insecure and against best practices.
Your API credentials must be handled securely. Please consider
encrypting them for use in any production environment, and ensure
that only authorized individuals may view or modify them.
*/
我当然同意,那么我怎样才能保护这些而不是在生产代码中放入纯文本?我是否将它们存储在数据库中?但我如何加密/解密它们? 谢谢
【问题讨论】:
标签: c# asp.net-mvc