增長速度,我不知道這是可能的...我有我的應用程序,加密圖像中的代碼...的Android - 加密
Cipher cipher;
SecretKey key;
byte[] buf = new byte[1024];
DesEncrypter() {
byte[] iv = new byte[] { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09,
0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17 };
key = new SecretKeySpec(iv, "AES");
try {
cipher = Cipher.getInstance("AES/ECB/PKCS7Padding", "BC");
cipher.init(Cipher.ENCRYPT_MODE, key);
}
catch (NoSuchProviderException e) {}
}
public void encrypt(InputStream in, OutputStream out) {
try {
out = new CipherOutputStream(out, cipher);
int numRead = 0;
while ((numRead = in.read(buf)) >= 0) {
out.write(buf, 0, numRead);
}
out.close();
}
我每次加密或解密的圖像(這我應用程序確實需要很長時間,有關如何增加過程的任何提示,以便用戶有更好的體驗?
其它模式均優於歐洲央行很多事情,但他們都沒有任何更快。 – 2011-02-15 12:34:58
它可以依賴於框架,例如:http://www.cryptopp.com/benchmarks.html – 2011-02-15 12:48:20