ecodec

package module
v1.1.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 29, 2023 License: Apache-2.0 Imports: 8 Imported by: 17

README

go-ecodec

Tag License GoDoc Travis CI codecov.io Go Report Card

Go module providing encryption and decryption of byte-level data.

Table of Contents

Install

go-ecodec is a standard Go module which can be installed with:

go get github.com/wealdtech/go-ecodec

Usage

Example
package main

import (
    "fmt"

    ecodec "github.com/wealdtech/go-ecodec"
)

func main() {
    data := []byte("The data to be encrypted")
    key := []byte("my secret passphrase")

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

    decryptedData, err := ecodec.Decrypt(encryptedData, key)
    if err != nil {
        panic(err)
    }

    fmt.Printf("Decrypted data is %q\n", string(decryptedData))
}

Maintainers

Jim McDonald: @mcdee.

Contribute

Contributions welcome. Please check out the issues.

License

Apache-2.0 © 2019 Weald Technology Trading Ltd

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decrypt

func Decrypt(encryptedData []byte, key []byte) ([]byte, error)

Decrypt decrypts some data given a secret.

func Encrypt

func Encrypt(data []byte, key []byte) ([]byte, error)

Encrypt encrypts some data given a secret.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL