Popular posts from this blog
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 …
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 …
String is an immutable class while StringBuilder & StringBuffer are mutable classes. StringBuffer is synchronized while StringBuilder is not.
ReplyDeleteBelow link can be useful to find more differences between String, StringBuffer & StringBuilder
Difference between String, StringBuffer and StringBuilder
http://newtechnobuzzz.blogspot.com/2014/07/difference-between-string-stringbuffer.html
This is very nice article about Java String vs StringBuffer .
ReplyDeletethanks for this nice post.