Skip to content

Instantly share code, notes, and snippets.

@robertdfrench
Created January 4, 2026 22:14
Show Gist options
  • Select an option

  • Save robertdfrench/537b7dba765230b2aee5ae4f8fcc79d7 to your computer and use it in GitHub Desktop.

Select an option

Save robertdfrench/537b7dba765230b2aee5ae4f8fcc79d7 to your computer and use it in GitHub Desktop.
#!/bin/bash
# 1. Generate the encryption Key
#
# This will save the *private* (secret) key to `private_key.age`
# and print the *public* (shareable) key to the terminal
age-keygen -o private_key.age
# 2. Send your public key to your co-conspirators via email or text
# 3. Save your co-conspirators' public keys to a file:
echo "age1ualzj2zuuja23xwmeldmmp669yylclpgnnvp8fj857qj55klh4ns620lxa" > robert.pubkey.age
# 4. Encrypt a file called `document.odf` for distribution
age -o encrypted_document.odt.age -R robert.pubkey.age document.odt
# 5. Email this file to your co-conspirators
# 6. Robert sends you a file called "hello.txt.age" and you want to decrypt it:
age -d -i private_key.age hello.txt.age
@robertdfrench
Copy link
Author

# 1. To set up ssh key:
ssh-keygen -t ed25519

# 2. Accept all the default options

# 3. Print your pub key (to see it)
cat ~/.ssh/id_ed25519.pub

# 4. Email this pub key to your collaborators

@robertdfrench
Copy link
Author

scp robertdfrench.com:~/message2.txt.age messag2.txt.age

@robertdfrench
Copy link
Author

# To upload:
scp document.odt.age robertdfrench.com:~/document.odt.age

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment