package
0.0.0-20240819164739-f47aed85de5a
Repository: https://github.com/unix-world/smartgo.git
Documentation: pkg.go.dev

# README

secret

A simple utility for encrypting and decrypting data in Go. (AES-256-CFB)

Install

go get github.com/tidwall/secret

Example

func main

import "github.com/tidwall/secret"

func main(){
    key := "hello world"
    data := []byte("hello jello")

    encdata, err := secret.Encrypt(key, data)
    if err != nil{
        panic(err)
    }

    decdata, err := secret.Decrypt("hello world", encdata)
    if err != nil{
        panic(err)
    }

    println(string(decdata))
}
// output:
// hello jello

# Functions

Decrypt data.
Encrypt data.

# Variables

ErrDecryptFailed is returned when Decrypt is unable to decrypt due to invalid inputs.