Skip to main content
133 votes

Is it completely safe to publish an ssh public key?

Public Keys are designed for sharing, read access to and or publishing a public key is fine Private Keys are secret, they should only be accessible to the owner of said private key. To drive this ...
CaffeineAddiction's user avatar
77 votes
Accepted

How great is the risk in publicly sharing part of a private key?

Providing any part of the private key makes it less secure, at least marginally, simply because it provides an attacker with a smaller potential key space to explore. I fail to understand what you ...
Stephane's user avatar
  • 18.7k
65 votes

Is it completely safe to publish an ssh public key?

Is it completely safe to publish an ssh public key? No, but you can do it anyway without worries (lots of people do, just look at https://sks-keyservers.net/i/ or https://pgp.mit.edu/) The reason why ...
Out of Band's user avatar
  • 9,293
55 votes

How great is the risk in publicly sharing part of a private key?

Revealing part of the private key can be catastrophic, for some asymmetric (public-key) cryptosystems. The exact level of risk depends on exactly which cryptosystem you are using. Some examples: If ...
D.W.'s user avatar
  • 100k
54 votes
Accepted

Protecting a private key by spreading it over multiple places

Just splitting the file up will not have the desired effect (as A.Hersean explains in their answer). I think what you're looking for is "Secret Sharing" algorithms, most notably Shamir's Secret ...
Mike Ounsworth's user avatar
47 votes
Accepted

Not understanding why I should use public/private key encryption over password?

The two options are intended for different use cases. Option 1 is intended for your use case. It encrypts the file with a key derived from a password, so that only the person who knows the password (i....
nobody's user avatar
  • 11.6k
46 votes

Best Practice: ”separate ssh-key per host and user“ vs. ”one ssh-key for all hosts“

This question can be considered from two different angles: security and convenience. When we create a SSH key pair, we are asked for providing a passphrase to add a more layer to protect the private-...
YaOzI's user avatar
  • 561
40 votes

Is it completely safe to publish an ssh public key?

Nothing is "completely safe"; the question is whether it adds any additional risks. The SSH protocol sends the client's public key encrypted, only after it has negotiated a symmetric session ...
Luis Casillas's user avatar
40 votes
Accepted

What prevents applications from misusing private keys?

You're absolutely right that Thunderbird – or any other application which gains access to the plaintext private key – could exfiltrate the key, make copies or take any other authorized action. The ...
Ja1024's user avatar
  • 22.9k
39 votes

Protecting a private key by spreading it over multiple places

A private or secret key is not meant to be cut. For example, if someone get hold of half of a symmetric key of 128 bits, the strength of the key would not be divided per 2, but it would be reduced by ...
A. Hersean's user avatar
  • 10.7k
32 votes
Accepted

Is assigning decrypted keys to a variable in application secure?

Yes, it does mean that the key will be stored in the application’s memory. Yes, there is a risk that malware (with sufficient privilege) can read it from there. This risk is hard to avoid — if you ...
Anders's user avatar
  • 65.8k
31 votes
Accepted

How can WhatsApp restore local or Google Drive Backups?

First assumption: The backup key is saved on WhatsApp servers too. Otherwise a local phone to phone backup would not work? TL;DR: Yes, after some investigation, this seems to be the case. Secondary ...
Yorick de Wid's user avatar
28 votes
Accepted

OpenSSH declares ssh-rsa deprecated. What do I do next?

You don't need to do anything to your keys. From the same page that you quoted: The better alternatives include: The RFC8332 RSA SHA-2 signature algorithms rsa-sha2-256/512. These ...
Joseph Sible-Reinstate Monica's user avatar
27 votes

Extracting the PGP keyid from the public key file

From the gpg manual (gpg (GnuPG) 2.2.11): --show-keys This commands takes OpenPGP keys as input and prints information about them in the same way the command --list-keys does for locally stored ...
Traz's user avatar
  • 381
27 votes

Is it completely safe to publish an ssh public key?

No, unless you use a unique one per service. It lets attackers identify you. If you use the same public key for service A and service B, and your public key gets leaked for both of them, this will ...
user541686's user avatar
  • 2,582
24 votes
Accepted

How to change (sub)key usage of a PGP key?

Since GnuPG 2.2.6 there's a hidden key-edit subcommand "change-usage" which does exactly that. Relevant commit. Let's try this subcommand with a test key. Let's create one first: mkdir /tmp/gpg-...
sanmai's user avatar
  • 464
24 votes

Do I need to hash or encrypt API keys before storing them in a database?

Yes, you should absolutely hash your API keys. In effect, they are your passwords and should be treated as such. And note that's hashed - not encrypted. You never need to decrypt the API keys, hence ...
Anders's user avatar
  • 65.8k
24 votes
Accepted

TPM or OpenSSL for key generation?

The difference between using some hardware backed key store (i.e. TPM, HSM, smartcard ...) and a "pure software" solution like openssl genrsa is not so much about the security of the key ...
Steffen Ullrich's user avatar
22 votes

How great is the risk in publicly sharing part of a private key?

How much faster could an attacker crack the key given those 8 chars? It's hard to answer without knowing what kind of key we are talking about and what algorithm it's used with. In the case of ...
zakinster's user avatar
  • 614
22 votes

Not understanding why I should use public/private key encryption over password?

There's one advantage of using public key cryptography over private key cryptography when you're encrypting file for yourself. When you use symmetric cryptography, you need to expose the password ...
Lie Ryan's user avatar
  • 31.6k
18 votes

Can a large corporation make a believable promise

However, if the third party makes a secret copy, then they can covertly sell it for large amounts of money. The thing about this is when it comes to a pivotal and highly-valued asset such as said key,...
mallocation's user avatar
  • 1,676
17 votes

Why are KDFs slow? Is using a KDF more secure than using the original secret?

The confusion here is that there are two distinct kinds of key generation function, and people often say "key derivation function" without being explicit which one they mean (or even understanding ...
Luis Casillas's user avatar
16 votes
Accepted

Can a large corporation make a believable promise

Companies make promises they can't renege on all the time - that's what a contract is. After all, insurance wouldn't exist if an insurer could wriggle out of paying claims through things like secret ...
mjt's user avatar
  • 415
15 votes

Is it completely safe to publish an ssh public key?

There is a slight risk of revealing your identity if your public key contains your hostname as a comment at the end, e.g. ssh-rsa C4F3B4B3... [email protected]. If your name is fairly uncommon ...
whirlwin's user avatar
  • 251
14 votes
Accepted

How does GnuPG encrypt secret keys?

GnuPG 2.x has a separate gpg-agent that is the custodian of secret keys and that offers no control whatsoever over the encryption parameters of the secret keys within. Furthermore, --s2k are accepted ...
starfry's user avatar
  • 321
14 votes
Accepted

Checking if an RSA private key is passphrase protected

Just open it, if it's encrypted it will begin with -----BEGIN RSA PRIVATE KEY----- Proc-Type: 4,ENCRYPTED DEK-Info: AES-128-CBC,0F5C7993DCFA4C0962CE249CFD854B91 if it is not it will begin directly ...
Sefa's user avatar
  • 1,752
13 votes

What prevents applications from misusing private keys?

With a private key in a file, there is nothing preventing it from being copied, extracted, or sent to a third party. It's also possible to have private keys in a TPM, HSM, or hardware key. These make ...
Sjoerd's user avatar
  • 34.4k
12 votes
Accepted

Rotating encryption keys - how does it work?

In layman's terms, rotating an encryption key implies: Generate new key(s) Re-encrypt all data that was encrypted using the old key, using new key(s) Delete old encrypted data and old encrypted key ...
gowenfawr's user avatar
  • 73.3k
11 votes
Accepted

Secure symmetric encryption of passwords to allow admins to log in as users

Generally, it's good practice to allow some other method of impersonation. By allowing administration staff access to passwords, you lose the ability to verify that a given user has performed a given ...
Matthew's user avatar
  • 27.4k
11 votes
Accepted

Why are KDFs slow? Is using a KDF more secure than using the original secret?

Not all KDFs are slow! Something like HKDF is extremely fast, and only involves a handful of invocations to the underlying PRF. KDFs are only slow when they're intended to convert a potentially low-...
Stephen Touset's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible