久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

SUN JCE/Oracle JCE 中的默認 RSA 填充

Default RSA padding in SUN JCE/Oracle JCE(SUN JCE/Oracle JCE 中的默認 RSA 填充)
本文介紹了SUN JCE/Oracle JCE 中的默認 RSA 填充的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

您能幫我指出默認的 RSA 填充是什么嗎?

Could you help me to point out what is the default RSA padding.

確切地說,如果我創建如下密碼實例,確保 java 使用某種填充作為加密文本字節長度始終顯示 256 字節的 2048 RSA 密鑰,無論純文本是一個字符還是 10 個字符.

Precisely, if I create cipher instance as below, sure java is using some sort of padding as encrypted text bytes length always shows 256 bytes for 2048 RSA key irrespective of plain text is one characters or 10 characters.

Cipher.getInstance("RSA")  

如果在 Cipher.getInstance("RSA") 中沒有指定填充,我想知道 java 內部使用的默認填充是什么.那是 PKCS#1 v 1.5 嗎?

I wanted to know what is default padding java use internally if no padding is specified in Cipher.getInstance("RSA"). is that PKCS#1 v 1.5?

謝謝,山姆

推薦答案

"RSA/ECB/PKCS1Padding" 相同,其中 ECB 有點用詞不當,因為它沒有實現塊密碼操作模式(它不處理大于塊大小"的明文)."RSA/None/PKCS1Padding" 會是一個更好的名稱,或者 "RSA/None/RSASSA-PKCS1-v1_5" 因為您對填充機制的猜測是正確的.

It's identical to "RSA/ECB/PKCS1Padding" where ECB is a bit of a misnomer, as it does not implement a block cipher mode of operation (it doesn't handle plaintext larger than the "block size"). "RSA/None/PKCS1Padding" would have been a better name or "RSA/None/RSASSA-PKCS1-v1_5" as your guess about the padding mechanism is correct.

這意味著它使用的是舊的加密模式;OAEP 更能抵御攻擊并包含安全證明.不幸的是,OAEP 當然不能成為新的默認值,因為所有現有的密文都不會再解密了.這就是為什么首先使用默認值是愚蠢的原因之一.

This means that it uses a older mode of encryption; OAEP is more resistant against attacks and contains a security proof. Unfortunately OAEP can of course not be made the new default because all existing ciphertext would not decrypt anymore. This is one of the reasons why using defaults is stupid in the first place.

PKCS#1 v1.5 填充也意味著輸入被限制為最大密鑰大小減去 11 個字節.請注意,生成的密文的大小始終與 PKCS#1 中的密鑰大小相同;即使得到的整數更小,它也會用零字節填充.我在這里假設密鑰大小是 8 的倍數.

PKCS#1 v1.5 padding also means that the input is restricted to a maximum of the key size minus 11 bytes. Note that the size of the resulting ciphertext is always identical to the key size in PKCS#1; even if the resulting integer is smaller it will be left padded with zero bytes. I'm assuming here that the key size is a multiple of 8.

您不應該依賴算法規范的默認值.它使代碼更難理解,并且每個提供者的默認值可能確實不同(盡管大多數人會嘗試遵循 Oracle 的領導,以避免不兼容).因此,僅使用它來了解現有代碼中配置了哪種算法.在我看來,平臺默認設置唯一有意義的地方是 SecureRandom.

You should not rely on defaults for the algorithm specification. It makes the code harder to understand and defaults may indeed differ per provider (although most will try to follow Oracle's lead, to avoid incompatibilities). So use this only to understand which algorithm is configured in existing code. The only place where a platform default makes sense is SecureRandom in my opinion.

這篇關于SUN JCE/Oracle JCE 中的默認 RSA 填充的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

Java Remove Duplicates from an Array?(Java從數組中刪除重復項?)
How to fix Invocation failed Unexpected Response from Server: Unauthorized in Android studio(如何修復調用失敗來自服務器的意外響應:在 Android 工作室中未經授權)
AES encryption, got extra trash characters in decrypted file(AES 加密,解密文件中有多余的垃圾字符)
AES Error: Given final block not properly padded(AES 錯誤:給定的最終塊未正確填充)
Detecting incorrect key using AES/GCM in JAVA(在 JAVA 中使用 AES/GCM 檢測不正確的密鑰)
AES-256-CBC in Java(Java 中的 AES-256-CBC)
主站蜘蛛池模板: 日本精品免费 | 成人福利| 亚洲国产成人精品久久久国产成人一区 | 中文字幕成人网 | 成人影院在线观看 | 狠狠狠 | 一区二区三区四区国产 | 成人做爰9片免费看网站 | 免费观看一级毛片 | 欧洲亚洲一区二区三区 | 成年男女免费视频网站 | 狠狠躁夜夜躁人人爽天天高潮 | 欧美一区二区大片 | 亚洲欧美视频一区二区 | 一级片aaa| 国产欧美精品一区二区色综合朱莉 | 激情六月天 | 中文字幕av第一页 | 天天看夜夜 | 亚洲视频一区 | 午夜日韩精品 | 中文字幕国产视频 | 国产精品99久久久久久www | 美女露尿口视频 | 国产99久久久国产精品 | 日韩一区二区三区在线 | 亚洲高清视频在线 | 精品久久久久久久久久久久久 | 欧美一级α片 | 精品欧美一区二区三区久久久 | 日韩在线免费 | 国产精品不卡视频 | 久久人人网 | 色婷婷久久久久swag精品 | 免费观看av | 男女视频在线免费观看 | 午夜影院网站 | 久久久99国产精品免费 | 免费国产一区二区 | 欧美日韩国产三级 | 韩国主播午夜大尺度福利 |