Trim the AES key to size (256 bits)

This is the same behaviour as ruby OpenSSL