Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrCannotReadPassword = errors.New("cannot read the password. use GIPHER_PASSWORD to set the password if you did not use a terminal.") ErrPasswordIsEmpty = errors.New("password is empty") )
Functions ¶
func DecodeCiphertext ¶
func DecodeCiphertext(text Ciphertext) ([]byte, error)
Types ¶
type Ciphertext ¶
type Ciphertext []byte
Ciphertext is base64-encoded string
func EncodeCiphertext ¶
func EncodeCiphertext(bs []byte) Ciphertext
type Cryptor ¶
type Cryptor interface { // Encrypt encrypts a text and encodes it by base64. Encrypt(plaintext string) (Ciphertext, error) // Decrypt decodes a text by base64 and decrypts it. Decrypt(ciphertext Ciphertext) (string, error) }
Cryptor encrypts/decrypts a text.
func NewPasswordCryptor ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.