[Feature Request] Symmetric config encryption with password
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 23.1k
- Forks
- 1.1k
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 9
Description
I'm not sure if this is something that the SOPS team is interested in, but I've been meaning to write up a simple library to do symmetric encryption with a password for config files in Golang.
So it looks something like this:
sops --encrypt --password test.yaml > test.enc.yaml
Enter your password:
Verify password:
Something similar to the code in https://github.com/isfonzar/filecrypt, using GCM and the Golang "golang.org/x/crypto/pbkdf2" library:
key := password
nonce := make([]byte, 12)
// Randomizing the nonce
if _, err := io.ReadFull(rand.Reader, nonce); err != nil {
panic(err.Error())
}
dk := pbkdf2.Key(key, nonce, 4096, 32, sha1.New)
block, err := aes.NewCipher(dk)
if err != nil {
panic(err.Error())
}
aesgcm, err := cipher.NewGCM(block)
if err != nil {
panic(err.Error())
}
ciphertext := aesgcm.Seal(nil, nonce, plaintext, nil)
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 by reviewing SOPS's existing encryption command flow and the referenced filecrypt implementation; the issue names no repository files or tests. Clarify the password prompt, key derivation, authenticated encryption, file format, and compatibility requirements before defining what a complete implementation and its tests would cover.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- cli, security
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100