MCPcopy Create free account
hub / github.com/KOSASIH/skybridge / EncryptBase64

Method EncryptBase64

src/crypto/encryption/encryption.go:58–65  ·  view source on GitHub ↗
(plaintext string)

Source from the content-addressed store, hash-verified

56}
57
58func (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
67func (e *Encryption) DecryptBase64(ciphertext string) (string, error) {
68 ciphertextBytes, err := base64.StdEncoding.DecodeString(ciphertext)

Calls 1

EncryptMethod · 0.95

Tested by 2

TestEncryption_RandomFunction · 0.76