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

可以使用 RSA 加密的數據量有什么限制?

What is the limit to the amount of data that can be encrypted with RSA?(可以使用 RSA 加密的數據量有什么限制?)
本文介紹了可以使用 RSA 加密的數據量有什么限制?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

通常建議使用 RSA 加密對稱密鑰,然后使用對稱密鑰加密有效負載".

Typically it is recommended that RSA be used to encrypt a symmetric key, which is then used to encrypt the "payload".

可以使用 RSA 加密的數據量的實際(或理論上)限制是多少(我使用的是 2048 位 RSA 密鑰大小).

What is the practical (or theoretical) limit to the amount of data that can be encrypted with RSA (I'm using a 2048 bit RSA keysize).

特別是,我想知道用(不同的)RSA 公鑰加密 RSA 公鑰(256 字節)是否安全?我在 Java 中使用 Bouncy Castle 加密庫.

In particular, I'm wondering if it is safe to encrypt an RSA public key (256 bytes) with a (different) RSA public key? I'm using the Bouncy Castle crypto libraries in Java.

推薦答案

對于 n 位 RSA 密鑰,直接加密(使用 PKCS#1 "old-style" padding) 適用于任意二進制消息直到 floor(n/8)-11 個字節.換句話說,對于 1024 位 RSA 密鑰(128 字節),最多 117 字節.使用 OAEP(PKCS#1 新式"填充),這有點少:OAEP 使用輸出長度為 h 位的散列函數;這意味著 floor(n/8)-2*ceil(h/8)-2 的大小限制:仍然是 1024 位 RSA 密鑰,使用 SHA-256 作為散列函數(h = 256),這意味著最多 60 字節的二進制消息.

For a n-bit RSA key, direct encryption (with PKCS#1 "old-style" padding) works for arbitrary binary messages up to floor(n/8)-11 bytes. In other words, for a 1024-bit RSA key (128 bytes), up to 117 bytes. With OAEP (the PKCS#1 "new-style" padding), this is a bit less: OAEP use a hash function with output length h bits; this implies a size limit of floor(n/8)-2*ceil(h/8)-2: still for a 1024-bit RSA key, with SHA-256 as hash function (h = 256), this means binary messages up to 60 bytes.

用另一個 RSA 密鑰加密一個 RSA 密鑰沒有問題(用 RSA 加密 任何 字節序列沒有問題,無論這些字節代表什么),但是,當然,外部" RSA 密鑰必須更大:使用舊式填充,要加密 256 字節的消息,您需要一個模數至少為 2136 位的 RSA 密鑰.

There is no problem in encrypting a RSA key with another RSA key (there is no problem in encrypting any sequence of bytes with RSA, whatever those bytes represent), but, of course, the "outer" RSA key will have to be bigger: with old-style padding, to encrypt a 256-byte message, you will need a RSA key with a modulus of at least 2136 bits.

混合模式(您使用隨機對稱密鑰加密數據并使用盡管如此,還是建議將 RSA 用作一般情況,這只是因為它們沒有任何實際的大小限制,而且還因為它們可以更容易地用另一種密鑰交換算法(例如 Diffie-Hellman)替換 RSA 部分.

Hybrid modes (you encrypt data with a random symmetric key and encrypt that symmetric key with RSA) are nonetheless recommended as a general case, if only because they do not have any practical size limits, and also because they make it easier to replace the RSA part with another key exchange algorithm (e.g. Diffie-Hellman).

這篇關于可以使用 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)
主站蜘蛛池模板: 国产1区2区3区 | 在线视频亚洲 | 久久成人精品视频 | 亚洲国产一| 九热在线 | 在线看日韩 | 国产精品美女久久久久aⅴ国产馆 | 国产在线观看一区二区 | 一级片在线观看视频 | 91av视频在线观看 | 99精品国自产在线 | 巨大黑人极品videos精品 | 免费日韩av | 久久av一区| 亚洲一区二区三 | 亚洲乱码一区二区三区在线观看 | 国产成人午夜精品影院游乐网 | 日日爽| 在线观看中文字幕 | 毛片一区二区 | 九九色综合 | 一区二区三区视频免费观看 | 日本天堂视频 | 视频在线日韩 | 久久大| 波多野结衣亚洲 | 天天干天天操天天看 | 国产成人精品一区二区三区在线 | 99视频网| 99成人精品 | 国产精品国产精品 | 国产乱码高清区二区三区在线 | 日韩成人在线免费视频 | 成人免费一级 | 国产精品久久久久久久粉嫩 | 国产视频一区二区 | 巨大荫蒂视频欧美另类大 | 日韩精品一区二区三区免费观看 | 91久久精品国产91久久 | 在线中文av | 欧美精品在线播放 |