views:

99

answers:

2

Hi,

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.

Cheers, S.

+2  A: 

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.

Filip Ekberg
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
Sem Dendoncker
@Sem, afaik you will need all those to be able to decrypt it. Since those were used when you encrypted it.
Filip Ekberg
@Sam, check this out: http://www.codeproject.com/KB/security/DotNetCrypto.aspx
Filip Ekberg
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
Sem Dendoncker
@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
Have you seen this Q/A too? http://stackoverflow.com/questions/2994235/c-libraries-to-encrypt-decrypt-using-aes
Filip Ekberg
@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.
Sem Dendoncker
the answer was a combination of a couple of factors, this answer helped me out.
Sem Dendoncker
A: 

Hello Sem !!

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
thx but my key isn't a 32-bit hex but a 24 bit ascii
Sem Dendoncker