gocypherator

command module
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2018 License: Apache-2.0 Imports: 2 Imported by: 0

README

gocypherator

Gocypherator is a cypher module in order to encrypt / decrypt strings based on the following algorithms:

  • AES-128,
  • AES-192,
  • or AES-256.

Usage:

First of all, you need to import the module:

import "github.com/alknopfler/gocypherator/cypher"

Then you have to initialize the cypher module with the type of algorithm:

func InitKeyCypher(cypherType int) {

cypherType could be:

  • 16 ==> AES 128
  • 24 ==> AES 192
  • 32 ==> AES 256

The following example shows all the features available:

func main (){
	var cypherType = 16
	var baseText = "helloWorld"

	fmt.Println("Base Text: ",baseText)

	k:= cypher.InitKeyCypher(cypherType)

	crypt := k.EncryptString(baseText)
	fmt.Println("Text Encrypted: ", crypt)

	decrypt := k.DecryptString(crypt)
	fmt.Println("Text Decrypted: ",decrypt)

}

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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