(plaintext string)
| 56 | } |
| 57 | |
| 58 | func (e *Encryption) EncryptBase64(plaintext string) (string, error) { |
| 59 | plaintextBytes := []byte(plaintext) |
| 60 | ciphertext, err := e.Encrypt(plaintextBytes) |
| 61 | if err != nil { |
| 62 | return "", err |
| 63 | } |
| 64 | return base64.StdEncoding.EncodeToString(ciphertext), nil |
| 65 | } |
| 66 | |
| 67 | func (e *Encryption) DecryptBase64(ciphertext string) (string, error) { |
| 68 | ciphertextBytes, err := base64.StdEncoding.DecodeString(ciphertext) |