Use SHA512
with bcrypt_encode()
function for passwords and checksums.
For other specific data use with own SALT from PHP file + encode with some mechanism base64_encode($your_db_table_data) + "MY_SALT_FROM_WEB".
And backwards, base64_decode($your_db_table_data) + MY_SALT_FROM_WEB
.
You can use gzdeflate
which decrpyt and compress your data + use salt to make hard to decrypt. Example:
$data = gzdeflate($your_data) + YOUR_SALT;
This will produce as simple like in database: ��O�KWH�KQpI�r\���*JZ<��AR
For decoding deflate use as: gzinflate(gzdeflate($your_data_from_db + YOUR_SALT_FROM_WEB));
This is reference: http://php.net/manual/en/function.gzinflate.php
If you want more complicate decoding use for char and smaller data base64_enocode / base64_decode + YOUR_SALT_HIDDEN_FROM_WEB with data in database for CHAR() and smaller texts.
This is my idea how would I encrpyted data in database for VARCHAR() usage. For text data use encrpypted way with compression with combination of SALT.
I have currently no idea another solution, or checkout encrypt MySQL data using AES technics: http://thinkdiff.net/mysql/encrypt-mysql-data-using-aes-techniques/
This uses AES_ENCRYPT
and AES_DECRYPT
integrate in MySQL but this is limited to VARBINARY(150) or VARCHAR(100). Using compression with encrpyted method can do this instead using integrated MySQL AES
functions.
Hope this some helps.