close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Data Assist Update with AES_ENCRYPT?

Thread began 5/24/2014 2:37 pm by carl181913 | Last modified 2/11/2015 5:48 pm by stephen287384 | 4830 views | 10 replies |

carl181913

Data Assist update record with AES_ENCRYPT?

I am trying to add AES_ENCRYPT to the "busNum" field in the snippet of code below generated by Data Assist update record:

------
$WA_fieldNamesStr = "cartoff|busCardName|busCard|busNum|busXmon|busXyear|busCode|busCardReset|payUpdate";
$WA_fieldValuesStr = "" . "|" . "".((isset($_POST["busCardName"]))?$_POST["busCardName"]:"") ."" . "|" . "".((isset($_POST["busCard"]))?$_POST["busCard"]:"") ."" . "|" . "".((isset($_POST["busNum"]))?$_POST["busNum"]:"") ."" . "|" . "".((isset($_POST["busXmon"]))?$_POST["busXmon"]:"") ."" . "|" . "".((isset($_POST["busXyear"]))?$_POST["busXyear"]:"") ."" . "|" . "" . "|" . "" . "|" . "";
$WA_columnTypesStr = "',none,''|',none,''|',none,''|',none,''|',none,''|',none,''|',none,''|',none,''|',none,''";
$WA_comparisonStr = "=|=|=|=|=|=|=|=|=";

-------

I saw a previous post that said to try the following but it returns an error so the syntax must be wrong:
((isset($_POST["busNum"]))?AES_ENCRYPT($_POST["busNum"], 'encryptkey'):"")

I am using PHP & MySQL

Any help would be GREAT!

Sign in to reply to this post

Jason ByrnesWebAssist

  I saw a previous post that said to try the following but it returns an error so the syntax must be wrong:
((isset($_POST["busNum"]))?AES_ENCRYPT($_POST["busNum"], 'encryptkey'):"")  



not necessarily. The syntax looks OK to me, what did the error say exactly?

Sign in to reply to this post

carl181913

Originally Said By: Jason Byrnes
  not necessarily. The syntax looks OK to me, what did the error say exactly?  



I am not seeing a specific error just the page will not load and it fails to update the record. If I remove the code and put it back to ((isset($_POST["busNum"]))?$_POST["busNum"]:"") the page loads fine and the record updates just not encrypted.

Here is what the code looks like when I add the AES_ENCRYPT:

$WA_fieldNamesStr = "cartoff|busCardName|busCard|busNum|busXmon|busXyear|busCode|busCardReset|payUpdate";
$WA_fieldValuesStr = "" . "|" . "".((isset($_POST["busCardName"]))?$_POST["busCardName"]:"") ."" . "|" . "".((isset($_POST["busCard"]))?$_POST["busCard"]:"") ."" . "|" . "".((isset($_POST["busNum"]))?AES_ENCRYPT($_POST["busNum"], 'encryptkey'):"") ."" . "|" . "".((isset($_POST["busXmon"]))?$_POST["busXmon"]:"") ."" . "|" . "".((isset($_POST["busXyear"]))?$_POST["busXyear"]:"") ."" . "|" . "" . "|" . "" . "|" . "";
$WA_columnTypesStr = "',none,''|',none,''|',none,''|',none,''|',none,''|',none,''|',none,''|',none,''|',none,''";

Sign in to reply to this post

Jason ByrnesWebAssist

I'll need to troubleshoot directly, see the private message section.

Sign in to reply to this post

carl181913

here you go...

Sign in to reply to this post

Jason ByrnesWebAssist

you are confusing MySQL funcitons and PHP functions.

AES_ENCRYPT() is a MySQL function, not a PHP funciton.

in php you can use mcrypt_encrypt and use the RIJNDAL encryption method which is AES compliant, but PHP does not have a AES_ENCRYPT() funciton


http://us2.php.net/manual/en/function.mcrypt-encrypt.php

Sign in to reply to this post

carl181913

Ok, I see what you mean now. I took a look at the php mcrypt_encrypt function but still having an issue with how to implement in the data assist code. Do you have any code examples of how to do this?

Sign in to reply to this post

Jason ByrnesWebAssist

In the Data Bridge insert record behavior, when you select a binding, change the format list to use RIJNDAL Encryption.

Sign in to reply to this post

carl181913

I don't have data bridge just Data Assist. Is there any way to modify the the Data Assist code to use AES_ENCRYPT function when saving to MySQL? The reason I ask is because I was able to get the RIJNDAL Encryption to work but the problem is that the data is already encrypted using AES and I can't get RIJNDAL Encryption to encrypt/decrypt in the same way.

Sign in to reply to this post

Jason ByrnesWebAssist

Encryption is a part of Security Assist.

to use it Data Assist without having security assist would require unsupported custom coding.

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