Skip to content

OpenSSH keys with passphrase not saving correctly #13878

@soreikomori

Description

@soreikomori

Steps To Reproduce

  1. Generate an SSH key with an SSH client like OpenSSH like so: ssh-keygen -t ed25519 -f examplekey -C "test" and give it any passphrase
  2. Copy the private key into Bitwarden as an SSH key using the "Import key from clipboard" button
  3. When prompted, type the correct passphrase that was set earlier
  4. Retrieve it and compare the original vs. exported version of the key
  5. Use said key if needed

Expected Result

The key should be the exact same as what was imported.

Actual Result

The key is slightly changed, and seems to be missing the bcrypted encryption header.

Screenshots or Videos

No response

Additional Context

Here's an example of a throwaway key I just generated doing ssh-keygen -C "examplekey" -t ed25519, with the passphrase pass.

-----BEGIN OPENSSH PRIVATE KEY-----
b3BlbnNzaC1rZXktdjEAAAAACmFlczI1Ni1jdHIAAAAGYmNyeXB0AAAAGAAAABAfttgzdQ
4TAlB4F/iEWmhoAAAAGAAAAAEAAAAzAAAAC3NzaC1lZDI1NTE5AAAAIHAWT+jUW+0aBA7E
uFHtxFwOvBmXH/u3HUq3rF9hl5W4AAAAkJdSZmQ8o5JfdzvulNQWXwcNnN13DysgKmIvN5
gMEbIbDKMqVYjA5ePDw7bwCPzA81qEMHRaa75LWrKaLr8ctmG6WZ6EToctSdOwqQwC/b/+
ATHolu0n0BRptl38EKo0MLLlNSOdmIAyUardSGHXmlknxVJMnKhTh4md0dyeRDBZekibIw
tZHv+Og15+GvUFeQ==
-----END OPENSSH PRIVATE KEY-----

Once I copy that block of text and put it in Bitwarden, the key is then shown as

-----BEGIN OPENSSH PRIVATE KEY-----
b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAAAMwAAAAtzc2gtZW
QyNTUxOQAAACBwFk/o1FvtGgQOxLhR7cRcDrwZlx/7tx1Kt6xfYZeVuAAAAJA3HRACNx0Q
AgAAAAtzc2gtZWQyNTUxOQAAACBwFk/o1FvtGgQOxLhR7cRcDrwZlx/7tx1Kt6xfYZeVuA
AAAED6wyi3mQFY6JEVwrvET/aaH4gSKL0xjSy1be/F7FqVSnAWT+jUW+0aBA7EuFHtxFwO
vBmXH/u3HUq3rF9hl5W4AAAACmV4YW1wbGVrZXkBAgM=
-----END OPENSSH PRIVATE KEY-----

In Bitwarden. The header b3BlbnNzaC1rZXktdjEAAAAACmFlczI1Ni1jdHIAAAAGYmNyeXB0 has changed to b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQ.

When attempting to use a key with said modification for auth purposes (in my case it was git clone, having copied the key over to an empty file), it fails.

Operating System

Windows

Operating System Version

11 IoT LTSC

Installation method

Direct Download (from bitwarden.com)

Build Version

2025.2.1

Issue Tracking Info

  • I understand that work is tracked outside of GitHub. A PR will be linked to this issue should one be opened to address it, but Bitwarden doesn't use fields like "assigned", "milestone", or "project" to track progress.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions