How to encrypt a message by using a .pub file?

0

I received a file named id_rsa1.pub from a company so I can send them an ecrypted message.

But I can't import it to my program "Kleopatra", because the file format is not supported. Unfortunately they don't use .pgp

How can I send them an encrypted message by using the .pub file?

Black

Posted 2020-02-24T13:39:59.223

Reputation: 3 900

What do you see after opening the file in a text editor? Does it have a recognizable text header at all? Note that the filename suffixes are not set in stone for most public-key formats (a PGP key could be .gpg, .asc, or indeed even .pub; not necessarily .pgp). – user1686 – 2020-02-24T13:43:26.260

I see something like ssh-rsa AAAAB3... – Black – 2020-02-24T13:43:55.553

Answers

3

I received a file named id_rsa1.pub from a company so I can send them an ecrypted message. [...] I see something like ssh-rsa AAAAB3...

This file is in the SSH format, where it is used for authentication (short-term digital signatures), and was never meant to be used for encryption at all.

Even though it is an RSA key so it's technically possible to use it for encryption, there are no standard tools for doing so and they don't produce a standard data format. At minimum, even if you found instructions for encrypting data to SSH keys (e.g. using openssl), you would need to know whether the recipient will use the same tool to decrypt.

It cannot be used as a PGP key or converted to a PGP key in any useful manner, because it doesn't carry the PGP-specific metadata (if you tried to make things up, it wouldn't match what the recipient has)... and if the recipient wanted you to use PGP, they would simply have sent you a PGP key to begin with. Same goes for using it as an S/MIME certificate.

Ask the company whether they sent you the correct key, and if so, what tools or what encryption format they expect you to use.

user1686

Posted 2020-02-24T13:39:59.223

Reputation: 283 655