Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I decrypt a string using AES algorithm in c#?

I have an encrypted string from one of our customers.
This string was encrypted using the AES method in Java.

The only thing I have is the key: "xxxxxxxxxxxxxxxxxxxxxxxx" (24 chars) and the encrypted text: "56e84e9f6344826bcfa439cda09e5e96" (32 chars). (This really is the only data I have)

I can't seem to find a method to decrypt this string.

Could anyone provide me with a working example.

like image 708
user29964 Avatar asked Jul 12 '10 08:07

user29964


People also ask

How AES is used for decryption?

AES includes three block ciphers: AES-128 uses a 128-bit key length to encrypt and decrypt a block of messages. AES-192 uses a 192-bit key length to encrypt and decrypt a block of messages. AES-256 uses a 256-bit key length to encrypt and decrypt a block of messages.

How do I decrypt an encrypted string?

Given encrypted string str, the task is to decrypt the given string when the encryption rules are as follows: Start with the first character of the original string. In every odd step, append the next character to it. In every even step, prepend the next character to the encrypted string so far.


1 Answers

Here are two complete code samples for you:

  • How To: Encrypt and Decrypt Data Using a Symmetric (Rijndael) Key
  • How To: Encrypt Data With Salt (C#/VB.NET)

You might also find c# implementations of AES encryption here on SO interesting.

I found another example Simple encrypting and decrypting data in C# where they use only the Pass Phrase to decrypt.

like image 66
Filip Ekberg Avatar answered Oct 28 '22 14:10

Filip Ekberg