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 ...
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 ...
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 ...
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 ...
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 ...
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....
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-...
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 ...
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 ...
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 ...
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 ...
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 ...
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
...
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 ...
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 ...
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-...
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 ...
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 ...
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 ...
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 ...
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,...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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
...
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 ...
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-...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
key-management × 870encryption × 240
pgp × 109
cryptography × 95
public-key-infrastructure × 94
gnupg × 90
key-generation × 72
ssh × 58
authentication × 47
tls × 42
key-exchange × 41
rsa × 34
key × 34
certificates × 33
web-application × 32
aes × 30
hsm × 28
passwords × 26
password-management × 24
asymmetric × 24
appsec × 23
openpgp × 23
windows × 21
storage × 20
digital-signature × 19