iPhone上的RSA/ECB/PKCS1填充解密 [英] RSA/ECB/PKCS1Padding Decryption on iPhone

查看:56
本文介绍了iPhone上的RSA/ECB/PKCS1填充解密的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经搜索了很多有关我的任务的信息,

I have searched alot regarding my task which is like ,

我正在通过XML获取数据,该XML使用后端的 RSA/ECB/PKCS1Padding 进行了加密,他们给了我一个文件名"publickey.der" .根据他们的说法,这是公共密钥,您需要使用此密钥进行解密.

i am getting data through XML which is encrypted using RSA/ECB/PKCS1Padding from backend and they have given me a file name "publickey.der". According to them this is public key and you need to use this key for decryption.

严重的是,我对在公钥C上使用此公钥进行解密一无所知.

Seriously i dont have any idea about using this public key for decryption on Objective C.

请指导我我需要使用哪个框架或库或sdk,或者其中任何一个具有示例代码.我只指望你们.

Please guide me which framework or library or sdk i need to use or any one has any sample code for this. I am counting on you guys only.

期待您的答复

再次感谢您

推荐答案

使用了公共密钥对于加密,私钥用于解密.您将必须首先更正此问题.

Public keys are used for encryption, private keys are used for decryption. You will have to rectify this issue first.

同样,RSA/ECB/PKCS1Padding并不常见,当您想用rsa加密大量数据时,通常使用rsa加密aes密钥,而使用aes加密数据.

Also RSA/ECB/PKCS1Padding is not common, when you want to rsa encrypt a large amount of data, usually you encrypt an aes key with rsa and encrypt your data with aes instead.

基本上,要在Java外部进行RSA/ECB解密,将需要手动进行,因此您必须按照块大小(密钥大小)将密文分解,然后解密每个块而无需填充,直到最后一个带有填充的块,这才是您获得ECB的方式.

Basically, to do this RSA/ECB decrypt outside of java, it will be manually, and you are going to have to break your cipher text up by your block size (key size), and then decrypt each block without padding, until the final block with padding, that's how you get the ECB.

这是不理想的,将它们与为您提供公钥并告诉您解密的方法相结合,表明提供数据的人都需要解决其加密问题.

This is not ideal, that combined with them providing you with a public key and telling you to decrypt, suggests that whoever is giving you the data needs to fix their encryption issues.

这篇关于iPhone上的RSA/ECB/PKCS1填充解密的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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