Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6947433
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T13:41:33+00:00 2026-05-27T13:41:33+00:00

I know how asymmetric cryptography works. I know there are two keys (one private

  • 0

I know how asymmetric cryptography works. I know there are two keys (one private and one public).

When someone wants to communicate they exchange their public keys encrypt messages with those public keys AND then the respective message could be decrypted ONLY by the user that has the private key.

Now, I’m using Node.js and I need to do something like this…

I need an application that EACH hour reads a database, extracts data and saves it to a file that I need to send to another server.
My problem is that I DON’T WANT that file will be visible to other, I do the transfer using SSH so there is no problem BUT
I must encrypt that file because I’m not the admin of that server SO maybe someone could read it. Unfortunately the admin is the same for both servers.
So my idea is to encrypt the file with a public key, and then only he who has the private key(me) could decrypt it.

I think it is pointless using something like:

var key = 'blablabla'

If I use a public key, there is no problem, all can read it….. it is public indeed. But with this public key, nobody can decrypt the message, so it is
something like one-way encryption.

Now, could someone tell me if I need a signer/verifier to do this job, OR maybe I have to generate two keys (public/private) with openssl and pass those keys to a cipher/dechiper?

I’m looking at crypto modules, but there are no examples….

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T13:41:33+00:00Added an answer on May 27, 2026 at 1:41 pm

    In general, your idea is right – you encrypt using public key and decrypt using private key of yours. However, practically the procedure is more complex. Random symmetric key is generated and the data is encrypted using that key. Then the public key is used to encrypt the random key. Encrypted key is sent to recipient together with encrypted data. On the other side encrypted key is decrypted using a private key, then the data is decrypted.

    You can use OpenPGP keys or X.509 certificates to do the job.

    In case of OpenPGP the standard offers encryption and decryption as atomic procedures (on the user level). In case of X.509 certificates you need to use PKCS#7 / CMS.

    OpenSSL library offers operations with PKCS#7 / CMS, however when I look at nodeJS API for OpenSSL, that API is very limited and doesn’t expose those functions. Maybe you can write your own nodeJS module which will interface with OpenSSL and provide missing functions.

    Another alternative is to use OpenPGP keys and node-gpg module. That module uses gnupg to do the actual job, so gnupg must be installed.

    Unfortunately I don’t see any other suitable libraries in the 3rd-party module list provided in nodeJS wiki.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Lets say I have two computers. They know each others public and private IPs
Is there any way to perform private key encryption in C#? I know about
I understand the basic system of public vs. private keys and how if I
Imagine for a moment that we're using classic asymmetric encription with WCF (private/public key
Know of an OCAML/CAML IDE? Especially one that runs on Linux?
Is it possible to use pure Encrypting and Decrypting keys instead of private and
I created an asymmetric key on one of my SQL servers (2008). I encrypted
I know the logic two get into a symmetric matrix the values of an
I'm trying to understand how certificate and asymmetric encryption works. I'm looking for a
I wrote a function to compute the symmetric difference of two sets (one of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.