TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: How to Ensure Correct Encryption?

4 点作者 lukaszwojtow超过 2 年前
Hi, I&#x27;m writing my own encryption&#x2F;decryption tool as an exercise. I&#x27;m using separate, audited RSA library for actual encryption but everything else is on me. On my machine I have some ordinary RAM (not ECC) and a file system without error correction. So I&#x27;m trying to think what can go wrong: 1. A key gets corrupted in memory (through cosmic ray or memory error). 2. A key can be read from the disk with error. 3. File can be saved with an error.<p>My ideas to solve it: Ad 1. Have two keys in memory and compare them before encrypting each file. Ad 2. Some sort of checksum (I assume that public key has no such thing). Ad 3. The only thing I can think of: after encryption compare with &quot;valid&quot; (probably encrypt again and compare).<p>Can you think of anything else?

1 comment

LinuxBender超过 2 年前
I believe you will find most folks here will be against the concept of writing ones own encryption even if as a personal exercise. That said I am not a cryptologyst and can only suggest lurking on Cryptography and Security Stackexchange [1][2] for some time and then posting a detailed question&#x2F;discussion on this topic. There may be other groups indirectly related to cryptography. [3] I personally think it is great you are taking on such a challenge and hope that you share here what you learned.<p>[1] - <a href="https:&#x2F;&#x2F;crypto.stackexchange.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;crypto.stackexchange.com&#x2F;</a><p>[2] - <a href="https:&#x2F;&#x2F;security.stackexchange.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;security.stackexchange.com&#x2F;</a><p>[3] - <a href="https:&#x2F;&#x2F;stackexchange.com&#x2F;sites#" rel="nofollow">https:&#x2F;&#x2F;stackexchange.com&#x2F;sites#</a>