Search code examples
phpsql-serverencryptionpropel

Ms SQL Encryption and Propel


i'm new to ms sql and have a question concerning the possibilities to symmetric encryt a column.

For example i have a column for a ftp connection password which is stored in plaintext at the moment. I want to change this but i have to convert it to plaintext again when i'm using it in my php code. How can i solve such a problem?

(I'm working with the php orm framework Propel)

Thx for any advice.


Solution

  • The safest solution (in my opinion) is to encrypt and decrypt within PHP, thus ensuring each password is stored as plain text for the shortest possible time.

    Therefore, I'd recommend throwing your passwords through mcrypt and the strongest algorithm possible:

    The first link has sample code that you should be able to use. Note that you would need to ensure the security of your PHP code in this case, or at least that of any encryption keys that you use.