AES Decryption in C#

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • vikrambawne
    New Member
    • Nov 2012
    • 2

    AES Decryption in C#

    Hello,

    I am using C# AES Decryption ..

    When i try to decrypt encrypted xml string using AES Decryption ...

    I am getting this

    ??1????5???

    Any idea what could be reason? or How do i fix this?


    Thanks
    Last edited by Frinavale; Nov 1 '12, 07:52 PM. Reason: added code tags
  • Frinavale
    Recognized Expert Expert
    • Oct 2006
    • 9749

    #2
    It would really help if you posted the code that you are using.
    The experts here can't guess what you are doing.

    Whenever I get stuck like this I first refer to the documentation found in the MSDN Library. For example, here is the documentation for the Aes Class. If you scroll down you'll see an example of how to use it properly.

    -Frinny

    Comment

    • Rabbit
      Recognized Expert MVP
      • Jan 2007
      • 12517

      #3
      Maybe you're just using the wrong password? Or initialization vector? Or salt? Or cipher mode? There's just a lot that could have been inputted incorrectly.

      Comment

      • vikrambawne
        New Member
        • Nov 2012
        • 2

        #4
        Here is example:

        Original: <?xml version="1.0" encoding="utf-8" ?><TRANS_NET><R EQUEST_ID>57943 </REQUEST_ID><REQ UEST_DATE>2012-11-06 15:56:08.0</REQUEST_DATE></TRANS_NET>

        Secret Key: 870427743786660 0
        IV KEY: : 780063638742667 4

        Encrypted in Hex : 068ed9ec320db15 f56f365c7ce53b5 423b5bb34f90de8 4b09c7b05deca0c 143e88672d0f0c4 f2f9443ad3c988b 672ffdad6db2962 a2b010e179f8ea8 8ba8c20e8f544cd 94517b326372478 e1a0b676ccc3fcd be2ac2ac0a5cba8 71265a1e48eb893 6f540b8cd5aeb28 460c61929ec5f04 d5f3ebcf7c52fd1 87bd194e7bb5e64 fa3b78a908a3a8d 8ce3e3aa25dfad0 841

        Decrypted Output

        ??%1????!?? ?{'O
        ?????NY:??vL? ~?'???cP?o??

        Comment

        • Rabbit
          Recognized Expert MVP
          • Jan 2007
          • 12517

          #5
          I assume you're using the System.Security .Cryptography library? I don't know how you're doing your decryption as you haven't provided any code, but you do realize that the decryption isn't expecting the input in hexadecimal encoding right? It expects it in ASCII encoding.

          Comment

          Working...