private byte [] editKey(byte [] key)
    {
        if (key == null) { return null; }
        byte [] result = new byte [DEFAULT_KEY.length];
        for (int x=0; x<DEFAULT_KEY.length; x++)
        {
            result[x] = x < key.length ? key[x] : DEFAULT_KEY[x];
        }
        return result;
    }
Validates an optional user-defined encryption key. Only the
first sixteen bytes of the input array will be used for the key.
It will be filled (if necessary) to a minimum length of sixteen.

@param key The user-defined encryption key
@return A valid encryption key, or null
xmppserver/src/main/java/org/jivesoftware/util/AesEncryptor.java