Legal Key Sizes - AArnott/PCLCrypto GitHub Wiki
Cryptographic keys must be of a particular length, which varies based on the cryptographic algorithm used and sometimes the underlying implementation. You may find this MSDN article's sample .NET Framework console application useful in determining valid key sizes.
Note that keys should not simply be a user password. Use a key derivation algorithm to transform a user password to a cryptographic key of fixed length.