pbe

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 29, 2019 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const PbePwd = "pbepwd"

PbePwd defines the keyword for client flag.

Variables

This section is empty.

Functions

func DealPflag

func DealPflag()

DealPflag deals the request by the pflags.

func DeclarePflags

func DeclarePflags()

DeclarePflags declares the pbe required pflags.

func Decrypt

func Decrypt(cipherText, password string, iterations int) (string, error)

Decrypt PrintDecrypt the cipherText(result of Encrypt) based on password and iterations.

func DecryptSalt

func DecryptSalt(cipherText, password, fixedSalt string, iterations int) (string, error)

DecryptSalt PrintDecrypt the cipherText(result of EncryptSalt) based on password and iterations.

func Ebp

func Ebp(p string) (string, error)

Ebp decrypts p by PBEWithMD5AndDES with 19 iterations.

func Encrypt

func Encrypt(plainText, password string, iterations int) (string, error)

Encrypt PrintEncrypt the plainText based on password and iterations with random salt. The result contains the first 8 bytes salt before BASE64.

func EncryptSalt

func EncryptSalt(plainText, password, fixedSalt string, iterations int) (string, error)

EncryptSalt PrintEncrypt the plainText based on password and iterations with fixed salt.

func GetPbePwd

func GetPbePwd() string

GetPbePwd read pbe password from viper, or from stdin.

func Pbe

func Pbe(p string) (string, error)

Pbe encrypts p by PBEWithMD5AndDES with 19 iterations. it will prompt password if viper get none.

func PrintDecrypt

func PrintDecrypt(passStr string, cipherText ...string)

PrintDecrypt prints the PBE decryption.

func PrintEncrypt

func PrintEncrypt(passStr string, plains ...string)

PrintEncrypt prints the PBE encryption.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL