java des加密是直接用des会报错:Exception in thread "main" javax.crypto.BadPaddingException: Given final block not properly padded

 

找了半天,只能改用另一个方式,至于两种方式的区别,就自己去官方看api了www.twitterchina.net

//Exception in thread "main" javax.crypto.BadPaddingException: Given final block not properly padded
//  Cipher cipher=Cipher.getInstance("DES");
 Cipher cipher = Cipher.getInstance("DES/ECB/NoPadding");

来源:www.javait.org

相关文章:

  • 2021-12-27
  • 2021-10-23
  • 2022-12-23
  • 2021-11-22
  • 2021-09-25
  • 2022-02-01
  • 2022-12-23
猜你喜欢
  • 2021-07-24
  • 2022-12-23
  • 2022-01-17
  • 2022-01-17
相关资源
相似解决方案