Skip to content

Go library for encryption and decryption based on AES algorithm.

Notifications You must be signed in to change notification settings

amirhnajafiz/encrypto

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Encrypto

GitHub release (with filter)

A Golang library for encryption and decryption based on AES algorithm. With this library you can encrypt and decrypt your texts by using a 16 bits private key.

how to use?

Import the library in go.mod by using go get github.com/amirhnajafiz/encrypto. After that you can use it like the following example:

package main

import (
    "fmt"

    "github.com/amirhnajafiz/encrypto"
)

func main() {
    key := "0123456789abcdef" // must be of 16 bytes for this example to work
    message := "Lorem ipsum dolor sit amet"

    encrypted, _ := encrypto.Encrypt(key, message)
    decrypted, _ := encrypto.Decrypt(key, encrypted)

    fmt.Println(key, message, encrypted, decrypted)
}