aes

package module
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2022 License: MIT Imports: 9 Imported by: 1

README

AES

Go Version

Simplified cross language Advanced Encryption Standard (AES)

Go Coveralls Go Report Card License

Features:

  • All packages must be zero dependency only require core encryption of each language.
  • Working only with strings (No error/exception), empty string will be falsy
  • Encrypted with AES-GCM-256 with tag

Currently supported following languages:

aasaam software development group
aasaam software development group

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateHashKey

func GenerateHashKey(key string, props []string) string

GenerateHashKey Generate encryption key for special props

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