Encrypt encrypts a value with the embedded Cipher & Base64 encodes it
(value []byte)
| 27 | |
| 28 | // Encrypt encrypts a value with the embedded Cipher & Base64 encodes it |
| 29 | func (c *base64Cipher) Encrypt(value []byte) ([]byte, error) { |
| 30 | encrypted, err := c.Cipher.Encrypt(value) |
| 31 | if err != nil { |
| 32 | return nil, err |
| 33 | } |
| 34 | |
| 35 | return []byte(base64.StdEncoding.EncodeToString(encrypted)), nil |
| 36 | } |
| 37 | |
| 38 | // Decrypt Base64 decodes a value & decrypts it with the embedded Cipher |
| 39 | func (c *base64Cipher) Decrypt(ciphertext []byte) ([]byte, error) { |