hairyhenderson / gomplate

A flexible commandline tool for template rendering. Supports lots of local and remote datasources.
https://gomplate.ca
MIT License
2.7k stars 184 forks source link

Finalize the experimental crypto.* functions #1416

Open hairyhenderson opened 2 years ago

hairyhenderson commented 2 years ago

I've marked most of the crypto.* functions (https://docs.gomplate.ca/functions/crypto) that have to do with encrypting/decrypting or key generation as experimental, because I feel like it may be possible to have a cleaner more unified syntax for these.

Naming-wise the functions are inconsistent (e.g. crypto.RSAEncrypt vs crypto.EncryptAES), and in general it feels like it might feel "cleaner" to just call crypto.Encrypt with appropriate arguments.

Currently only RSA and AES encryption are supported for [en|de]cryption, but it may make sense to support more algorithms like XChaCha20-Poly1305...

Perhaps signatures like this make sense:

crypto.Encrypt [algo] key [keyBits] input
crypto.Decrypt [algo] key [keyBits] input

Inferring algo is simple between RSA/AES, but a bit more complicated once other algorithms come into play 🤔

github-actions[bot] commented 1 year ago

This issue is stale because it has been open for 60 days with no activity. Remove stale label or comment or this will be automatically closed in a few days.

github-actions[bot] commented 1 year ago

This issue is stale because it has been open for 60 days with no activity. Remove stale label or comment or this will be automatically closed in a few days.

hairyhenderson commented 6 months ago

I've moved this out to target v4.1.0 (the first minor after 4.0), as this isn't a breaking change (since these are experimental) and I still haven't had time to look closer at this.