“javax.crypto.BadPaddingException: Data must start with zero” exception

前端 未结 4 1278
慢半拍i
慢半拍i 2020-12-17 08:31

I encountered the abovementioned exception while I was decrypting a string.

Below is my code:

import java.security.KeyPair;
import java.security.KeyP         


        
4条回答
  •  误落风尘
    2020-12-17 08:37

    Have you googled? A lot of people have this problem when the key to encrypt is not the same as the key to decrypt. It seems like you generate new keys all the time instead of using the same key to decrypt that you used for encryption.

提交回复
热议问题