123
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 ...
62
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 ...
57
votes
Accepted
Why is key exchange necessary at all?
If the attacker is able to passively capture data and later gets access to the private key of the certificates (i.e. stealing, heartbleed attack or law enforcement), then the attacker could decode all ...
41
votes
Accepted
Does public key cryptography provide any security advantages, or even just a different security model, over symmetric cryptography?
You incorrectly assume that a secure channel is needed to obtain a public key. This is not the case. It's sufficient to have a trusted third party bind a public key to a specific identity through a ...
37
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 ...
26
votes
"Diffie-Hellman Key Exchange" in plain English
The key exchange problem
A secure connection requires the exchange of keys.
But the keys themselves would need to be transfered on a secure connection.
There are two possible solution:
exchange the ...
26
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 ...
23
votes
Accepted
Which host key algorithm is best to use for SSH?
Currently,
RSA is still recommended as a gold standard (strong, wide compatible)
ed25519 is good (independent of NIST, but not compatible with all old clients).
Server is usually providing more ...
20
votes
Which host key algorithm is best to use for SSH?
Since the algorithms are in a state of flux, I find that using an ssh-audit tool (available on Github) (here's a more recent fork) to be extremely useful.
Example output of a current but secured SSH ...
20
votes
Accepted
What is the difference between Key, Certificate and Signing in GPG?
In public key cryptography, the key is usually a key pair, consisting of a public key and a private key, and it is what you do encryption, decryption, signing, and verification with.
"A key ...
18
votes
Which host key algorithm is best to use for SSH?
CHOOSING AN ALGORITHM AND KEY SIZE
SSH supports several public key algorithms for authentication keys.
These include:
rsa - an old algorithm based on the difficulty of factoring large
...
17
votes
Accepted
Why is asymmetric encryption less efficient than symmetric encryption?
This depends on the algorithm. Especially with asymmetric cryptography, the speeds vary wildly. You may want to check out eBACS for more detailed and machine-independent benchmarking of various crypto ...
16
votes
Why is key exchange necessary at all?
There are many steps needed to understand the reasons and I will try to guide you through each.
1) Use encryption correctly...
With RSA algorithm, Alice and Bob can just share their public keys
(...
14
votes
Accepted
Why do the roles of public/private keys reverse when talking about public key encryption and digital signatures?
I cannot reconcile in my head how or why the roles of the keys suddenly reverses.
(I'm primarily focusing on RSA signatures.)
Anyone can produce an encrypted message (by using your public key) and ...
14
votes
Recommended asymmetric algorithms for JWT?
The short answer is to use RS256, to be understood as SHA 256 with RSA 2048 bits keys.
See RFC 7518 JSON Web Algorithms (JWA) for all supported algorithms.
On signing algorithms
There are two major ...
13
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 ...
13
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 ...
12
votes
Accepted
How to encrypt using a private key file generated by OpenSSL?
Do not use the OpenSSL command line to encrypt or sign anything. The OpenSSL command line is a debugging tool. To encrypt or sign a message, use a tool designed for this purpose, such as GPG.
A ...
12
votes
Does public key cryptography provide any security advantages, or even just a different security model, over symmetric cryptography?
In addition to the factors mentioned in other answers, preshared keys force the third party (Carol, in your example) to know exactly which parties are communicating. With public-key certificates, Bob ...
11
votes
"Diffie-Hellman Key Exchange" in plain English
Securing data as it passes through the internet usually requires protecting it in two ways:
Confidentiality -- assuring no one except the intended recipients can read the data
Integrity -- assuring ...
11
votes
Accepted
Ways to generate symmetric and asymmetric keys
You seem to ask for a comparative study on the PRNG (pseudo-random number generators) used by default by OpenSSL and the Linux kernel. This could most probably fill a volume full of mathematical ...
11
votes
How to encrypt using a private key file generated by OpenSSL?
The private key is used to decrypt, and to sign things. You don't use it to encrypt. You use the public key for that. But openssl genrsa will not generate the public key, only the private. To encrypt ...
10
votes
Can data be decrypted with the public key if encrypted with the private key?
The usage of asymmetric keys is as follows:
Encryption is done using the public key
Signing is done using the private key
Encryption:
The data is encrypted using the public key
The encrypted data ...
10
votes
Accepted
How does the Certificate Authority work
The CA doesn't send any public keys to clients.
The CA signs the server's public key with their private key and then gives that signature to the server. When the client connects to a server, the ...
10
votes
What gpg defaults can be improved, when performance is not an issue?
1) password hashing iterations
If you don't care about waiting a little longer, you can use the maximum count value, which is 65011712. This isn't strictly the number of iterations so much as the ...
10
votes
Accepted
Create encryption key from decryption key (password)?
One way to do this is to use elliptic curve (EC) cryptography. Alice could start by taking a SHA256 hash of her password, which would result in a 256-bit value which she could use as her private key. ...
9
votes
Accepted
Log in without password using SSH, knowing authorized_keys?
You cannot generate a private key from a public key. That's the whole point of public-key cryptography.
The public key is not encrypted. Even if you don't understand what the numbers do, they're in a ...
9
votes
Can data be decrypted with the public key if encrypted with the private key?
Looks like public key is not secret. But if I encrypt with private, someone can decrypt with public which is easy accessible. Where is logic?
So let's go the public encrypt -> private decrypt route. ...
9
votes
Accepted
Asymmetric encryption of very small messages
Probably the best you can do is to use Curve25519 to derive a secret and then use the secret to derive a key and IV which are used to encrypt the data symmetrically with an AEAD. That would expand ...
8
votes
What are the disadvantages of using public key cryptography when encrypting files?
Your friend is correct in that private key encryption is not the tool for the job. This answer on Cryptography.SE does a good job of explaining why. Some highlights:
Any public-key encryption ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
asymmetric × 299encryption × 128
cryptography × 64
rsa × 44
public-key-infrastructure × 42
digital-signature × 32
key-management × 24
tls × 21
authentication × 21
gnupg × 15
pgp × 15
ssh × 14
aes × 13
certificates × 12
jwt × 11
key-exchange × 10
hash × 9
public-key × 8
web-application × 7
openssl × 7
decryption × 7
passwords × 6
key-generation × 6
diffie-hellman × 6
email × 5