Rijndael Encryption and Decryption in C# and Powershell

This is an example of how we can perform Rijndael encryption and decryption in C# and Powershell. It’s worth mentioning that:

– salt must be 8 bytes minimum
– initVector must be 16 bytes minimum

The examples below use Cipher Block Chaining (CBC), zero padding, 10000 key iterations and 32 byte (256/8) block cipher.



and call using:

One thought on “Rijndael Encryption and Decryption in C# and Powershell

  1. Hello Kae,

    thanks for this nice piece of code.

    When i use the c# Function to encrypt and use the Powershell Function to decrypt, i get a Result like this “�V��m�8�”. Vice versa is the same.

    Where is my fault?

    Kind Regards

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.