Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip encryption when input is already in age encrypted and armored form #109

Open
batsatt opened this issue Jan 11, 2024 · 1 comment
Open
Labels
enhancement New feature or request

Comments

@batsatt
Copy link

batsatt commented Jan 11, 2024

First of all, thank you for creating this tool! I considered using zint, but am no expert on QR codes and don't want to become one for this use case. I'm quite happy with the output of paper-age.

I want to backup age identity files using paper-age, but I also want them encrypted locally, in armored form. I'll generate keys using a bash function like so:

createAgeKeyPair() {
    local privateKeyFile="${1}"
    local publicKeyFile="${2}"
    local key=$(rage-keygen 2>1)
    local publicKey=$(echo "${key}" | grep "public key: age1" | awk '{print $NF}')
    echo "${key}" | rage -p -a -o "${privateKeyFile}" -
    echo "${publicKey}" > "${publicKeyFile}"
    unset key
}

When the private key file is passed into paper-age it becomes double encrypted. This would not be a serious problem except for the fact that it is easy to use a different passphrase at this point (e.g. by mistake), rendering it potentially impossible to decrypt.

If you are open to this, it seems to me that the safest way to support what I am asking for is to add a flag to skip encryption IFF the input is in the correct form, resulting in an error if it is not.

@matiaskorhonen
Copy link
Owner

Hi, that's an interesting idea.

I'll have to think about it a bit…

@matiaskorhonen matiaskorhonen added the enhancement New feature or request label Jun 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants