How to share a private key securely

SSH keys, certificates, connection strings, service-account JSON, and .env files

Short answer: OncePad is a free, no-account service for sharing a password, secret, or file through an end-to-end encrypted link. The link contains no decryption key, works once, and expires after 24 hours. Files may be up to 25 MB.

First ask whether the private key should move

The safest private key is often one that is generated on the destination and never exported. For SSH access, prefer adding the recipient's public key; for cloud access, prefer short-lived roles or workload identity. Share a private key only when the system genuinely requires the same key material on another endpoint.

If transfer is necessary

  1. Use the text mode for a PEM block, connection string, or small JSON document; use file mode for a key bundle, certificate archive, or .env file up to 25 MB.
  2. Send the key-less link through the work channel and the generated passphrase through a separate channel.
  3. Have the recipient store it with restrictive filesystem permissions or import it directly into the destination vault.
  4. Confirm receipt, then rotate or retire the transferred key as soon as the operational need permits.

Preserve the exact bytes

Text mode preserves line breaks, quotes, and delimiters for SSH/PGP keys, PEM certificates, database URLs, and service-account JSON. File mode seals the original filename inside the encrypted manifest. OncePad never parses or validates the key, so the sender must verify that the correct material was selected.

SSH: move the public key, not the private one

To give someone SSH access, have them generate a key pair on their own machine (ssh-keygen -t ed25519) and send you the .pub file. A public key is not a secret — it can travel by email or chat — and you add it to authorized_keys. The private key never leaves their machine. The same applies to deploy keys: generate one per repository or server, on the machine that uses it.

If a private key really must move — a shared CI deploy key, a hardware migration — protect the key file itself with a passphrase too (ssh-keygen -p -f keyfile), so the file is not usable on its own even after it is saved.

TLS certificates and keys

Generate the private key on the server that will use it and send only the certificate signing request (CSR), which is public, to whoever issues the certificate. If a key and certificate must be exported together, a password-protected PKCS#12 (.pfx/.p12) file sent as a OncePad file, with the PKCS#12 password and the OncePad passphrase on separate channels, keeps both layers apart.

Cloud service-account keys

Long-lived service-account JSON keys are among the most common causes of cloud breaches. Prefer workload identity federation, instance or managed identities, and short-lived tokens. When a key file is unavoidable, create it for one purpose, send it once, and set a reminder to delete it.

Questions

Is it safe to share an SSH public key?

Yes. A public key is designed to be shared and can travel by email or chat. Only the private key must stay secret.

How do I send a .pem or .key file?

Paste the PEM text into the text box, or send the file in file mode. The link carries no key and the passphrase goes on a second channel; the file can be downloaded once.

Should the key file have its own passphrase too?

Yes, when it has to move. A passphrase on the key file protects it after it is saved; the one-time link protects it in transit.