Skip to content

feat: add AES-256 secret key generation with secure memory#149

Merged
jithinkunjachan merged 4 commits into
mainfrom
feat/add-secret-gen
Jun 3, 2026
Merged

feat: add AES-256 secret key generation with secure memory#149
jithinkunjachan merged 4 commits into
mainfrom
feat/add-secret-gen

Conversation

@jithinkunjachan

@jithinkunjachan jithinkunjachan commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Add simple secret generator

Signed-off-by: jK <33685667+jithinkunjachan@users.noreply.github.com>
Signed-off-by: jK <33685667+jithinkunjachan@users.noreply.github.com>
@jithinkunjachan jithinkunjachan self-assigned this Jun 1, 2026
@jithinkunjachan jithinkunjachan marked this pull request as ready for review June 1, 2026 09:35
Signed-off-by: jK <33685667+jithinkunjachan@users.noreply.github.com>

@apatsap apatsap left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one small NP. Its your call if you want to change it

Comment thread internal/cryptor/secretgen.go Outdated
Comment on lines +48 to +51
_, err = rand.Read(b)
if err != nil {
return fmt.Errorf("failed to generate random bytes: %w", err)
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically rand.Read never returns an error. The signature is chosen like this only to satisfy io.Reader

https://pkg.go.dev/crypto/rand#Read

So we could make it shorter and add a comment about the no-error behaviour

@fabenan-f fabenan-f left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Signed-off-by: jK <33685667+jithinkunjachan@users.noreply.github.com>
@jithinkunjachan jithinkunjachan merged commit 030bf94 into main Jun 3, 2026
5 checks passed
@jithinkunjachan jithinkunjachan deleted the feat/add-secret-gen branch June 3, 2026 11:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants