PHP and MySQL – how to avoid password in source code? [duplicate]

The easiest way is, like you said, to use a configuration file. Many frameworks use this (Zend, CakePHP, Kohana, etc) and it’s the most common way of doing things (even in a non-PHP environment such as ASP.NET with its web.config files). This allows you also to copy over configuration values from environment to environment by … Read more

HTTP authentication logout via PHP

Mu. No correct way exists, not even one that’s consistent across browsers. This is a problem that comes from the HTTP specification (section 15.6): Existing HTTP clients and user agents typically retain authentication information indefinitely. HTTP/1.1. does not provide a method for a server to direct clients to discard these cached credentials. On the other … Read more

SQLite with encryption/password protection

SQLite has hooks built-in for encryption which are not used in the normal distribution, but here are a few implementations I know of: SEE – The official implementation. wxSQLite – A wxWidgets style C++ wrapper that also implements SQLite’s encryption. SQLCipher – Uses openSSL’s libcrypto to implement. SQLiteCrypt – Custom implementation, modified API. botansqlite3 – … Read more

How do you use bcrypt for hashing passwords in PHP? [duplicate]

bcrypt is a hashing algorithm which is scalable with hardware (via a configurable number of rounds). Its slowness and multiple rounds ensures that an attacker must deploy massive funds and hardware to be able to crack your passwords. Add to that per-password salts (bcrypt REQUIRES salts) and you can be sure that an attack is … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)