Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

209
Views
How can I hide or encrypt my js code for normal users? Is this a right way to put my key in the front-end?

enter image description here

Hello, In terms of this picture, you can see my js code is easy to read for any user, and my important key and logic are naked.

1.Is it possible to hide or encrypt my code to prevent someone from reading my code maliciously? 2.What's the right way to store a public key or symmetric-key in the front-end? Is it correct to write it like this picture?

By the way, this testing project is written by Blazor WebAssembly.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

What you're looking for is code mangling/minification with a library such as uglify-js https://www.npmjs.com/package/uglify-js. This is not a replacement for security though, your JS should not contain sensitive data, that should be handled by a backend.

The short answer to your question is there is no way to obfuscate a key this way. If your frontend can decrypt that key to use it then a user can too.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!