Securely store public/private keys in a database

I want to store public and private keys in a database securely. My question is therefore how do I store the private key in a database securely. (public key doesn't need to be that secure anyways). I have two methods currently. Add a passphrase (ie the user's master password) to the private key and store that as a string in the database Encrypt the private key using a symmetric al

将公钥/私钥安全地存储在数据库中

我想安全地将公钥和私钥存储在数据库中。 因此,我的问题是如何安全地将私钥存储在数据库中。 (公钥不需要那么安全)。 我目前有两种方法。 将密码(即用户的主密码)添加到私钥,并将其作为字符串存储在数据库中 使用对称算法加密私钥并将其作为字符串存储在数据库中 这些方法是否足够? 哪个更好或者他们是同一个东西? 有没有更好的方法? 更新你们中的一些人可能会为我甚至想要做到这一点而困惑。 我的用

Safe way to store decryptable passwords

I'm making an application in PHP and there is a requirement that it must be possible to decrypt the passwords in order to avoid problems in the future with switching user database to different system. Consider that it's not possible to modify this future system's password method and I need plain text passwords in order to have the passwords generated. The plan is to encrypt the use

安全的方式来存储可解密的密码

我正在PHP中创建一个应用程序,为了避免将用户数据库切换到不同的系统以避免将来出现问题,必须有可能解密密码。 考虑到这是不可能修改这个未来系统的密码方法,我需要纯文本密码才能生成密码。 计划是使用存储在服务器上的公钥来加密用户的密码。 通过加密输入并比较结果来完成认证。 没有解密完成。 能够解密的私钥被存储在异地以供以后使用。 你会建议什么加密/解密算法? 当您认为私钥对攻击者不可用时,加密密码是

Secure login: public key encryption in PHP and Javascript

I'm trying to make a "normal" username/password login form secure, without needing HTTPS. My idea is this: Server generates a keypair for some kind of assymetric encryption algorithm. It stores this keypair in a temporary table of sorts (or perhaps the local session data). Server sends the form to the client and includes the public key. User fills in the form. Before it

安全登录:PHP和Javascript中的公钥加密

我试图使安全的“正常”用户名/密码登录表单,而不需要HTTPS。 我的想法是这样的: 服务器为某种不对称加密算法生成密钥对。 它将这个密钥对存储在一个临时的排序表(或者本地会话数据)中。 服务器将表单发送到客户端并包含公钥。 用户填写表单。 在发送到服务器之前,Javascript会使用给定的公钥对密码进行加密。 表格已发送。 服务器用它的私钥解密密码(它从临时表中获得,使用公钥找到它)。 我需要知道的是

using real/fake salt instead of lockouts

I've read various topics about php login scripts, so I'm not going to recap those discussions but I was wondering about the use of a real and fake salt in the password hash. Instead of an ID / password login prompt, I was thinking about a ID# / ID / password login prompt. My users all have IDs, not related to my company that they use often in their profession. If they enter a real ID#

使用真实/假盐而不是锁定

我已经阅读了关于php登录脚本的各种主题,所以我不打算重新讨论这些讨论,但是我想知道在密码哈希中使用真实和假盐。 而不是ID /密码登录提示,我正在考虑ID#/ ID /密码登录提示。 我的用户都有身份证,与他们的职业中经常使用的公司无关。 如果他们输入真正的ID号和登录ID匹配,那么他们会得到真正的盐。 所有不匹配的条目都会导致密码产生假盐。 虽然这些ID号很可能在互联网上获得,但您必须知道用户的名称,这会使所有

Using memcached/APC for session storage?

I had some thoughts back ago about using memcached for session storage, but came to the conclusion that it wouldn't be sufficient in the event of one or more of the servers in the memcached pool were about to go down. A hybrid version is to save the main database (mySQL) from load caused by reads would be to work out a function that tries to fetch the data from the cache pool, and if that f

使用memcached / APC进行会话存储?

我之前曾想过使用memcached进行会话存储的想法,但得出的结论是,如果memcached池中的一个或多个服务器即将停止运行,这样做不够。 混合版本是为了保存主数据库(mySQL)免受读取造成的负载,可以制定一个函数,试图从缓存池中获取数据,如果失败则从数据库中获取数据。 在进行了更多的思考之后,我开始考虑使用APC缓存来处理会话相关数据。 如果我们的Web服务器出现故障,那么会话会丢失,因此将它们存储在本地APC或本地主

