Page 1 of 1

Encrypt Value before insert in to table

Posted: 2014-06-28 09:39
by treisser
i am very little experience with php and still new with AppGini,
i would appreciate any help to solve following.
I have a table where i want to store Credentials and Password. I like to encrypt these Password when the User adds a Record and store them encrypted in the table. I nedd to decrypt them for use in bash script connected to this sql Database.
i'd like to encrypt and decrypt with AES_ENCRYPT and AES_DECRYPT
tanks a lot for any help.

Re: Encrypt Value before insert in to table

Posted: 2014-06-28 11:19
by treisser
My Aproach is following command:
sql("update `Credentials` set `PASSWORD`= AES_ENCRYPT('{$data['PASSWORD']}','key:MySecretKey') where `ID`='{$data['selectedID']}'", $eo);
but i get only a single character in the PASSWORD table for this record.
Please Help

Re: Encrypt Value before insert in to table

Posted: 2014-06-28 12:20
by treisser
solved myself,
changed table to varbinary :D