I'm using mysql aes to encrypt and decrypt like this:
AES_ENCRYPT('text to encrypt','key')
CAST(AES_DECRYPT(field_name, 'key') AS CHAR (50))
I've read that AES supports 128 192 and 256. Am I correct in assuming that the default unless otherwise changed is 128? Therefore, seeing as the above queries do not define key length will it encrypt and decrypt in the default key length?
If so would it be better to specify the key length in the above queries? Because for example: lets say I encrypt and store data using the default which is 128, but then later the settings change and 256 becomes default, then that means that it will not be able to decrypt it right? Is there a way to define the key length in the above query?
Also, does the pass-key that I use for encryption have to match the key length? for example if i am using 128 key length, does my pass-key need to be below or equal to 128 bit?