crypto

package module
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2021 License: MIT Imports: 7 Imported by: 1

README

Crypto

Github Status GoDoc

Small go library to encrypt and decrypt text.

Usage

package main

import(
    "fmt"

    "github.com/jpedro/crypto"
)

func main() {
    original := "test"
    password := "test"
    encrypted, _ := crypto.Encrypt(original, password)
    decrypted, _ := crypto.Decrypt(encrypted, password)
    fmt.Printf("Encrypted: %s\n", encrypted)
    fmt.Printf("Decrypted: %s\n", decrypted)
}

You can run it with:

$ (cd example && go run main.go)
Encrypted: 5fb983fceb745148b3d714425d0de00fbe5f0ed0bd7101c01198627f5cbfecc9
Decrypted: test

CLI

Check cli/crypto for your terminal needs.

Documentation

Overview

Simple go library and cli to encrypt and decrypt data

This packages uses the Galois/Counter_Mode https://en.wikipedia.org/wiki/Galois/Counter_Mode and the package https://pkg.go.dev/crypto/cipher#NewGCM

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decrypt

func Decrypt(payload string, password string) (string, error)

Decrypts an encrypted payload with password

func Encrypt

func Encrypt(payload string, password string) (string, error)

Encrypts a payload with a password

Types

This section is empty.

Directories

Path Synopsis
cli
crypto
Swine leberkas venison Burgdoggen sirloin biltong chuck drumstick shank capicola porchetta.
Swine leberkas venison Burgdoggen sirloin biltong chuck drumstick shank capicola porchetta.

Jump to

Keyboard shortcuts

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