打开ssl“数据大于mod len" [英] Openssl "data greater than mod len"

查看:262
本文介绍了打开ssl“数据大于mod len"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

数据大于模数"错误消息是什么意思?我在尝试使用 php 的 openssl_private_decrypt 解密数据时遇到了这个问题.如何解决这个问题?一直在网上搜索数小时,无处可寻.

What does the "data is greater than mod len" error message mean? I have encountered this while trying to decrypt data using php's openssl_private_decrypt. How does one go about solving this issue? Been searching hours online, not getting anywhere.

推荐答案

非对称 RSA 密钥只能加密/解密有限长度的数据,即 RFC3447 可以对长度高达 k - 11 个八位字节(k 是 RSA 模数的八位字节长度)的消息进行操作,因此如果您使用的是 2048-bit RSA 密钥,那么要加密的明文数据的最大长度为 245 字节.

Asymmetric RSA keys can encrypt/decrypt only data of limited length i.e. RSAES-PKCS1-v1_5 encryption scheme defined in RFC3447 can operate on messages of length up to k - 11 octets (k is the octet length of the RSA modulus) so if you are using 2048-bit RSA key then maximum length of the plain data to be encrypted is 245 bytes.

这篇关于打开ssl“数据大于mod len"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