0

I am using polymer.js on client-side. Have to fetch process.env from express server using the following:

app.get('/getkey', function(req, res){
     res.send(process.env.KEY);
});

But, it's written as response to browser on every GET request. Is there a way to hide this sensitive information from browser?

Base64 encode / decode is too basic. And I am not sure how to encrypt the info on express server and decrypt it back on polymer 3 element.

Please help.

Ashwini
  • 381
  • 6
  • 23
  • 1
    Any data that's on the browser is publicly visible and considered insecure. It doesn't matter if you encrypt in the server but once you decrypt it in the browser, it is public and will be visible to anyone using site. – Dinesh Pandiyan Nov 18 '18 at 15:24
  • Ended up using dotenv package. That's more efficient:) – Ashwini Dec 03 '18 at 23:21

0 Answers0