What is Nostr?
Lexu /
npub1gnq…3t2c
2024-12-11 15:16:03

Lexu on Nostr: In case anyone is like me, wondering if ssh-agent can somehow be used to encrypt ...

In case anyone is like me, wondering if ssh-agent can somehow be used to encrypt data, well, yes, kind of. Signing the same data with the same key and the same namaspace produces the same output, so that can be used as a "password" to derive the key from.

$ openssl rand 128 >master
$ echo secret | pass=$(ssh-keygen -Y sign -f ~/.ssh-id_ed25519 -n enc <master | openssl base64 -d | sha256) openssl aes-256-cbc -a -pass env:pass
Author Public Key
npub1gnqqrey2wyvgwuwqh4mw73s7sypr4jre7ls764rd8fwnvfjw8mcqu53t2c