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: How is encryption implemented?

1 pointsby gymshoesover 6 years ago
I&#x27;ve read that best practices of generating keys with encryption is to use the API provided by the platform.<p>What exactly happens under that API? How is the algorithm that does the encryption actually hidden?

1 comment

rococodeover 6 years ago
The reason for using the API is not to &quot;hide&quot; the algorithm, but to prevent mistakes.<p>If you make a mistake in implementing or using an encryption algorithm, it may be easily broken. Encryption algorithms are relatively complex to implement, so it&#x27;s safer to go with a tried-and-tested implementation in the form of an established API.<p>Good encryption algorithms are all designed with the expectation that the algorithm will be widely known. The security is provided in a different way, through the expectation that only one entity holds the key that unlocks the encrypted data and that the algorithm will prevent anyone who doesn&#x27;t hold the key from being able to unencrypt the data anyways.