Selecting an appropriate cache mechanism

My setup: 4 webservers Static content server (NFS mount) 2 db servers 2 "do magic" servers An additional 8 machines designated multi-purpose. I'm writing a wrapper for three caching mechanisms so that they can be used in a somewhat normalized manner: Filesystem, Memcached and APC. I'm trying to come up with examples for use (and what to actually put in each cache).

选择适当的缓存机制

我的设置: 4个网络服务器 静态内容服务器(NFS安装) 2数据库服务器 2“做魔术”服务器 额外的8台机器被指定为多用途。 我正在为三种缓存机制编写一个包装器,以便它们能够以一种有点标准化的方式使用:Filesystem,Memcached和APC。 我试图提供使用示例(以及实际放入每个缓存的内容)。 文件系统 处理我们生成并静态提供的内容。 RSS提要,旧的报告数据,用户特定的页面等......这些都被缓存到静态服务器。

Limiting login attempts regardless of user?

I have a login system requiring a username and a password. I want to display a captcha after a certain amount of failed login attempts. What is the proper way to implement this? I've read around on this site and some solutions suggest having a 'failed-attempts-count' added to the users table. However, I need the failed attempts to not be tied to a certain user - ie I'd like th

不管用户限制登录尝试?

我有一个需要用户名和密码的登录系统。 我想在一定数量的失败登录尝试后显示验证码。 什么是实施这个的正确方法? 我在这个网站上阅读过,有些解决方案建议在users表中添加一个'failed-attempts-count'。 但是,我需要失败的尝试不被绑定到某个用户 - 即我希望无论输入的用户名是否存在于系统中都显示验证码。 将这个存储在一个会话变量是好的(我正在使用PHP)? 如果是这样,那么根据需要向会话变量中引入数据是

2 Auth Session with CakePHP

I have 2 auth area's in my website. - domain/admin (admin area) - domain/clients (clients area) Admin has a different model and clients has a different model. I am using $this->Auth(); I use the following code to identify If the user is authorized. public function isAuthorized($user) { // Client ACL if ($this->params['controller'] == 'clients'): if (isset($user) &

2与CakePHP的验证会话

我在我的网站有2个认证区域。 - 域/管理员(管理员区) - 域/客户端(客户区) 管理员有不同的模式,客户有不同的模式。 我正在使用$ this-> Auth(); 我使用下面的代码来识别用户是否被授权。 public function isAuthorized($user) { // Client ACL if ($this->params['controller'] == 'clients'): if (isset($user) && !empty($user['business_type'])) { return true;

Security for a single admin website?

A couple weeks ago I decided to learn PHP and make a blog from scratch. Most of the features are completed so now I'm looking at security, specifically for the admin area. As it stands right now, in this admin area I will manage (database) content. I've been reading many articles regarding security, such as: The definitive guide to form-based website authentication http://www.wikih

单个管理网站的安全性?

几个星期前,我决定学习PHP并从头开始创建一个博客。 大多数功能都已完成,所以现在我正在查看安全性,特别是管理区域。 就目前而言,在这个管理区域中,我将管理(数据库)内容。 我一直在阅读很多关于安全性的文章,例如: 基于表单的网站身份验证的权威性指南 http://www.wikihow.com/Create-a-Secure-Login-Script-in-PHP-and-MySQL http://www.wikihow.com/Create-a-Secure-Session-Managment-System-in-PHP-and-M

What is the best method to prevent a brute force attack?

I have my login page and of course I want to prevent brute force attacks and cause less delay for the users when they are logging in. Currently, you type in your username and password to log in. I am considering implementing a reCAPTCHA. However, this shows on login after 3 failed attempts. My question is: What do you base the attempt on. IP addresses? It can always be hidden... userna

防止暴力攻击的最佳方法是什么?

我有我的登录页面,当然我想防止强力攻击,并且在用户登录时减少延迟。 目前,您输入用户名和密码登录。 我正在考虑实施reCAPTCHA。 但是,这显示在3次失败尝试后登录。 我的问题是: 你是以什么为基础的。 IP地址? 它始终可以隐藏...用户名? 如果他们正在尝试一个不存在的用户呢? 计算失败登录尝试次数的最佳方法是什么? 会话不可靠,因为他们依赖于cookie,CAPTCHA经常被破坏[包括ReCAPTCHA]。 唯一可靠