I am trying to read a Base64-Encoded value from a Database table managed on the Linux side. In that table there is a column called first_name. On the Linux side I can decrypt t
I hit the same problem when comunicating with a legacy system. I had to come up with my own solution as Rijndael with a Blocksize of 256 seems to be not supported by dotnet core.
Here is my solution using the bouncy castle library:
public static byte[] Rijandael256Decrypt(byte[] inputBytes, byte[] keyBytes)
{
// set up
IBufferedCipher cipher = new PaddedBufferedBlockCipher(new RijndaelEngine(256), new ZeroBytePadding());
KeyParameter keyParam = new KeyParameter(keyBytes);
cipher.Init(false, keyParam);
int sizeAtLeastRequired = cipher.GetOutputSize(inputBytes.Length);
byte[] outputBytes = new byte[sizeAtLeastRequired];
// decrypt
int length = cipher.ProcessBytes(inputBytes, outputBytes, 0);
length += cipher.DoFinal(outputBytes, length);
// resize output
Array.Resize(ref outputBytes, length);
return outputBytes;
}