5

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.

user29964
  • 15,322
  • 19
  • 55
  • 63

2 Answers2

6

Here are two complete code samples for you:

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.

Community
  • 1
  • 1
Filip Ekberg
  • 35,726
  • 18
  • 122
  • 180
  • In these example you require: public static string Decrypt(string cipherText, string passPhrase, string saltValue, string hashAlgorithm, int passwordIterations, string initVector, int keySize) I only have the first 2 – user29964 Jul 12 '10 at 08:21
  • @Sem, afaik you will need all those to be able to decrypt it. Since those were used when you encrypted it. – Filip Ekberg Jul 12 '10 at 08:23
  • These solutions don't work, I'm getting an error: "Invalid length of data" The problem lies here: byte[] cipherBytes = Convert.FromBase64String(cipherText); if i change it by using assci encoding to bytearray i'm not getting the error but then i'm getting a text that isn't readable for sure – user29964 Jul 12 '10 at 08:38
  • @Sem, do you have any example data to play with where you know the Input and Output? Would be easier to try it out then. – Filip Ekberg Jul 12 '10 at 08:41
  • Have you seen this Q/A too? http://stackoverflow.com/questions/2994235/c-libraries-to-encrypt-decrypt-using-aes – Filip Ekberg Jul 12 '10 at 08:43
  • @Filip yes I have. Well I only have the key but I don't know what the output has to be. the only thing I know is that the string will be a number eventually. – user29964 Jul 12 '10 at 08:48
  • the answer was a combination of a couple of factors, this answer helped me out. – user29964 Jul 15 '10 at 16:02
0

Please go through this article "Simple Cryptographer - Simple DES/AES Implementation in C#"

link: http://www.codeproject.com/KB/recipes/Simple_Cryptographer.aspx

Hope this article will help you.

Lokesh
  • 1
  • 1
  • 3
    Whilst this may theoretically answer the question, [it would be preferable](//meta.stackoverflow.com/q/8259) to include the essential parts of the answer here, and provide the link for reference. – Mat Sep 14 '17 at 12:59