gnxaza
Last Updated: February 25, 2016
·
1.297K
· blainesch

Encrypt binary files with keybase

Currently I cannot seem to find a way to encode real files with keybase so I decided to base64 it first as a temporary work around. Of course I made a few functions to help out with this, here they are in practice:

-> % .encrypt example.jpg blainesch

You need a passphrase to unlock the secret key for
user: "keybase.io/blainesch <blainesch@keybase.io>"
4096-bit RSA key, ID 8B595CB9, created 2014-03-06 (main key ID 524B1779)

-> % .decrypt example.jpg.asc

You need a passphrase to unlock the secret key for
user: "keybase.io/blainesch <blainesch@keybase.io>"
4096-bit RSA key, ID E98BE3788B595CB9, created 2014-03-06
         (subkey on main key ID 763CCD80524B1779)

info: Valid signature from you

The signature is .encrypt FILE THEM and .decrypt FILE. Here is the source:

# Keybase
function .encrypt() {
    base64 $1 | keybase encrypt -s $2 > $1.asc
}
function .decrypt() {
    keybase decrypt $1 | base64 --decode > ${1%.asc}
}

1 Response
Add your response

22553

This is now out of date, as keybase supports encrypting files directly.

Just thought I'd mention it as this protip was the second result on Google for "keybase encrypt file" :)

over 1 year ago ·