Added Key Length Checking