Rijndael 256 encryption: Java and .NET do not match Rijndael 256 encryption: Java and .NET do not match powershell powershell

Rijndael 256 encryption: Java and .NET do not match


Your results are the same, as far as I can see - it's just that in Java, bytes are signed. (That's icky, but it doesn't affect the actual bits you're getting.)

If you add 256 to every negative value in the Java results, you'll see they're the same as the .NET code:

.NET:      241  100  194  184  166Java:      -15  100  -62  -72  -90Java+256:  241  100  194  184  166for -ve

(etc)

Alternatively, just print out the unsigned hex representation of the two byte arrays - or even base64-encode them - and you'll see they're the same.