aes

package module
v0.0.0-...-a88f710 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateKey

func GenerateKey() string

GenerateKey Base64 encoded random bytes with length 32

Types

type AasaamAES

type AasaamAES struct {
	// contains filtered or unexported fields
}

AasaamAES is encryption decryption

func NewAasaamAES

func NewAasaamAES(key string) *AasaamAES

NewAasaamAES Create instance

func (*AasaamAES) Decrypt

func (a *AasaamAES) Decrypt(message string) string

Decrypt Decrypt message return Original message or empty string on failure

func (*AasaamAES) DecryptTTL

func (a *AasaamAES) DecryptTTL(encryptedTTLMessage string) string

DecryptTTL Decrypted message that contain time to liv return Original message or empty string on failure

func (*AasaamAES) Encrypt

func (a *AasaamAES) Encrypt(message string) string

Encrypt Encrypt message

func (*AasaamAES) EncryptTTL

func (a *AasaamAES) EncryptTTL(message string, ttl int64) string

EncryptTTL Encrypt message with time to live

type TTLMessage

type TTLMessage struct {
	Message string `json:"message"`
	TTL     int64  `json:"ttl"`
}

TTLMessage struct for time to live message

Jump to

Keyboard shortcuts

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