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.5k
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 ...
Ja1024's user avatar
  • 4,719
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.5k
14 votes

What happens when I encrypt something with my RSA Public Key?

There is a common misconception that signing a message is the same as encrypting the message with the private key. This notion is fundamentally incorrect, as pointed out by Thomas Pornin at If the ...
mti2935's user avatar
  • 23.4k
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 ...
ruakh's user avatar
  • 229
11 votes
Accepted

Using Public Key Cryptography for improving 2FA?

There are a few issues with your scheme that I can think of: the server would have to store several keys per user, where the current scheme needs just one secret to be stored for multiple client ...
schroeder's user avatar
  • 129k
7 votes

Using Public Key Cryptography for improving 2FA?

2FA is not one thing. It's a general concept, where you have two factors. The factors may be a shared secret you have, or it may be a PKI certificate the user has. It may be U2F. If you have concerns ...
vidarlo's user avatar
  • 16k
7 votes

What happens when I encrypt something with my RSA Public Key?

There are lots of mixing terminology here. In short RSA Signing is Not RSA Decryption by Cornell CS. RSA is a trapdoor permutation, unfortunately, that can be both used for encryption and signature. ...
kelalaka's user avatar
  • 5,549
7 votes

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

So what's the point of using a private key instead of a password if the private key itself is password protected? Why wouldn't I want to straightforwardly use option 1? In this case it's probably not ...
vidarlo's user avatar
  • 16k
7 votes

Does public key cryptography provide any security advantages, or even just a different security model, over symmetric cryptography?

Emphasis mine: Alice's public key is useless to Bob unless he can prove that the public key came from Alice. To do this, Bob and Alice can establish a secure channel to exchange Alice's the public ...
Jason's user avatar
  • 71
5 votes
Accepted

How can I prove the content of a PGP-encrypted message to a third party?

In principle your private key can be used to extract the random symmetric key within the message. This random symmetric key could then be supplied to decrypt the message without exposing your private ...
user10216038's user avatar
  • 8,113
5 votes
Accepted

When signing with server public key, how do I prove server key is trustworthy?

My understanding is that LetsEncrypt certificates are considered self-signed, and not as trusted as CA-generated certificates. No. The CA certificate of Let's Encrypt is issued and signed by CA "...
mentallurg's user avatar
  • 12.3k
4 votes

How can I prove the content of a PGP-encrypted message to a third party?

Neardupe What usually happens to the symmetric (session) key after decrypting an email? Can the key be recovered if changing private keys? You tagged GnuPG which has a specific feature to expose the ...
dave_thompson_085's user avatar
4 votes
Accepted

What are possible implications of ignoring the ssh host key warning?

Publickey authentication does not mitigate man in the middle attacks, but the risk of compromising other servers can be reduced, depending on the client configuration. Sorry for the long answer, but ...
Manfred Kaiser's user avatar
3 votes

What are possible implications of ignoring the ssh host key warning?

The ssh host key warning means that the public key that your ssh client now sees for the server is not the same as the public key that your client saw for this server previously. This means that you ...
mti2935's user avatar
  • 23.4k
3 votes
Accepted

converting just a public key from PEM to DER using openssl

The pkey subsystem offers a -pubin option to specify that the input is actually a public key: openssl pkey -in public_key.pem -pubin -outform der -out public_key.der
Banyoghurt's user avatar
3 votes

Best ways to store private keys on a client?

Essentially, the problem you are trying to solve is the same as DRM. It is practically impossible to securely store secrets client side (at least without specialized hardware), since the user has ...
nobody's user avatar
  • 11.5k
3 votes

Is VPN "safer" for public key encrypted connections

The use of public key encryption means the website server needs to know the original connecters' public key... That's not how HTTPS works. No public key of the client is involved unless client ...
Steffen Ullrich's user avatar
3 votes
Accepted

GPG allows importing an invalid secp256k1 public key

If an EC public key is valid, then the x,y values of the EC public key point should lie on the EC curve, which is defined by the equation: y^2 = x^3 + ax + b For secp256k1, a=0 and b=7. If a point ...
mti2935's user avatar
  • 23.4k
2 votes
Accepted

Verify signature without digest

EVP_Digest{Sign,Verify}* always hash the data before signing/verifying; that's their whole purpose. Less obviously, the older (before 1.0.0 in 2010) EVP_{Sign,Verify}* also do this. Trying to get them ...
dave_thompson_085's user avatar
2 votes

VPS host shows plain text "root" account password upon reinstall of unmanaged VM

If somebody wants to access your virtual server via SSH, they need the server's IP address and your password. However, if there is no password in place, they could immediately set a password and ...
SSHdabb's user avatar
  • 21
2 votes

Deriving digital signature key pair deterministically from an arbitrary secret

It's possible, but there are some caveats to be aware of. At first glance, it might seem that ECDH lends itself well to this, as an ECDH private key is nothing more than a 256-bit value. So, in theory,...
mti2935's user avatar
  • 23.4k
2 votes

Using Public Key Cryptography for improving 2FA?

the secret is stored on both the client and the server. This in turn means, that anyone with access to the database (and a key for it) knows the 2fa-secret of all the users. Why is this acceptable? ...
usr-local-ΕΨΗΕΛΩΝ's user avatar
2 votes

Why does Lightsail require the server's private key to connect via SFTP?

It's almost certainly not the server's private key, but rather a user private key that AWS is, for some reason, generating for you. In this case, the server already knows the public portion of the key ...
CBHacking's user avatar
  • 47.6k
2 votes

Using Private Key for encryption

You don't encrypt with a private key. You sign the message with one. One of the biggest misconceptions that I have seen here is that you can perform authentication of message by encrypting with a ...
Manish Adhikari's user avatar
2 votes
Accepted

PGP key pair - How to set up for multiple users to decrypt messages with Kleopatra

Given the (unfortunate) requirement -- that the sender will encrypt to only one public key even though PGP allows multiple -- your idea was correct: export what cryptographers now call the private key ...
dave_thompson_085's user avatar
2 votes

Does public key cryptography provide any security advantages, or even just a different security model, over symmetric cryptography?

The key difference is simple: public-key cryptography eliminates the need for the channel used to communicate the public keys to be secure against eavesdropping. All that Alice and Bob need to do is ...
Austin Hemmelgarn's user avatar
2 votes

Will sky fall if I don't verify `AuthenticatorAttestationResponse`?

The server (but not the client) absolutely must receive, and validate, multiple parts of the AuthenticatorAttestationResponse beyond just the public key. Failure to do this would reduce the phishing ...
CBHacking's user avatar
  • 47.6k
1 vote

How can I verify the hash of the plain text without being able to decrypt the cipher text?

There are a few things to unpack here. First, as @MechMK1 points out in the comments, private keys are normally not sent over the network (even after they've been encrypted). Usually in group chat ...
mti2935's user avatar
  • 23.4k

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