Questions tagged [rijndaelmanaged]

.NET Framework (1.1 and later) managed version of the Rijndael (AES) algorithm.

.NET Framework (1.1 and later) managed version of the Rijndael (AES) cryptographic algorithm. Any public static (Shared in VB) members of this type are thread safe.

Class: System.Security.Cryptography.RijndaelManaged

258 questions
118
votes
10 answers

Using AES encryption in C#

I can't seem to find a nice clean example of using AES 128 bit encryption. Does anyone have some sample code?
YOYO
55
votes
5 answers

Specified key is not a valid size for this algorithm

I have with this code: RijndaelManaged rijndaelCipher = new RijndaelManaged(); // Set key and IV rijndaelCipher.Key = Convert.FromBase64String("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz012345678912"); …
user278618
  • 16,934
  • 41
  • 117
  • 192
39
votes
3 answers

Passphrase, Salt and IV, do I need all of these?

If I am using Rijndael CBC mode, I have no idea why we would need salt. My understanding is even if people know the password, but he cannot get the data without IV. So from my perspective, password + IV seem to be sufficent secure. Do I get anything…
Kelvin
  • 993
  • 2
  • 10
  • 16
34
votes
3 answers

Specified initialization vector (IV) does not match the block size for this algorithm

I am working on a base encryption method. I am using RijndaelManaged. I got this code from somewhere a long time ago, but can't remember where. I had my code working before, but something changed and I cannot quite figure it out. When I run my code,…
Vladimir Kozhedubov
33
votes
3 answers

Why are RijndaelManaged and AesCryptoServiceProvider returning different results?

Here is the example that I have run. It has the same Mode, Padding, BlockSize, KeySize. I am using the same init vector, key and data. Using the RijndaelManaged produces an encrypted value…
SwDevMan81
  • 45,922
  • 20
  • 140
  • 177
20
votes
1 answer

RijndaelManaged supports 128-256 bit key, what key size the default constructor generator?

For new RijndaelManaged(), the documentation says it supports keys of 128 bits and up to 256 bits. When you instantiate new RijndaelManaged(), it creates the Key and IV for you. What size does it default to, 128 bits?
Blankman
19
votes
3 answers

When will C# AES algorithm be FIPS compliant?

Right now the only way I can get the RijndaelManaged algorithm to work on a computer with the Local Security Setting for FIPS turned on, is to disable it. It is a government computer, so I'm not sure how that will fly. I've seen posts on the msdn…
SwDevMan81
  • 45,922
  • 20
  • 140
  • 177
17
votes
7 answers

Difference between symmetric crypto algorithms

C# looks to have 4 different symmetric crypto algorithms: RijndaelManaged, DESCryptoServiceProvider, RC2CryptoServiceProvider, and TripleDESCryptoServiceProvider. I am looking for more information between them. Mainly what is the differences…
Tony
  • 1,624
  • 16
  • 26
17
votes
2 answers

How to use Rijndael encryption with a .Net Core class library? (Not .Net Framework)

How do we use Rijndael encryption in a .Net Core class library? (Not a .Net Framework Class Library) We need to create a shared .Net Core library for use in multiple projects and need to implement Encrypt and Decrypt methods that use the same…
Ensunder
  • 283
  • 1
  • 3
  • 8
15
votes
3 answers

Thread Safety of .NET Encryption Classes?

I have a high-level goal of creating a static utility class that encapsulates the encryption for my .NET application. Inside I'd like to minimize the object creations that aren't necessary. My question is: what is the thread-safety of the classes…
mckamey
  • 16,875
  • 15
  • 76
  • 114
15
votes
3 answers

RijndaelManaged "Padding is invalid and cannot be removed" that only occurs when decrypting in production

I know other questions have been asked on this but none so far have provided a solution or are exactly the issue I have. The class below handles the encryption and decryption of strings, the key and vector passed in are ALWAYS the same. The strings…
Nick Allen
  • 10,850
  • 9
  • 40
  • 57
14
votes
1 answer

Getting SlowAES and RijndaelManaged class in .NET to play together

I'm trying to setup AES encryption / decryption using the javascript library SlowAES and the RijndaelManaged class in .NET. I chose this method after reading this post, where Cheeso has managed to get these two encryption methods to play together …
Bob
12
votes
4 answers

Length of the data to decrypt is invalid

I'm trying to encrypt and decrypt a file stream over a socket using RijndaelManaged, but I keep bumping into the exception CryptographicException: Length of the data to decrypt is invalid. at…
Patrick
  • 16,618
  • 5
  • 65
  • 82
11
votes
1 answer

When would I choose AesCryptoServiceProvider over AesManaged or RijndaelManaged?

I think the distinguishing factors are AesCryptoServiceProvider is FIPS compliant AesManaged is cross-platform, requires .NET 3.0 RijndaelManaged runs on .NET 2.0, requires restricting the blocksize is that about right?
Cheeso
  • 180,104
  • 92
  • 446
  • 681
10
votes
6 answers

C# AES Rijndael - detecting invalid passwords

I'm using Rijndael to encrypt some sensitive data in my program. When the user enters an incorrect password, most of the time a CryptographicException is thrown with the message "Padding is invalid and cannot be removed.". However, with very small…
Ozzah
  • 10,386
  • 15
  • 69
  • 112
1
2 3
17 18