Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cipher ¶
type Cipher struct {
// contains filtered or unexported fields
}
Cipher defines resenje.org/cipher.StringCipher interface.
func New ¶
New returns a new Cipher instance with a given key. The key argument should be the AES key, either 16, 24, or 32 bytes to select AES-128, AES-192, or AES-256.
func (Cipher) DecryptString ¶
DecryptString decrypts input string produced by EncryptString. It performs AES encryption and validates Adler32 checksum.
type Option ¶ added in v0.1.2
type Option func(*Cipher)
Option is used to specify optional parameters to the New constructor.
func WithInputEncoder ¶ added in v0.1.2
func WithInputEncoder(e cipher.StringEncoder) Option
WithInputEncoder sets the EncryptString input data encoding. By default, no input data decoding of input data is performed. If the input data is always with the same encoding, encrypted strings can be reduced in size, buy specifying this option.
func WithOutputEncoder ¶ added in v0.1.2
func WithOutputEncoder(e cipher.StringEncoder) Option
WithOutputEncoder sets the EncryptString returned data encoding. By default, resenje.org/cipher.DefaultEncoder is used.