Skip to content

Instantly share code, notes, and snippets.

@drm
Last active September 13, 2024 19:04
Show Gist options
  • Save drm/da216840c0da3afab66737b6cdb788c3 to your computer and use it in GitHub Desktop.
Save drm/da216840c0da3afab66737b6cdb788c3 to your computer and use it in GitHub Desktop.
keypair encryption using openssl
openssl \
pkeyutl \
-encrypt \
-inkey <(ssh-keygen -f ~/.ssh/id_rsa.pub -e -m pem) \
-pubin \
-in ./foo.txt \
-out foo.enc
openssl \
pkeyutl \
-decrypt \
-inkey <(openssl rsa -in ~/.ssh/id_rsa -outform pem) \
-in ./foo.enc \
-out foo2.txt
Note to self: The way to continue from here is: check in public-key encrypted files with a symmetric key that can be used to encrypt and decrypt files in the repo.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment