Exception in thread "main" javax.crypto.BadPaddingException: Given final block not properly padded
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");