Can decrypt without specifying key in command line but cannot re-encrypt
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 23.1k
- Forks
- 1.1k
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 9
Description
I am using age with sops.
age v1.1.1 & sops 3.7.3 on RHEL 7.9
I have my keys stored here: ~/.config/sops/age/keys.txt
I can execute sops <encrypted_file> and it will open up the decrypted version of the file in vim. Great.
I can execute sops -d -i <encrypted_file> and it will decrypt the file.
But when I run sops -e -i <unencrypted_file> i get the error “config file not found and no keys provided through command line options”
so then if I do specify the key in the command line using -a agedjfjsk... it will encrypt them again and the decryption again works fine. I'm confused because if the decryption works without specifying a key and its able to find the correct key saved via configuration then why won't the encryption work?
I at one time may have naively ran sops --config thinking it would provide to me config information but it was to set a config location and I didn't pass a file in. Perhaps that did something to alter the encryption configuration. If so, how do i reset it back? Thanks.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the reported sops commands and the key file at ~/.config/sops/age/keys.txt, reproducing decryption and re-encryption on the stated versions. Trace how configuration and key discovery differ between those entry points, then document or fix the behavior so the expected re-encryption outcome is clear.
Written by the indexing model from the issue text.
Assessment
- Domain
- cli, cryptography, security
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100