How to make RSACryptoServiceProvider work without padding (nopadding)?

后端 未结 3 1751
无人共我
无人共我 2021-02-06 17:00

I need to make a C# application compatible with a Java application.

The Java application uses a Cipher.getInstance(\"RSA/ECB/nopadding\"); initializer to ma

3条回答
  •  北恋
    北恋 (楼主)
    2021-02-06 17:44

    Well, the fact is that if you have no padding, you must meet the block size exactly. Of course it's quite odd to normally reach the block size exactly, hence you pad.

    You can always pad it yourself, with some chars that you then remove on the other side.

    What, exactly, is the reason you need to do this?

提交回复
热议问题