Posts Tagged ‘base64’

How to obfuscate MySQL password

Sunday, May 10th, 2009

password-code-banner-454x84

Ever since I started using PHP and MySQL I felt a bit uncomfortable about my password being shown plain text. Here is a quick idea how to obfuscate it using base64 encoding.

/** MySQL database password */
define(‘DB_PASSWORD’, base64_decode("cGFzc3dvcmQ="));

To make it easier (and as a part of  getting familiar with Qt framework) I wrote small application to encode/decode my password:

DontLook64

Feel free to use it.

Application is written using Qt 4.5.1 framework and compiled for Windows, Mac OS and Linux.

Download: