转帖请注明原出处: http://blog.csdn.net/yezisuifengbiao/article/details/51024611
跟后台上传图片时,转BASE64后再用AES加密时。后台使用的是 import org.apache.commons.codec.binary.Base64 包的encodeBase64String.
Android 的 Base64 的package 是import android.util.Base64;
只能使用 encodeToString 方法。但是加密出来的数据,跟后台使用 apache 的包并不一样。
原因是因为传入的 Base64.DEFAULT 。 通过搜索得知:
Android's Base64 includes line terminators. To obtain the same result as with the Apache encoding, use Base64.NO_WRAP
下面是原帖: