close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Encrypting Passwords (Insert Records/Authenticate)

Thread began 3/07/2019 8:53 am by LWat85283715 | Last modified 3/07/2019 12:29 pm by Ray Borduin | 2047 views | 17 replies |

LWat85283715

Encrypting Passwords (Insert Records/Authenticate)

How do I encrypt passwords and insert them into a database and then export them out to authenticate? Under Security Assist, there are no options listed. Thank you.

Sign in to reply to this post

Ray BorduinWebAssist

The encryption options are displayed in the bindings window in the "Format" select list. If you open your webassist insert record server behavior and click the lightning bolt to set a value for a column. The bindings window will open with a "Format" option. That should have the encryption options listed in it. If they aren't listed let me know and I can help you get them added back in.

Sign in to reply to this post
Did this help? Tips are appreciated...

LWat85283715

The only options are text, integer, double, date, checkbox. So, it looks like I am missing those. When it comes to authenticating the user, is there an option on that side on the login screen that I also should see to decipher the encryption?

Sign in to reply to this post

Ray BorduinWebAssist

The dropdown is in the popup after clicking the lightning bolt. I think you are looking at the wrong list.

Sign in to reply to this post
Did this help? Tips are appreciated...

LWat85283715

Oh. I see it. For a password, would I choose Encode: HTML Encode? I have alphacase, encode, and trim as the options.

Sign in to reply to this post

Ray BorduinWebAssist

You should have more options.

Try replacing the file in your local user's configuration folder for Dreamweaver CS4:
C:/Users/[YOUR USERNAME]/AppData/Roaming/Adobe/Dreamweaver CS4/en_US/Configuration/ServerFormats/PHP_MySQL/Formats.xml

Attached Files
Formats.xml
Sign in to reply to this post
Did this help? Tips are appreciated...

LWat85283715

That worked. I see Encryption hashed on there. So, my next issue is that since this is a live site, there are already passwords in the database saved with out being hashed. Do I have to convert them somehow for the system to be able to authenticate these now before I change the Insert record and authenticate code to use the Encrypt: hash format?

Do I just run this on the database:

update nameoftable set password=sha1(password) where 1;

Also when selecting that format should the binding code be different then this? This is what I get.

$UpdateQuery->bindColumn("password", "s", "".((isset($_POST["password"]))?$_POST["password"]:"") ."", "WA_IGNORE");

Sign in to reply to this post

Ray BorduinWebAssist

I'd back up the database first, since that would be a disaster if it didn't work properly or if you accidentally ran the query twice, but yes.

Honestly I'd create a copy of the table and then create a second login page to make sure everything works with the second table before making any changes live.

Sign in to reply to this post
Did this help? Tips are appreciated...

LWat85283715

Ok. I will give that a try. Thanks

Sign in to reply to this post

LWat85283715

I copied the table in the database and converted them to hash. I made a test login page and It doesn't seem to work. Any thoughts?. I did a test and here is the login code:

<?php
if (isset($_POST["submit"]) || isset($_POST["submit_x"])) {
$Authenticate = new WA_MySQLi_Auth($sdpc_i);
$Authenticate->Action = "authenticate";
$Authenticate->Name = "sdpc_login_test";
$Authenticate->Table = "users2";
$Authenticate->addFilter("username", "=", "s", "".((isset($_POST["username"]))?$_POST["username"]:"") ."");
$Authenticate->addFilter("password", "=", "s", "".((isset($_POST["password"]))?$_POST["password"]:"") ."");
$Authenticate->AutoReturn = false;
$SuccessRedirect = "index.php";
$FailedRedirect = "error.php";
if (function_exists("rel2abs")) $SuccessRedirect = $SuccessRedirect?rel2abs($SuccessRedirect,dirname(__FILE__)):"";
if (function_exists("rel2abs")) $FailedRedirect = $FailedRedirect?rel2abs($FailedRedirect,dirname(__FILE__)):"";
$Authenticate->SuccessRedirect = $SuccessRedirect;
$Authenticate->FailRedirect = $FailedRedirect;
$Authenticate->execute();
}
?>

Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...