Posts

Showing posts from January, 2013

Encrypt MySQL data using AES techniques

CREATETABLE`user` ( `id` BIGINTUNSIGNED NOTNULLAUTO_INCREMENT , `first_name` VARBINARY(100) NULL, `address` VARBINARY(200) NOTNULL, PRIMARYKEY(`id`) ENGINE = InnoDB DEFAULTCHARACTERSET= utf8 COLLATE= utf8_general_ci You may be expected the table structure should be:









CREATETABLE`user` ( `id` BIGINTUNSIGNED NOTNULLAUTO_INCREMENT , `first_name` VARCHAR(50) NULL, `address` VARCHAR(100) NOTNULL, PRIMARYKEY(`id`) ENGINE = InnoDB DEFAULTCHARACTERSET= utf8 COLLATE= utf8_general_ci To encrypt & decrypt mysql data we will use AES_ENCRYPT() and AES_DECRYPT() functions. These functions used the official AES (Advanced Encryption Standard) algorithm & encode data with a 128-bit key length. 128 bits is much faster and secure enough for most purposes.

Why we used VARBINARY data type instead of VARCHAR:
Because AES_ENCRYPT() encrypts a string and returns a binary string. AES_DECRYPT() decrypts the encrypted string and returns the original string.
AES is a block-level algorithm. So when data encrypted it …

How to Share Your 3G/4G Data Card Over Wifi with Ubuntu Linux