CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 How to encrypt the values in the Login form

Print topic Send  topic

Author Message
Joseph Gilbert-Baffoe
Posted: 01/08/2004, 12:02 AM

Hi,
I am using CodeChargeStudio for the first time, I have selected the "PHP 4.0
with Templates" option with MYSQL as the database. I am using
CodeChargeStudio2.2.3.

I have an application with the login id and password and several other
fields encrypted in the database using AES_ENCRYPT ("value", key) where
value is the data to be encrypted and key is the code used by AES_ENCRYPT to
encrypt value.

My problem is with the CodeChargeStudio login form; how can I get the values
entered on the login form to be encrypted with AES_ENCRYPT before they are
compared with the encrypted data in the database?

Any help in resolving this is greatly appreciated.

Thanks in advance.

--

Regards,
Joseph Gilbert-Baffoe
Nimrix, Inc


feha


Posts: 712
Posted: 01/08/2004, 12:54 AM

Use Before Insert or Before Update Event
_________________
Regards
feha

www.vision.to
feedpixel.com
View profile  Send private message
Al
Posted: 01/08/2004, 7:31 AM

You can add the custom code into the login OnClick event above login action and write the following code:

global $DBConnection1;
$new_pass = CCDLookUp("AES_ENCRYPT ($form_name->password->GetValue(), $key)","","',$DBConnection1);
$form_name->password->SetValue($new_pass);

Joseph Gilbert-Baffoe
Posted: 01/09/2004, 11:28 PM

Hi,

Looks like I am missing something in the custom code, the
"CCDLookUp("AES_ENCRYPT ($form_name->password->GetValue()" part is not
returning a value.

I tried different options like using single quotes and combining single and
double quotes but non seem to get the CCDLookUp to return a value.
$ekey returns the expected value of 'somestring'.

I already declared all the variables as global.

This is what I have ...
$new_login = CCDLookUp("AES_ENCRYPT($Login->loginid->GetValue(),
$ekey)","","",$DBConnection1);
echo "***".$new_login."***";
$Login->loginid->SetValue($new_login);
$new_pass = CCDLookUp("AES_ENCRYPT($Login->password->GetValue(),
$ekey)","","",$DBConnection1);
$Login->password->SetValue($new_pass);
echo "****".$new_pass."****";


And this is the result...
Debug: query = SELECT AES_ENCRYPT(Object->GetValue(), 'somestring')
Database error: Invalid SQL: SELECT AES_ENCRYPT(Object->GetValue(),
'somestring')

Any clue as to what is missing from my statement?

Thanks againg for your assistance
--

Regards,
Joseph Gilbert-Baffoe
Nimrix, Inc


"Al" <Al@forum.codecharge> wrote in message
news:53ffd77b975365@news.codecharge.com...
> You can add the custom code into the login OnClick event above login
action and write the following code:
>
> global $DBConnection1;
> $new_pass = CCDLookUp("AES_ENCRYPT ($form_name->password->GetValue(),
$key)","","',$DBConnection1);
> $form_name->password->SetValue($new_pass);
>
>
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>

Nicole

Posts: 586
Posted: 01/13/2004, 6:36 AM

Joseph,
In fact you have to use both suggestions:
1. encrypt the value in the Before Build Insert/Update events while updating the users table;
2. encrypt the password in the onClick event of Login button

_________________
Regards,
Nicole
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright 2003-2004 by UltraApps.com  and YesSoftware, Inc.