You should definitely be more explicit with the Cipher by declaring the mode and padding. How is this code getting encrypted? What is actually in the StringencryptedString? Is it hex encoded or base64 encoded? If it isn't encoded that could definitely be a source of trouble.