簡體   English   中英

NoSuchAlghoritmExeption 當您調用 java cipher.getinstance()

[英]NoSuchAlghoritmExeption when you call the java cipher.getinstance()

getInstance 返回 NoSuchAlghoritmExeptoin,盡管當操作員檢查時,其中之一是 AndroidOpenSSL: Cipher。 AES/ECB/PKCS5填充

    Cipher cipher;
    cipher = Cipher.getInstance("AES/ECB/PKCS5Padding");

當您的設備環境中沒有該算法時,就會發生NoSuchAlghoritmExeption

好吧,這里的第一個問題是 - 為什么需要ECB 它有很多缺點

你試過CBC嗎? 它可能適用於所有 Android 環境。 接下來是我的步驟:

  • 嘗試使用 CBC 而不是EBC ,它也有PKCS5PaddingCipher.getInstance("AES/CBC/PKCS7PADDING")
  • 驗證結果是否符合您的期望
  • Go 通過文檔驗證 Cipher 支持哪些算法
  • 查找支持所需算法的

請以更詳細的方式描述您的問題。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM