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
3
votes
2 answers

Padding in AES CBC

I am trying to test CBC with Random IV using (128-bit AES) in C#. In my question to solve, I have 12-byte input message. The condition is that if PlainText is less than block-size (16-bytes) the padding to be used starts with 0x01 and then upto 6…
2
votes
2 answers

How do I pre-determine the length of the resultant cipher text produced in an encryption operation?

I have an application which stores some information in an encrypted state, both on file and in a database. How can I calculate what the length of the resultant cipher text will be based on the plain text input? The encryption operation consists of…
Lee D
  • 12,551
  • 8
  • 32
  • 34
2
votes
1 answer

Output is invalid

I have a PHP program that encrypts a PDF file into .xxx file this output is being read by a C# program that decrypts this .xxx file back into PDF file. My problem is that when I open the file decrypted by C# , the PDF reader tells me that the file…
Ahmad Hajjar
  • 1,796
  • 3
  • 18
  • 33
2
votes
1 answer

Should the initialization vector be required to be able to decrypt my data?

I'm using RijndaelManaged to encrypt and decrypt data. I may well have misunderstood the point of an initialization vector, but I am finding that if I set it to a different value when decrypting my data, all but the first 16 characters are still…
matthewk
  • 1,841
  • 17
  • 31
2
votes
0 answers

RijndaelManaged using 256 key on .NET Core

I am migrating some code from .NET Framework to .NET Core and came across an issue. I have a lot of strings that were encrypted on the old system and saved on the database on their encrypted version. I've moved the code to .NET core, created a new…
APearTree
  • 51
  • 1
  • 8
2
votes
1 answer

RijndaelManaged difference in .NET Framework and .NET Core

I am using exactly same class for Encrypting/Decrypting the string in two project , one project is targeting .NET Framework 4.8 and second .NET 5 . I have faced pretty strange thing with RijndaelManaged Algorithm , on .NET Framework application it…
JmukhadzeT
  • 99
  • 1
  • 9
2
votes
0 answers

Decrypt RijndaelManaged in C++ (CNG)

The C# code below outputs 0123456789012345678901234567890123456789: static void Main(string[] args) { byte[] salt = Encoding.ASCII.GetBytes("saltycrack"); …
Hans Malherbe
  • 2,988
  • 24
  • 19
2
votes
1 answer

C# AES CFB compatibility with 3rd party C implementation

I have a 3rd party AES library for C (from Lantronix). I wrapped their API from within C#'s managed code as shown below, and it works: [DllImport("cbx_enc.dll", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)] static…
Noble
  • 135
  • 1
  • 11
2
votes
1 answer

How do i use random salt and random iv in aes encryption and decryption algorithm?

is it possible to use random salt and random iv in encryption and decryption algorithm using AES or RijndaelManaged? I was learning about encryption and decryption algorithms, I tried using aes or rijndaelmanaged in C#, someone else said, if you use…
Nurohman AR
  • 75
  • 1
  • 11
2
votes
0 answers

c# RijndaelManaged 10 times sower than Java equivalent (AES/CFB8/NoPadding)

While debugging the performance of my C# application I noticed that it's a lot slower than it's Java equivalence. After looking into it the problem seems to be caused by the encryption/decryption methods. I am forced to use AES encryption with mode…
Jpm100
  • 21
  • 2
2
votes
2 answers

Using RijndaelManaged encryption in Silverlight

I'm implementing a webservice client that is required to encrypt the request using 128-bits Rijndael. Because the RijndaelManaged class doesn't exist in Silverlight, I've followed the advice here: This was discussed here: AesManaged and…
2
votes
2 answers

RijndaelManaged - Encrypt/Decrypt a Stream in C#

I am trying to encrypt and decrypt a stream (a PDF document at base), but I am having issues with this. When I try to open the document after decryption and download, I get the error Failed to load the PDF document. Do you know why this might be…
Marius Popa
  • 564
  • 1
  • 5
  • 22
2
votes
0 answers

Implementing AES-GCM with 128-bit blocks and 256-bit key

I do not usually work with encryption but I need to use AES-GCM algorythm in C# with 128-bit blocks and 256-bit key. I already read many articles about it but I can't find a valid…
Emanuele
  • 648
  • 12
  • 33
2
votes
0 answers

The result of Rijndael encryption differences between C# and C++

I use C# RijndaelManaged of .net and C++ TinyAES encrypt data, most of the two result is the same, the result of C# has 16 bytes more than the result of C++ TinyAES, the other data is the same. I try to change C++ Rijndael project, but it does not…
Fly
  • 21
  • 2
2
votes
0 answers

Check if File is encrypted or not

As per this CodeProject, I have encrypted and decrypted file. At the end of the code, I am setting file attribute as Encrypted. fsIn.Close(); cs.Close(); fsCrypt.Close(); // Mark the file as Encrypted File.SetAttributes(outputFile,…
Faizan Mubasher
  • 4,427
  • 11
  • 45
  • 81