I have next code on .net 6:
using var algorithm = TripleDES.Create();
var bytes1 = Encoding.UTF8.GetBytes(Keys.CryptKey);
var bytes2 = Encoding.UTF8.GetBytes(Keys.Crypt4);
using var transform = algorithm.CreateEncryptor(bytes1, bytes2);
algorithm.Mode = CipherMode.ECB;
var buffer = Encoding.UTF8.GetBytes(text);
var outBuffer = transform.TransformFinalBlock(buffer, 0, buffer.Length);
return Convert.ToBase64String(outBuffer);
It works on .net framework 4.8.
bytes1 and bytes2 are 24 length
When I create an encryptor, I get this error: Specified initialization vector (IV) does not match the block size for this algorithm. (Parameter 'rgbIV')'
I tried to set keys to 8 and 16 length