From ed25519-sk to authorizing SSH with a fingerprint on my Mac

August 23, 2025

On August 23, 2025, I set up SSH keys on my new Mac.

It was meant to be an ordinary development setup task: generate a key, add the public key to GitHub, then get back to pulling code. As I looked through the key types, though, I noticed options with a -sk suffix, such as ed25519-sk. I knew regular ed25519 better. That extra suffix made me stop and look it up.

Once I realized it referred to hardware security keys, I immediately wondered: My Mac already has a security chip and Touch ID. Could it hold my SSH private key and let me authorize its use with a fingerprint?

The answer turned out to be yes, but OpenSSH FIDO security keys and Apple Secure Enclave integration are two separate paths. What appealed to me was avoiding a long private-key passphrase in daily use while reducing the risk of someone copying the private key.

What does the sk suffix mean?

sk stands for Security Key. OpenSSH 8.2, released in 2020, added support for FIDO/U2F authenticators with the ecdsa-sk and ed25519-sk key types. Signing requires the corresponding authenticator and usually a touch to confirm the operation. Available algorithms and capabilities depend on the hardware. OpenSSH 8.2 release notes

An ordinary SSH private key is usually a file on disk, such as ~/.ssh/id_ed25519. With a security key there may still be a local file that looks like a private-key file, but it mainly holds information needed to locate the credential, among other things. It cannot authenticate independently of the corresponding hardware. Copying the file to another computer does not copy the ability to sign in.

That drew my attention to a more practical question than the algorithm name: who holds the key, and whose approval does it take to use it?

Strictly speaking, this concerns digital signatures in SSH authentication. The client signs with a private key, and the server verifies with the registered public key. Encryption of connection data has a separate negotiation process. Adding -sk does not automatically switch the transport to a stronger encryption algorithm.

If Macs support FIDO, why can’t I simply select ed25519-sk?

Several Apple-related concepts are easy to conflate:

NameRole
Secure EnclaveIsolates sensitive operations, protects keys, and performs cryptographic operations
Touch IDVerifies the operator’s fingerprint locally to approve protected operations
FIDO and WebAuthnDefine authentication mechanisms between authenticators and websites or applications
SSH agentReceives signing requests from SSH clients and routes them to the appropriate key

Apple supports WebAuthn-based passkeys and can authorize them through Touch ID. The terminal’s inability to call the authenticator directly does not mean Apple “doesn’t support FIDO.” Apple passkeys can also sync via iCloud Keychain. That differs from the non-exportable SSH key bound to one Mac discussed below. Apple on passkey security

The sticking point is the interface. OpenSSH’s usual FIDO integration talks to an authenticator through security-key middleware. Apple’s platform authenticator is managed through system APIs. By default, ssh-keygen -t ed25519-sk won’t simply use the Mac’s Touch ID as if it were an external FIDO security key.

The algorithm is another difference. With the Secure Enclave key interface discussed here, this SSH path uses ECDSA P-256, rather than Ed25519. P-256 is a standard algorithm in its own right. FIDO does not require every authenticator to support Ed25519. Apple’s Secure Enclave key documentation

What I actually needed, then, was a tool that could send SSH signing requests to the Secure Enclave.

Secretive connects SSH to the security chip

Secretive does exactly that. It provides a native Mac management interface and an SSH agent, letting an SSH client use keys protected by the Secure Enclave and optionally requiring Touch ID authorization. These capabilities were already present in its version 2.4.1 documentation.

An SSH public key generated this way has the following type:

ecdsa-sha2-nistp256

There’s no -sk suffix, yet the key can still have hardware protection. The public key type describes the algorithm and format for verifying signatures. The presence or absence of sk alone cannot tell you whether hardware holds the private key.

Here is how a single authentication works:

sequenceDiagram
    participant C as SSH 客户端
    participant A as Secretive agent
    participant M as macOS 与 Secure Enclave
    participant G as GitHub
    C->>A: 请求使用公钥对应的私钥签名
    A->>M: 请求受保护的签名操作
    M->>M: 按配置验证 Touch ID 等授权
    M-->>A: 返回签名结果
    A-->>C: 返回签名结果
    C->>G: 提交公钥认证请求和签名
    G->>G: 使用已登记的公钥验证
    G-->>C: 认证结果

The fingerprint stays in the local authentication process. GitHub receives the public key and signature required by SSH. Regular SSH keys don’t send the private key to the server at login either. The difference here is how the private key is stored and used locally.

GitHub supports this kind of P-256 key

GitHub supports ECDSA SSH keys and doesn’t need special authentication just for Apple’s security chip. As early as its 2021 Git protocol security update, GitHub listed ECDSA as a supported client key option. GitHub’s announcement

