I think you're making a mistake somewhere down the line
See here
https://en.wikipedia.org/wiki/MD5and here
https://docs.microsoft.com/en-us/dotnet/api/system.security.cryptography.md5?view=net-5.0The hash size for the MD5 algorithm is 128 bits.
here
https://docs.microsoft.com/en-us/dotnet/api/system.security.cryptography.sha256?view=net-5.0The hash size for the SHA256 algorithm is 256 bits.
__________
>Well that is wierd - I checked and the function I am using to bridge to the hash function in .net definitely returns 24 bytes for MD5 and 44 for SHA256. Will have to wait until Rick jumps in - maybe I am using his function wrong.
>
>Albert
>
>
>>MD5 gives a 16 byte hash (128 bits)
>>SHA256 gives a 32 byte has ( 256 bits)
>>_
>>
>>>For this implementation, I am using keys of about 54-55 characters. But in the .net class, this must then be hashed to get a standard size and then the hash must be used for the actual encryption key.
>>>
>>>I can pass in hashing algo as MD5 or SHA1 or SHA256 as part of the call (via the bridge class) but those yield hashes of 24, 28 or 44 bytes each (192, 244,352 bits respectively). So none of them would yield 128 or 256 bit keys.
>>>
>>>In other words, not sure how the .net class uses different key lengths that are passed.
>>>
>>>Albert
>>>
>>>>
>>>>AES is a subset of Rijndael where the blocksize is limited to 16 bytes ( or 128 bits)
>>>>What you see is the keySize in bits: 128, 192 or 256
>>>>
>>>>So, when .Net says AES, the only thing you know is that the block size is 16 bytes. The key size depends on how the class is used
>>>>
>>>>Further reading
https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.197.pdf
Gregory