Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

184
Vistas
Encrypting in php with Openssl on remote server and decrypting on local

I am encrypting a string on a remote server and saving the result in a .txt file. I generated a pair of public and private keys on my local server, and transferred the public key on the remote one. Summary of logic:

$publicKey = openssl_pkey_get_public(file_get_contents('public_key.pem'));
openssl_public_encrypt($toBeEncrypted, $encrypted, $publicKey);
file_put_contents('result.txt', $encrypted, FILE_APPEND); 

If I do both encryption and decryption on my local server, it works. However, it does not work if I transfer the encrypted file from remote to local server and attempt to decrypt. I assume this is a certificate issue, but I am not sure how to fix it. I don't think I fully understand the steps and components involved between encrypting the file on the remote server and decrypting it locally. Please shed some light of what I am missing.

over 4 years ago · Santiago Trujillo
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda