gosypt_pkg

package module
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2022 License: MIT Imports: 6 Imported by: 2

README

Gosypt

An idiomatic port of "Jasypt" in Go

Language Badge
release notes

Introduction

An simple encryption and decryption module, using the idiomatic Go crypto/aes packages.

Usage

To use the module in your Go modules go get -d github.com/alt-golang/gosypt.pkg

    package main
	encrytped, _ := EncryptString("1234567890123456", "HelloWorld")
	fmt.Println(encrypted)
	decrytped, _ := DecryptString("1234567890123456", encrytped)

To use the module as a command from the command line go install github.com/alt-golang/gosypt (and add the GOPATH/bin dir to your path)

    go install github.com/alt-golang/gosypt   
    export $PATH=$PATH:`go env GOPATH`\bin
    gosypt -v
    > github.com/alt-lang/gosypt v1.0.0
    gosypt -h
    > Usage of gosypt:
    >  -d string
    >        text to be decrypted
    >  -e string
    >        text to be encrypted
    >  -h	output usage
    >  -p string
    >        the secret key
    >  -v	output the version number
    gosypt -p 1234567890123456 -e HelloWorld
    > G4hvsS/rhncB4cO58UEhz9crxQ9vp93k83l8mlBkz+c=
    gosypt -p 1234567890123456 -d G4hvsS/rhncB4cO58UEhz9crxQ9vp93k83l8mlBkz+c=
    > HelloWorld

License

May be freely distributed under the MIT license.

Copyright (c) 2022 Craig Parravicini

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decrypt

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

func DecryptString

func DecryptString(key, textb64 string) (string, error)

func Encrypt

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

func EncryptString

func EncryptString(key, text string) (string, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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