Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

187
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda