久久久久久久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)
主站蜘蛛池模板: 黄色一级大片在线免费看产 | 国产精品久久久久久久久久免费 | 久久在线看 | 国产精品久久久亚洲 | 日韩欧美一区在线 | 久久99精品久久 | 日韩av高清 | 日韩欧美久久精品 | 天天看天天爽 | 一区二区精品电影 | 亚洲人人舔人人 | 三区在线观看 | 亚洲一区在线免费观看 | 作爱视频免费看 | 成人免费视频在线观看 | aaaaa毛片 | 中文字幕视频在线免费 | 亚洲欧美日韩精品久久亚洲区 | 久久精品久久久久久 | 国产精品久久久久久久久久了 | 三级免费av | 欧美一区二区三区在线播放 | 日韩电影一区二区三区 | 久久www免费视频 | 交专区videossex农村 | 中文字幕在线第二页 | 91激情电影| 麻豆久久久久久 | 天堂在线www | 狠狠干天天干 | 91麻豆精品国产91久久久更新资源速度超快 | 一区二区三区在线播放视频 | 精品国产视频在线观看 | 国产精品久久久久久吹潮 | 午夜视频在线免费观看 | 国产99久久久国产精品 | 中文字幕不卡在线观看 | 亚洲成人在线网 | 99久久婷婷国产综合精品电影 | 一区二区三区高清在线观看 | 久草视|