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

269 questions
1
vote
1 answer

C# rijndael CryptoStream can I write to file bits and bits like the way textwriter does?

Was stuggling in how to encrypt 2 strings together. Because I add bits and bits string in real time (by str = str + bitString;) and at the end. I generate the string and encrpt it. Now the question is can I encypt and write the bitString in real…
Kelvin
  • 1,103
  • 2
  • 11
  • 16
1
vote
1 answer

ASP.NET Rijndael Decryption Error: Length of the data to decrypt is invalid

OK, so having just got the key to be accepted and have an encrypted string out which is 44 char long, I now am unable to decrypt (aarrgghh): Length of the data to decrypt is invalid. Having looked around and read various posts it looks as though the…
Chris
  • 1,324
  • 5
  • 18
  • 29
1
vote
1 answer

How to decrypt a string in cobol

i'm looking for ways to decrypt a string in cobol that was encrypted in .net using RijndaelManaged. I have control of the algorithm so it doesn't need to be Rijdnael, but i just need to ensure that the data is encrypted. Any help advice is…
Sean Rock
  • 113
  • 9
1
vote
1 answer

How to append a RijndaelManaged generated IV to data for AES decryption in C#

I am needing some help with AES encryption/decryption in C#. Specifically, I want to generate an IV with RijndaelManaged, convert it to text, and store the IV with the encrypted text in the database. I want to append the IV to the beginning of the…
user2582003
  • 11
  • 1
  • 2
1
vote
1 answer

padding is invalid and cannot be removed ERROR firing at cs.FlushFinalBlock() line

I am trying to use the Rijndael method to encrypt and decrypt data. It encrypts fine but when I try to decrypt it it gives padding is invalid and cannot be removed at the line cs.FlushFinalBlock(); in the private static byte[] DecryptString(byte[]…
Hasitha Shan
  • 2,900
  • 6
  • 42
  • 83
1
vote
1 answer

Does an AES encrypted string include | (pipe)?

I'm using .NET's RijndaelManaged class to encrypt and decrypt strings. 3 different strings are first encrypted and then concatenated, separated by a pipe (|), and then this string is saved back to the database. When I need to decrypt the string, I…
Ivan-Mark Debono
  • 15,500
  • 29
  • 132
  • 263
1
vote
3 answers

ASP.net rijndael decrypt - Length of data to decrypt

A lot of items I've found so far have been a bit vague or ... unspecific so I'm hoping to get an answer. I've got two little methods - easy ones that look as such... private const string initVector = "1234567890123456"; private const string…
jeriley
  • 1,313
  • 12
  • 20
1
vote
1 answer

Issue with static encryption/decryption in a multi-threaded/TPL application

I have a static encryption/decryption class with static methods in one of my libraries. The code is a bit large so I posted it here: http://pastebin.com/zRZtNmjU I haven't had any issues with this code until it started being used within the…
1
vote
1 answer

Error Padding is invalid and cannot be removed

I get the Cryptographic Exception Padding is invalid and cannot be removed when trying to decrypt data. There are many questions on the net and on StackOverflow about this error, but I could not find the solution. More particularly, setting the…
Nicolas
  • 1,151
  • 3
  • 15
  • 28
1
vote
1 answer

Aes decryptor gives empty string

I have problem with AES encryption/decryption. The commented code worked but sometimes gave error "padding is invalid and cannot be removed" so I changed it as it is explained here Padding is invalid and cannot be removed Exception while decrypting…
Robert
  • 19,800
  • 5
  • 55
  • 85
1
vote
1 answer

Can't decrypt video using C# and Rijndael

I can't decrypt a video file that I encrypted it using Rijndael. Have a look at my encryption routine: using (FileStream _streamInput = new FileStream(inputPath,FileMode.Open,FileAccess.Read)) { using (FileStream _streamOutput = new…
gtamorim
  • 140
  • 8
1
vote
3 answers

Rijndael Decryption error - Length of the data to decrypt is invalid

I am able to encrypt a zip file using rijndeal but when i decrypt I get an error that says "Length of the data to decrypt is invalid" Im getting the byte array to decrypt from a file. Here is how i get the byte array. Dim FStream As FileStream =…
Thomas
  • 1,177
  • 1
  • 14
  • 26
1
vote
3 answers

Encrypting / Decrypting in vb.net does not always return the same value

I have a program in which I write and read configuration files. When I write, I encrypt the whole file using the RijndaelManaged object in vb.net, and when I read I decrypt using the same value for the key and init vector. It all work fine on my…
David Brunelle
  • 6,528
  • 11
  • 64
  • 104
1
vote
1 answer

Any way to unencrypt pkcs7 padded aes 256 cbc from ruby?

Im constantly getting "bad decrypt" whilst trying to unencrypt a string from a c# program using the same iv on both sides. This is getting a bit annoying and I cant really figure out the problem. This is the ruby code def unencrypt(message) c =…
David
1
vote
0 answers

Security with RijndaelManaged and ServicePointManager

I have a security question about RijndaelManaged and ServicePointManager. I have implemented a system where C# application is encrypting data, such as user credentials and some XML data. Then I use WebClient to send encrypted user credentials with…
Daniel
  • 33
  • 1
  • 1
  • 6