Does mcrypt support asymmetric encryption?

前端 未结 1 443
借酒劲吻你
借酒劲吻你 2020-12-19 12:39

I want to use asymmetric encryption of headers in RESTful requests to verify the identity of the system sending the request: i e System A encrypts it\'s name, timestamp, and

1条回答
  •  佛祖请我去吃肉
    2020-12-19 12:57

    No, mcrypt is just symmetric block ciphers.

    However the PHP OpenSSL extension supports asymmetric operations. The ones you want are openssl_sign and openssl_verify.

    (You have a slight terminology issue - in asymmetric systems, encryption is done with public keys and decryption with private keys; signing is done with private keys and verification with public keys. Do not confuse signing with encryption or decryption - although the underlying operations are often similar, it is not the same thing, and the confusion can lead to insecure implementations).

    Of course, you could just do your REST over SSL, using client certificates for authentication.

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