Documentation
¶
Index ¶
- Constants
- func Alphanumeric(u uint8) bool
- func DealPflag() bool
- func DeclarePflags()
- func Decrypt(cipherText, password string, iterations int) (string, error)
- func DecryptSalt(cipherText, password, fixedSalt string, iterations int) (string, error)
- func Ebp(p string) (string, error)
- func Encrypt(plainText, password string, iterations int) (string, error)
- func EncryptSalt(plainText, password, fixedSalt string, iterations int) (string, error)
- func GetPbePwd() string
- func Pbe(p string) (string, error)
- func PrintDecrypt(passStr string, cipherText ...string)
- func PrintEncrypt(passStr string, plains ...string)
- type Config
Constants ¶
const PbePwd = "pbepwd"
PbePwd defines the keyword for client flag.
Variables ¶
This section is empty.
Functions ¶
func Decrypt ¶
Decrypt PrintDecrypt the cipherText(result of Encrypt) based on password and iterations.
func DecryptSalt ¶
DecryptSalt PrintDecrypt the cipherText(result of EncryptSalt) based on password and iterations.
func Encrypt ¶
Encrypt PrintEncrypt the plainText based on password and iterations with random salt. The result contains the first 8 bytes salt before BASE64.
func EncryptSalt ¶
EncryptSalt PrintEncrypt the plainText based on password and iterations with fixed salt.
func Pbe ¶
Pbe encrypts p by PBEWithMD5AndDES with 19 iterations. it will prompt password if viper get none.
func PrintDecrypt ¶
PrintDecrypt prints the PBE decryption.
func PrintEncrypt ¶
PrintEncrypt prints the PBE encryption.
Types ¶
type Config ¶
type Config struct {
Passphrase string
}
Config configs the passphrase.
func (Config) Pbe ¶
Pbe encrypts p by PBEWithMD5AndDES with 19 iterations. it will prompt password if viper get none.
func (Config) PbeText ¶
PbeText will PBE encrypt the passwords in the text passwords should be as any of following format and its converted pattern 1. {PWD:clear} -> {PBE:cyphered} 2. [PWD:clear] -> {PBE:cyphered} 3. (PWD:clear) -> {PBE:cyphered} 4. "PWD:clear" -> "{PBE:cyphered}" 5. PWD:clear -> {PBE:cyphered}