Encrypt Value before insert in to table

Discussions related to customizing hooks. Hooks are documented at http://bigprof.com/appgini/help/advanced-topics/hooks/
Post Reply
treisser
Posts: 7
Joined: 2014-06-28 08:56

Encrypt Value before insert in to table

Post by treisser » 2014-06-28 09:39

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.

treisser
Posts: 7
Joined: 2014-06-28 08:56

Re: Encrypt Value before insert in to table

Post by treisser » 2014-06-28 11:19

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

treisser
Posts: 7
Joined: 2014-06-28 08:56

Re: Encrypt Value before insert in to table

Post by treisser » 2014-06-28 12:20

solved myself,
changed table to varbinary :D

Post Reply