radi

package module
v1.0.67-beta Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2021 License: MIT Imports: 4 Imported by: 1

README

radi

All what you need to easily work with aes encryption and decryption in golang.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decrypter

func Decrypter(encryptedPhrase, secreteKey string, iv []byte) (plainPhrase string, valid bool)

Decrypt extracts the text from the base64 encoded encrypted string using the secrete key and initialization vectory used to encrypt the text

plainPhrase - is a plain text extracted from an encrypted text

valid - true if plainPhrase is a valid base64 string. It's false if plainPhrase is not a valid base64 string

func Encrypt

func Encrypt(plainPhrase, secreteKey string, iv []byte) (encryptedPhrase string)

Encrypt encrypts plainPhrase using the given secrete key and initialization vector(iv). Then returns an encrypted base64 URL-encoded string.

func RandBytes

func RandBytes(len int) (randomBytes []byte)

RandBytes generates a random []byte of length len

(Very handy for creating initiliazation vectors but you are not limited to!)

func RandString

func RandString(len int) (randomString string)

RandString generates a random base64 URL-encoded string of length len

Types

This section is empty.

Jump to

Keyboard shortcuts

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