1
我試圖通過使用隱藏(facebook)來解密bytearray。java.io.IOException:意外的加密版本0
我的代碼如下
Log.d("Esource", " intial buffer size = " + buffer.length);
Crypto crypto = new Crypto(new SharedPrefsBackedKeyChain(this), new SystemNativeCryptoLibrary());
ByteArrayInputStream byteInputStream = new ByteArrayInputStream(buffer);
InputStream inputStream = null;
try {
inputStream = crypto.getCipherInputStream(byteInputStream, new Entity("Password"));
Log.d("Esource", "applied decryption ");
} catch (CryptoInitializationException e) {
Log.d("Esource", "applied decryption e = " + e.getMessage());
e.printStackTrace();
} catch (KeyChainException e) {
Log.d("Esource", "applied decryption e = " + e.getMessage());
e.printStackTrace();
} catch (Exception e) {
Log.d("ESource", "applied decryption e = " + e.getMessage());
e.printStackTrace();
}
ByteArrayOutputStream out = new ByteArrayOutputStream();
int read;
byte[] dBuffer = new byte[readLength];
if (inputStream != null) {
while ((read = inputStream.read(dBuffer)) != -1) {
out.write(dBuffer, 0, read);
}
} else
Log.d("Esource", "inputSTream after cipher is null");
buffer = out.toByteArray();
我得到以下錯誤
ava.io.IOException: Unexpected crypto version 0
at com.facebook.crypto.util.Assertions.checkArgumentForIO(Assertions.java:29)
at com.facebook.crypto.CipherHelper.getCipherInputStream(CipherHelper.java:52)
at com.facebook.crypto.Crypto.getCipherInputStream(Crypto.java:83)
at com.exoplayer.EncryptedDataSource.read(EncryptedDataSource.java:186)
at com.google.android.exoplayer.extractor.DefaultExtractorInput.peekFully(DefaultExtractorInput.java:135)
at com.google.android.exoplayer.extractor.webm.Sniffer.sniff(Sniffer.java:52)
at com.google.android.exoplayer.extractor.webm.WebmExtractor.sniff(WebmExtractor.java:258)
at com.google.android.exoplayer.extractor.ExtractorSampleSource$ExtractorHolder.selectExtractor(ExtractorSampleSource.java:805)
at com.google.android.exoplayer.extractor.ExtractorSampleSource$ExtractingLoadable.load(ExtractorSampleSource.java:746)
at com.google.android.exoplayer.upstream.Loader$LoadTask.run(Loader.java:209)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:422)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.u
什麼我做錯了,而decryption.I我因爲最後一天卡住。請幫忙。 在此先感謝。
任何人都可以幫助解決這個問題。我仍然堅持這個問題:( – SimpleCoder
你能解決這個「意想不到的加密版本」的錯誤? – prateek
我得到'意外的加密版本-1' – Pitel