C# TripleDES Provider without an Initialization Vector?

后端 未结 1 1478
予麋鹿
予麋鹿 2020-12-16 23:20

I have a set of encrypted documents encoded with TripleDES coming from a remote system. I need to decode the data in C# and I have no control over the key or encoding algori

相关标签:
1条回答
  • 2020-12-16 23:51

    Trying to answer each point:

    • The Initialization Vector is required in CBC mode. It is not required to be a secret (unlike the key) so it should be sent from the remote system.
    • Since you need the IV, null is not the right thing to pass.
    • Padding mode. You need to know which padding mode is used.
    • TransformFinalBlock probably fails because the Padding mode is wrong.

    Edit

    The difference between ECB (Electronic Code Book) and CBC (Cipher Block Chaining) is illustrated below:

    ECB Mode

    CBC Mode

    As you can see no IV is used in ECB mode. So even if you provide one it will be ignored.

    0 讨论(0)
提交回复
热议问题