Here’s a setup sequence:

  1. Install Secretive, create a Secure Enclave key in the app, and enable the access control that requires Touch ID.
  2. Follow the app’s setup instructions to tell SSH to use Secretive’s agent.
  3. Copy the complete public key, starting with ecdsa-sha2-nistp256.
  4. In GitHub, open Settings → SSH and GPG keys → New SSH key. Add the public key, select Authentication Key, and give it a name identifying the device and date.
  5. Test the connection with the following command.
ssh -T git@github.com

A GitHub response containing successfully authenticated confirms authentication. The message that follows about not providing shell access is normal. On first connection, also verify GitHub’s host fingerprint. See GitHub’s steps for adding a public key and its guide to testing the connection.

The repository remote must also use SSH, for example git@github.com:用户名/仓库名.git (username/repository). If you keep an HTTPS remote, configuring the SSH agent won’t automatically change Git’s authentication.

Another easy misunderstanding: running ssh-keygen -t ecdsa -b 256 produces an ordinary software key. Sharing the P-256 algorithm does not automatically give it Secure Enclave protection. For hardware protection the key must be created by a tool that calls the corresponding interface.

Where the convenience and security each come from

The immediate benefit is replacing routine private-key passphrase entry with a fingerprint confirmation. Here the passphrase protects the private key locally. It’s separate from the GitHub account password or a remote server’s login password.

Traditional SSH keys don’t necessarily require entering a passphrase for every operation, either. ssh-agent can cache unlocked keys, and macOS Keychain can help manage passphrases. Compare the actual configurations rather than assuming ordinary SSH asks for a password every time. OpenSSH agent documentation

What I value more is avoiding manual entry while retaining an explicit local authorization step and keeping the private key non-exportable.

If someone gains read access to a regular file-based private key, they may copy it. A strong passphrase prevents immediate use of the copied file, but someone can keep it and try to crack it offline. Obtaining an already-unlocked private key presents a different risk.

The Secure Enclave is designed to keep plaintext private keys out of applications. An application asks the hardware to sign and receives only the result. Even if wrapped key material is stored on disk, it cannot simply be copied to another computer for use. This reduces the risk that someone can steal a key once and keep impersonating you elsewhere. Apple on key protection and device binding

The security gain comes from key isolation, non-exportability, and access control at the point of use. It doesn’t establish that P-256 is safer than Ed25519 or that a fingerprint makes the signature algorithm stronger.

Non-exportability changes how I move to a new machine

I was researching this while switching computers, so the trade-off was easy to see. I could migrate an encrypted private-key file before, but a Secure Enclave-bound key can’t be moved to the new computer that way. Secretive explicitly says these keys cannot be exported for backup or transferred to another Mac. Generate a fresh key and register the new public key when changing machines. Secretive on backups and transfers

I’d treat it as “this Mac’s identity”. Generate keys independently on each device and name them separately in GitHub. When a device is retired or lost, revoke its public key. Keep a separate account recovery method and another controlled management path to servers.

Hardware protection cannot decide whether each action makes sense. A non-exportable private key doesn’t prevent malicious programs from requesting signatures or abusing an already authorized session. Check the source of any unexpected authorization prompt. An ordinary ECDSA signature also cannot prove to GitHub that Touch ID was used this time. That requirement is enforced by the local key’s access policy.

For pulling and pushing code and logging into servers from my Mac, the trade-off works well. The key stays with the device, a fingerprint authorizes use, and a new machine gets a new public key. This cuts passphrase entry and improves protection against private-key copying.

Setting up a new computer was an ordinary task. Taking a second look at -sk changed how I understood SSH keys. The security chip in a Mac does more than unlock the system. It can take part in everyday development and improve convenience and security together.

Related notes: Setting up my Mac development environment.

Experience recorded August 23, 2025. Technical explanation compiled November 13, 2026. This article describes the Secure Enclave P-256 and Secretive approach available then. Exact settings depend on your version.

© 2025 borui. All rights reserved. This content may be freely reproduced, displayed, modified, or distributed with proper attribution to borui and a link to the article: borui (2025-08-23). From ed25519-sk to authorizing SSH with a fingerprint on my Mac. https://caiborui.com/blog/2025-08-23-zh-mac-secure-enclave-ssh-touch-id-entrans

@misc{borui2025-ff1d7787,
  author = {borui},
  title = {{From ed25519-sk to authorizing SSH with a fingerprint on my Mac}},
  year = {2025},
  publisher = {borui's blog},
  url = {https://caiborui.com/blog/2025-08-23-zh-mac-secure-enclave-ssh-touch-id-entrans}
}