adding check to the key length

In reference to #6722, I humbly submit my first PR.
since the key length is set on line 20, would it make sense here to reference that value rather than hard-coding it into the string?