Is there an existing issue for this?
Current Behavior
The encrypt and decrypt functions in the provided code use Go's cipher.Stream.XORKeyStream directly on the input slice (value). This modifies the original data in place. If the caller reuses the original slice, this can lead to subtle bugs or security problems, as the original data will be overwritten by the encrypted or decrypted data. A standard practice is to copy the input data to a new slice before encryption or decryption to avoid this unexpected mutation.
Expected Behavior
No response
Steps To Reproduce
No response
Anything else?
No response