encryption key length fixed

In you original code if the length of the key was16 or 24 it would be increased to then next acceptable length.