Tag Archives: Dreamweaver
Add Password Encryption to a Dreamweaver Registration Form
Adding password encryption to a Dreamweaver registration form is even easier than adding encryption to a Dreamweaver login form. Much like changing the Dreamweaver login form to add encryption, changing the registration form will also cause an error (according to Dreamweaver) but regardless this method should work just fine. After inserting the code mentioned below you should not attempt to modify this registration script via the insert record dialog provided by Dreamweaver. Instead, edit the code manually when making changes.
Example code snippet:
$insertSQL = sprintf("INSERT INTO users (username, password) VALUES (%s, %s)"
Change your code to add “sha1″ or “md5″ depending on what type of encryption you wish to use:
$insertSQL = sprintf("INSERT INTO users (username, password) VALUES (%s, sha1(%s))"
Add Password Encryption to a Dreamweaver Login Form
With two simple changes you can add password encryption to your Dreamweaver login form. Dreamweaver will consider this an error and display two login user behaviors but regardless this method should work just fine. After inserting the code mentioned below you should not attempt to modify this login script via the log in user dialog provided by Dreamweaver. Instead, edit the code manually when making changes.
Right after the line of code:
$password=$_POST['password'];
Add this:
$encrypt_password=sha1($password);
You can add whatever type of encryption you would like in place of sha1.
Change this bit of code:
GetSQLValueString($loginUsername, "text"), GetSQLValueString($password, "text"));
Replace $password with $encrypt_password:
GetSQLValueString($loginUsername, "text"), GetSQLValueString($encrypt_password, "text"));
Conclusions: When sending password data over the internet it is always important to encrypt it. In case anyone hacks your server and reads the password database this is a safety net. Providing how simple this is to change I would have thought Adobe would have built this into Dreamweaver. We can probably expect this in a future release.