saeiddavoody 0 Posted November 13 (edited) Hi, In my VCL application I send a request to server and receive a data that encrypted by php openssl_private_encrypt. Now I want to decrypt it with a public key. I have the public key. How should I do that? Is there a third-party component to do that? what difference between using openssl library to decrypt data with public key and decrypting it using other library or pure RSA? Update: Some components such as TMS Cryptography, Delphi-OpenSSL decrypt data with private key not public key using openssl. How should I decrypt the string with public key using openssl? Edited November 13 by saeiddavoody Share this post Link to post
Brian 1 Posted November 27 You can't. In SSL, public key is used to encrypt and private is to decrypt. Share this post Link to post
Kas Ob. 121 Posted Wednesday at 06:07 PM On 11/13/2024 at 7:05 AM, saeiddavoody said: How should I decrypt the string with public key using openssl? It is doable, but you need to understand what/which encryption scheme is used with php side that uses openssl, is it standardized one or not, then replicate that on Delphi application, one thing though the most crucial thing with RSA encryption is padding !, so .. I suggest to go with TMS but before buying have your question to their support Sales/Technical, just make sure to give them full and detailed information unlike your question above, like what php code/library is doing the encryption so someone can identify the scheme/algorithm for you. to get an idea of some of standards look at this page https://www.cryptosys.net/pki/manpki/pki_rsaschemes.html yet any code (like php) could be using its own implementation, hence it need to be custom decryption method and of course this include padding. Share this post Link to post