Documentation ¶
Overview ¶
Package gocrypt provide a library for do encryption in struct with go field.
Package gocrypt provide in struct tag encryption or inline encryption and decryption ¶
The package supported:
DES3 — Triple Data Encryption Standard ¶
AES — Advanced Encryption Standard ¶
RC4 — stream chipper ¶
The AES cipher is the current U.S. government standard for all software, and is recognized worldwide.
The DES ciphers are primarily supported for PBE standard that provides the option of generating an encryption key based on a passphrase.
The RC4 is supplied for situations that call for fast encryption, but not strong encryption. RC4 is ideal for situations that require a minimum of encryption.
Index ¶
Constants ¶
const (
// GOCRYPT is variable tag field for gocrypt
GOCRYPT = "gocrypt"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AESOpt ¶
type AESOpt struct {
// contains filtered or unexported fields
}
AESOpt contains all aes session option
func NewAESOpt ¶
NewAESOpt is function to create new configuration of aes algorithm option the secret must be hexa a-f & 0-9
type DESOpt ¶
type DESOpt struct {
// contains filtered or unexported fields
}
DESOpt contains all DES session option
func NewDESOpt ¶
NewDESOpt is function to create new configuration of des algorithm option the secret must be 24 character
type GocryptInterface ¶
GocryptInterface is facing the format gocrypt option library
type GocryptOption ¶
type GocryptOption interface { Encrypt(plainText []byte) (string, error) Decrypt(chipherText []byte) (string, error) }
GocryptOption is facing the format encryption and decryption format
type Option ¶
type Option struct { AESOpt GocryptOption DESOpt GocryptOption RC4Opt GocryptOption Custom map[string]GocryptOption Prefix string Postfix string }
Option contains an option from initial algorithm encryptioin & decryption.
func New ¶
New create and initialize new option for struct field encryption.
It needs option from aes, rc4, or des for initialitaion
type RC4Opt ¶
type RC4Opt struct {
// contains filtered or unexported fields
}
RC4Opt is tructure of aes option
func NewRC4Opt ¶
NewRC4Opt is function to create new configuration of aes algorithm option the secret must be hexa a-f & 0-9