getsops / getsops/sops

[Feature Request] Symmetric config encryption with password

Open
#632 4 comments 5 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.