TE
テックエコー
ホーム24時間トップ最新ベスト質問ショー求人
GitHubTwitter
ホーム

テックエコー

Next.jsで構築されたテクノロジーニュースプラットフォームで、グローバルなテクノロジーニュースとディスカッションを提供します。

GitHubTwitter

ホーム

ホーム最新ベスト質問ショー求人

リソース

HackerNews APIオリジナルHackerNewsNext.js

© 2025 テックエコー. すべての権利を保有。

Ask HN: How do you store private keys?

5 ポイント投稿者: max_1日前
It seems there is no standard proper way to store private keys.<p>I have been using AGE [0]<p>And I really don&#x27;t like the idea of having the keys stored in the home directory in plain text.<p>There is also a risk of losing the keys if my laptop is damaged or gets stolen.<p>Is there a proper tool for storing encryption keys?

10 comments

mos_65021日前
&gt; It seems there is no standard proper way to store private keys.<p>The gold standard for this would be a Hardware Security Module (HSM), which is essentially a device that stores private keys with certain guarantees of physical security (e.g, that private key material cannot be extracted from the device once it has been generated or placed there, and the device performs operations using the key material on behalf of some client).<p>HSMs in various forms underpin all sorts of cryptosystems that society depends on, because securing private key material at rest is essential. You&#x27;ll find them everywhere from your debit&#x2F;credit card, to certificate authorities, financial institutions, defense, and your smartphone.<p>For your use case, I&#x27;d recommend taking a look at Yubikeys. I did a writeup a while back on how to use them to store different types of private keys for various purposes:<p><a href="https:&#x2F;&#x2F;blog.ctis.me&#x2F;2022&#x2F;12&#x2F;yubikey-piv-gpg&#x2F;" rel="nofollow">https:&#x2F;&#x2F;blog.ctis.me&#x2F;2022&#x2F;12&#x2F;yubikey-piv-gpg&#x2F;</a>
throwup2381日前
1Password with their SSH agent [1] for SSH keys, their CLI [2] for local secrets, and their terraform provider with service tokens for infrastructure keys&#x2F;secrets. Yubikey for the secrets I’m most paranoid about.<p>You can essentially encrypt all environment variables, not just SSH keys, by aliasing your terminal commands to the 1password CLI. I have a “secrets” repo where all dotenv files are checked in with values like “op:&#x2F;&#x2F;vault-name&#x2F;secret-name&#x2F;key-name” that get injected by the op cli.<p>[1] <a href="https:&#x2F;&#x2F;developer.1password.com&#x2F;docs&#x2F;ssh&#x2F;agent&#x2F;" rel="nofollow">https:&#x2F;&#x2F;developer.1password.com&#x2F;docs&#x2F;ssh&#x2F;agent&#x2F;</a><p>[2] <a href="https:&#x2F;&#x2F;developer.1password.com&#x2F;docs&#x2F;cli&#x2F;get-started&#x2F;" rel="nofollow">https:&#x2F;&#x2F;developer.1password.com&#x2F;docs&#x2F;cli&#x2F;get-started&#x2F;</a>
atmosx1日前
Paper. There’s a project called paperkey that allows you to store GPG keys on A4 paper. You could apply a similar approach to your age encrypted private keys or store them in plain text.<p>Modern smartphones have excellent OCR (optical character recognition) capabilities, so converting images of printed text back into digital form is now quite easy and reliable.<p>Personally, I use 1Password, and even they recommend printing out a PDF copy of your passwords and storing it in a secure location - like a physical vault. It’s a practical backup in case something happens and someone needs access to your credentials.
dale_huevo1日前
&gt; And I really don&#x27;t liek the idea of having the keys stored in the home directory in plain text.<p>so encrypt them.<p>or store them in a hardware token.<p>or on a USB stick (poor man&#x27;s hardware token).<p>&gt; There is also a risk of losing the keys if my laptop is damaged or gets stolen.<p>backups, full disk encryption.
评论 #44008002 未加载
toomuchtodo1日前
<a href="https:&#x2F;&#x2F;openbao.org&#x2F;" rel="nofollow">https:&#x2F;&#x2F;openbao.org&#x2F;</a>
imcotton約14時間前
I have previously written a blog post on this very topic, tl;dr: deleting your keys.<p><a href="https:&#x2F;&#x2F;blog.imcotton.xyz&#x2F;my-ssh-folder-has-no-private-keys" rel="nofollow">https:&#x2F;&#x2F;blog.imcotton.xyz&#x2F;my-ssh-folder-has-no-private-keys</a>
znpy1日前
AFAIK you should also be able to store them on the TPM (trusted platform module) on your pc.
bonki約21時間前
keepass
oulipo1日前
if you&#x27;re referring to SSH keys, you can use something like 1Password which stores them encrypted and syncs them in the cloud, so you keep them even if you lose your laptop
stop501日前
Smartcards + an printed backup in another location.