Verify SHA1withRSA signature generated in Java (Android) with phpseclib

前端 未结 1 525
無奈伤痛
無奈伤痛 2021-01-13 07:20

This is what I want to do:

  • Generate a 512 bit RSA keypair in Java/Android
  • Generate a SHA1withRSA signature for some message in Java
相关标签:
1条回答
  • 2021-01-13 08:26

    Seems like $_POST['msg'] might need to be base64_decode()'d as well? Also, try doing $rsa->setEncryptionMode(CRYPT_RSA_ENCRYPTION_PKCS1). By default phpseclib does OAEP padding which, although more secure, is not as widely supported nor is it the default for most stuff.

    0 讨论(0)
提交回复
热议问题