IPad padding = PadFactory.getInstance("PKCS7");
padding.init(16);
IMode mode = ModeFactory.getInstance("CBC", "AES", 16);
Map attributes = new HashMap();
byte[] pt1 = source;
byte[] pad = padding.pad(pt1, 0, pt1.length);
byte[] pt = null;
// 判断是否要补空
if (pad.length == 16) {
pt = new byte[pt1.length];
System.arraycopy(pt1, 0, pt, 0, pt1.length);