urgent help please!! decrypting a string recived from external device

i'm using 3des, with ECB mode and PKCS5 padding to encrypt and decrypt a string with a secret Key.

i get an encypted string from external device (remote pc). this string is represented with an array of 16 bytes.

i pass this array directly to the method decypt.doFinal, but i get a badPaddingException :Given final block not properly padded

at com.sun.crypto.provider.SunJCE_h.b(DashoA12275)

at com.sun.crypto.provider.SunJCE_h.b(DashoA12275)

at com.sun.crypto.provider.DESedeCipher.engineDoFinal(DashoA12275)

at javax.crypto.Cipher.doFinal(DashoA12275)

i tried to simulate this problem in my PC, so i encrypt a string and i pass the result (array of 16 bytes) to decrypt.doFinal and it's OK.

when i pass directly an array of 16 bytes the exception is thrown!!

does anyone have an idea please?

[855 byte] By [A.Antonioa] at [2007-11-27 5:56:33]
# 1
> does anyone have an idea please?Either you are using the wrong key or your encrypted data has been corrupted. Since you have only provided a minimal amount of code it is impossible for us (well me anyway) to provide a better answer.
sabre150a at 2007-7-12 16:27:25 > top of Java-index,Security,Cryptography...