close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Manually changing to encryption

Thread began 10/17/2019 2:48 pm by EmmaMorris | Last modified 11/07/2019 11:20 am by Ray Borduin | 671 views | 9 replies |

EmmaMorris

Manually changing to encryption

I am trying to convert one of my database login pages to encryption instead of plain text.
I have no pc with Windows on it at this point in time so I am trying to do it manually.

I created a separate add user page that is using 'password_hash' and verified that part works properly.

My question is this... Here is the line of webassist code

$Authenticate->addFilter("passwd", "=", "s", "".((isset($_POST["Password"]))?$_POST["Password"]:"") ."");

and here is what I changed it to..

$Authenticate->addFilter("passwd", "=", "s", "".((isset($_POST["Password"]))?password_hash($_POST["Password"], PASSWORD_DEFAULT):"") ."");

I am not getting any errors now but it will not log in... Is there a glaring error anywhere.. What am I missing?

Hoping to get a Windows pc set back up soon but in the mean time I would like this part fixed if possible

Thanks.
Emma.

Sign in to reply to this post

Ray BorduinWebAssist

The UI doesn't fully support hashed passwords, so you have to change the code manually... Update this:

$Authenticate->addFilter("passwd", "=", "s", "".((isset($_POST["Password"]))?password_hash($_POST["Password"], PASSWORD_DEFAULT):"") ."");

to:

$Authenticate->addHash("passwd", "".(isset($_POST["Password"])?$_POST["Password"]:"") ."");

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

EmmaMorris

Coming up with this error now.

Sign in to reply to this post

Ray BorduinWebAssist

What version of the authentication.php file do you have? I added the addHash() capability later, maybe you have to install the latest version of DataBridge to get the latest version of that file. I'll send you my version.

Attached Files
authentication.php
Sign in to reply to this post
Did this help? Tips are appreciated...

EmmaMorris

I had v1.16. I swapped it out. I get no error but it will not login with a logon/pw that I know are encrypted with the password_hash.

Unless you have another easy idea, I dont want to waste any more of your time. I will have to get a pc up and running with Windows and get Databridge reinstalled. I may have a vm with it on it so I will find out.

Thanks for your help!

Emma

Sign in to reply to this post

Ray BorduinWebAssist

I actually had a mistake in the line of code I gave you. I've corrected it in the post above if you want to try again.

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

EmmaMorris

That did it.. Thank you so much...

I still need to do the add and edit user pages but that can wait until I get it the software reinstalled... I have another page to add them with encryption

Have a great rest of the week!
Emma

Sign in to reply to this post

EmmaMorris

Encryption on insert/update pages

So I have the login page working fine with encrypted passwords. Have not been able to get it going on the insert and update pages.
My question is this, Can I just tweak those similar lines on the insert and update pages or will more be involved.?

This is the code you gave me for the login page.
$Authenticate->addHash("passwd", "".(isset($_POST["Password"])?$_POST["Password"]:"") ."");

Below are the passwd lines from the update and insert page

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

$InsertQuery->bindColumn("passwd", "s", "".((isset($_POST["Password"]))?$_POST["Password"]:"") ."", "WA_DEFAULT");

Thanks so much for your help.

Emma

Sign in to reply to this post

Ray BorduinWebAssist

Use:

php:
$UpdateQuery->bindColumn("passwd", "s", "".((isset($_POST["Password"]))?password_hash($_POST["Password"], PASSWORD_DEFAULT):"") ."", "WA_IGNORE");


$InsertQuery->bindColumn("passwd", "s", "".((isset($_POST["Password"]))?password_hash($_POST["Password"], PASSWORD_DEFAULT):"") ."", "WA_DEFAULT");
Sign in to reply to this post
Did this help? Tips are appreciated...

EmmaMorris

Thanks for the quick reply!
I was close.. I tried it but it was in the wrong spot...
Works perfect.

Thanks again! Saved me a BUNCH of time.

Emma

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...