我在android中生成rsa密钥并加密文本并使用密钥将其发送到服务器(php)。
我尝试使用私钥解密密文但由于php中出现以下错误而无法解密:
注意:解密错误
我认为私钥是问题
我的数据是:
PublicKey:----- BEGIN PUBLIC KEY ----- MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCwR8SUPzb5eLqhvXDVmtl6Q9FHSY7eJgcb23ywrX2hZaSJqaG + RuQrdrPjXjOKHHuLhis4 / BVK + oMovHe8DBxlcUsVjk + / oaD0JHhJT6nchYJQ72yjo4UkZMPuczM0q2ACX1tIo / 0 + / qh4tbLB8 / TEjVITlCuY8nEz24ZH5YcChQIDAQAB ----- END PUBLIC KEY -----
专用密钥:MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBALBHxJQ / Nvl4uqG9cNWa2XpD0UdJjt4mBxvbfLCtfaFlpImpob5G5Ct2s + NeM4oce4uGKzj8FUr6gyi8d7wMHGVxSxWOT7 + hoPQkeElPqdyFglDvbKOjhSRkw + 5zMzSrYAJfW0ij / T7 + qHi1ssHz9MSNUhOUK5jycTPbhkflhwKFAgMBAAECgYBcRTSgZHZiHs + R2Zc2N9eeJ + Fjbx1ZKo6OBlU + JZGc6Zc2d5QyBOlp1rhSSvyvTjlczt3Q9iIvHPGKYRxLUguKLj162hyJZJ6n + mbV3ysFZd9S / + heiwzQluY4 / kmwhm / LL + aHuVyF98QbF5OpDIhIjGeP0gNxwBV8Ap / e6khAAQJBAOr3wvGsfIaE2iF / abwNeHZgUGB4dQthvId7w + pxJ2cx /氙+ 2M1HlyuqKg / YDJx4CXtrjezmXXU2DCoptxRs4okCQQDADzH1TIymRgmV91GuWbrbwRmjhpTlql0XJDoF31B9QFFDsyBRL3Oc8rQsMSbF7M / uMrq3XZAACvIFNpWEZFEdAkBDjbwUc3zRx / xWySUDFfReRE6XjcpI3W6wnRq0mpeziaHP / aSjUEPcH + 474 + esTK6dN0z0oT6ZZlKVBK1ISA3RAkEArWaKsm / 0pMKjMPTkmEeHP5UuMsf1cw3Hkncws9CVeSAyvq7hRKtU9KTkKuoNmbFfYi4HCjq9Imy / ahmIEMoJuQJANwuHqB3h54AAdoQJ / 8LuIWW9iKp4P + vY43ha2onrlgPk5pbyCXpePZ2ursmed + IDfd3dOTeCZRqRdZ4kpXLaVA ==
chiper text(原始文本是“example text”):
WuPN12rPYy + E9ozcIws / ZFP3dZiwatA24H + sz3GeOxKWKL7L8DfxAmoHDagJDy7rgbRDUrzKGKTvZsXkPpLsK + RhTHMgZAuHzrq54hUC2wfRg / omiyDeKCZFHdo5veajKzwJJSVVVqtpvL18NtFFi4tOrmNm5Dt / Blpd1zK50R0 =
有关信息:我可以在android
中解密它答案 0 :(得分:1)
我的问题解决了
我忘记了base_decode64
密文