TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ask HN: What’s best practice for securing API keys in open source projects?

8 pointsby martialgabout 3 years ago
I’m working on a project that I want to open source, but it uses an API key that I want to keep hidden from untrusted parties. What’s best practice on how to do that? Google is really vague about “encrypting” it.

2 comments

FrenchDevRemoteabout 3 years ago
put it in an .env file and add the .env file to .gitignore?
评论 #31450842 未加载
评论 #31448582 未加载
danenaniaabout 3 years ago
Check out <a href="https:&#x2F;&#x2F;www.envkey.com" rel="nofollow">https:&#x2F;&#x2F;www.envkey.com</a> (disclaimer: I&#x27;m the founder).<p>It&#x27;s open source. It uses client-side end-to-end encryption to avoid trusting the host server. You can either use our cloud (easiest option, free for up to 7 users, 2 minute setup) or self-host it (bit more work).