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

Why RijndaelManaged returns junk data after encryption?

I have taken the decrypt code from http://msdn.microsoft.com/en-us/library/system.security.cryptography.cryptostream.aspx and modified it as follows below. I have an encrypted example, and it works just fine while decoding. But when using the…
cprogcr
  • 469
  • 2
  • 7
  • 21
2
votes
2 answers

How to store a RijndaelManaged generated KEY and IV in the database for later use?

Let me start by saying....yes I have read tons of posts on here in the last two days. No, I don't know anything about encryption, so don't bother...with the you shouldn't playing with fire comments.. I have a asp.net MVC3 application and want to…
KMW_Denver
  • 57
  • 1
  • 8
2
votes
1 answer

AES 256 encryption

I am using AES 256 to encrypt/decrypt some plain text. But the algorithm uses only PKCS7 for padding, but I need to use PKCS5 to make it compatible to other platforms. How can I achieve this? My source code is: public string Encrypt(byte[]…
Bhaskar
  • 10,537
  • 6
  • 53
  • 64
1
vote
1 answer

How can I find the initialization vector CAPICOM used to AES-encrypt my data?

I have an application written in Classic ASP that encrypts data via CAPICOM and stores it in a database. The encryption code looks something like this (Classic ASP, VB. Simplified a bit for brevity): set encryptObject =…
Joshua Carmody
  • 13,410
  • 16
  • 64
  • 83
1
vote
1 answer

Rijndael/AES decryption C# to PHP conversion

I have the following code in C# string s = "hellowld"; byte[] bytes = new UnicodeEncoding().GetBytes(s); FileStream stream = new FileStream(inputFile, FileMode.Open); RijndaelManaged managed = new RijndaelManaged(); CryptoStream stream2 = new…
Taylantz
  • 51
  • 1
  • 6
1
vote
1 answer

How can I change an encryption key and still be able to decrypt old data?

I would need to create a symmetric key in C# and use it to encrypt a string, which I would eventually store in a database. I would use the AES mechanism in .Net to achieve this. I would use the same key to decrypt the encrypted data. Now my…
user967338
  • 11
  • 2
1
vote
1 answer

C# RijndaelManaged vs Python Crypto.Cipher AES + CBC

I've been banging my head against the wall for a couple of days now and was hoping someone could point out the obvious. I am trying to match the RijndaelManaged encryption of C# with that of Python using Crypto.Cipher. Problem: Despite everything…
Sylver11
  • 129
  • 1
  • 8
1
vote
0 answers

C# RijndaelManaged Encryption Output Is Wrong

I have encryption and decryption methods but the encryption method's output is wrong. The key is "u1S1t12vTeZtlRHd" and the output must be "kJtXKmIiP9f73IZJim16LA==" ( Please check decryiption method) but the encryption method is giving me this…
1
vote
0 answers

Not having the same result between AES of javascript cryptojs and AES C# RijndaelManaged

i have a mobile app developed on ionic and i have this portion of code that get a base64 string and encrypt it (the same thing for decryption) here is the code globalEncrypt(input: string): string { return crypto.AES.encrypt(input,…
1
vote
1 answer

Why do I get an empty result when encrypting a string, even though I flushed the input stream?

I want to encrypt some string through RijndaelManaged and get encrypted result. I want to do it with MemoryStream. But I get the empty string. I get the same problem if I use Rijndael class instead of RijndaelManaged. What I did wrong? static string…
Andrey Bushman
  • 11,712
  • 17
  • 87
  • 182
1
vote
1 answer

256 Bit Encryption in .NET Core 5

I have been using AES for 256 Bit encryption in the .NET framework for quite a few years. I recently started a new project in .NET Core 5 and keep getting and error stating that only 128 bit keys are supported in this installation. After a bit of…
Anzel
  • 101
  • 1
  • 7
1
vote
0 answers

Change Rijndael decryption logic from C# to Python

I have some already encrypted data which needs to be decrypted using python. The decryption logic in C# looks as given below. using System.Security.Cryptography; private const string Url_ENCRYPTION_KEY = "abcd123456"; private readonly static byte[]…
Siddharth Pant
  • 665
  • 7
  • 11
1
vote
0 answers

How to encrypt a file in VBScript using AES?

When trying to make a secure encryption system for some secret keys, I wanted to see if we can encrypt the file containing the key in VBScript using AES Looking at other posts, I found that: '----------------------------------------------------- Dim…
Anic17
  • 712
  • 5
  • 18
1
vote
0 answers

How to use CryptoStream with Span/ReadOnlySpan?

Most of the exemples use MemoryStream with CryptoStream to encrypt/decrypt with RijndaelManaged so I simplified it as much as I could and ended up with the following function to decrypt a buffer. RijndaelManaged csp; //is initialized wih CBC/256bit…
Lizi
  • 153
  • 1
  • 9
1
vote
0 answers

C# and Powershell Encrypt Rijndael Pass to same Output

I have 3 projects and want in all 3 projects the same encrypt and decrypt methods. it works to get the same encrypted output for c# and php. But in powershell I get a slight diffrent output. Can someone EDIT my powershell script so I get same output…