Documentation
¶
Index ¶
- func DecodeCookie(cypher core.Cypher, data string) (string, error)
- func EncodeCookie(cypher core.Cypher, data string) (string, error)
- func GenerateRandomPass() ([]byte, error)
- func GenerateRandomPassAsString() (string, error)
- func New() core.Cypher
- func NewWithPassword(password []byte) core.Cypher
- func NewWithPasswordAsString(password string) core.Cypher
- type AES256
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeCookie ¶
DecodeCookie is a function that decodes a cookie data using a Cypher implementation. Returns plain cookie data. If cannot decode or decrypt data will return an error.
func EncodeCookie ¶
EncodeCookie is a function that encodes a cookie data using a Cypher implementation. Returns a base64 encoded cookie. If cannot encode data will return an error.
func GenerateRandomPass ¶
Generates a random password to use with AES256.
func GenerateRandomPassAsString ¶
Generates a random password as string to use with AES256.
func New ¶
Creates a Cypher with a random password. Everytime you create a cypher will generate a new random password. Keep in mind that anything encrypted with other instances will not be decrypted because they dont share passwords. Will panic if it cannot generate a random password.
func NewWithPassword ¶
Creates a Cypher with a provided password as bytes
func NewWithPasswordAsString ¶
Creates a Cypher with a provided password as string