Added support for configurable key size.