Documentation ¶
Index ¶
- Constants
- func ComparePassword(hashedPassword, currPassword string, saltStr string) bool
- type AesCipher
- func (a *AesCipher) BlockSize() int
- func (a *AesCipher) DecodeURIComponent(str string) string
- func (a *AesCipher) Decrypt(cipherText string) ([]byte, error)
- func (a *AesCipher) EncodeURIComponent(str string) string
- func (a *AesCipher) Encrypt(plaintext string) (string, error)
- func (a *AesCipher) String() string
- type AesCipherConfig
- type AesKeySizeError
- type Crypto
- type Encrypt
- type Rc4Cipher
- func (r *Rc4Cipher) CiphertextFormat(ciphertext string) string
- func (r *Rc4Cipher) CiphertextReplace(ciphertext string) string
- func (r *Rc4Cipher) DecodeURIComponent(str string) string
- func (r *Rc4Cipher) Decrypt(ciphertext string) ([]byte, error)
- func (r *Rc4Cipher) EncodeURIComponent(str string) string
- func (r *Rc4Cipher) Encrypt(plaintext string) (string, error)
- func (r *Rc4Cipher) RandInt(min, max int) int
- func (r *Rc4Cipher) Rc4ClientDecrypt(ciphertext string) (string, error)
- func (r *Rc4Cipher) Rc4ClientEncrypt(plaintext string) (string, error)
- func (r *Rc4Cipher) String() string
- type Rc4CipherConfig
- type RsaCipher
- func (a *RsaCipher) DecodeURIComponent(str string) string
- func (a *RsaCipher) Decrypt(cryptText string) (plainText []byte, err error)
- func (a *RsaCipher) EncodeURIComponent(str string) string
- func (a *RsaCipher) Encrypt(plainText string) (cryptText string, err error)
- func (a *RsaCipher) String() string
- type RsaCipherConfig
- type RsaCiphersConfig
Constants ¶
View Source
const ( DefaultAesKey = `159054a86e3bfb85b5f1991cdb07645e` BlockSize = 16 // block size fixed at 16 bytes / 128 bits (Nb=4) for AES DefaultAesNBits = 256 CryptoAesName = "aes" )
View Source
const ( DefaultRC4Key = "159054a86e3bfb85b5f1991cdb07645e" CryptoRC4Name string = "rc4" )
View Source
const ( CryptoRSAName = "rsa" RsaPublicKeyTpl = `-----BEGIN PUBLIC KEY----- %s -----END PUBLIC KEY-----` RsaPrivateKeyTpl = `-----BEGIN RSA PRIVATE KEY----- %s -----END RSA PRIVATE KEY-----` )
Variables ¶
This section is empty.
Functions ¶
func ComparePassword ¶
ComparePassword Check if two passwords compare
Types ¶
type AesCipher ¶ added in v0.3.9
type AesCipher struct {
// contains filtered or unexported fields
}
func (*AesCipher) DecodeURIComponent ¶ added in v0.4.2
func (*AesCipher) EncodeURIComponent ¶ added in v0.4.2
type AesCipherConfig ¶ added in v0.4.3
type AesKeySizeError ¶
type AesKeySizeError int
func (AesKeySizeError) Error ¶
func (k AesKeySizeError) Error() string
type Encrypt ¶
func EncryptPassword ¶
type Rc4Cipher ¶ added in v0.3.9
type Rc4Cipher struct {
Key string `json:"key" yaml:"key"`
}
func NewRc4Cipher ¶ added in v0.3.9
func (*Rc4Cipher) CiphertextFormat ¶ added in v0.3.9
CiphertextFormat Client encrypt content format
func (*Rc4Cipher) CiphertextReplace ¶ added in v0.3.9
func (*Rc4Cipher) DecodeURIComponent ¶ added in v0.4.2
func (*Rc4Cipher) EncodeURIComponent ¶ added in v0.4.2
func (*Rc4Cipher) Rc4ClientDecrypt ¶ added in v0.3.9
Rc4ClientDecrypt Client RC4 Config file Decrypt
func (*Rc4Cipher) Rc4ClientEncrypt ¶ added in v0.3.9
Rc4ClientEncrypt Client RC4 Config file Encrypt
type Rc4CipherConfig ¶ added in v0.4.3
type Rc4CipherConfig Rc4Cipher
type RsaCipher ¶ added in v0.3.9
type RsaCipher struct { PubKey string PriKey string PublicKey *rsa.PublicKey PrivateKey *rsa.PrivateKey }
func NewRsaCipher ¶ added in v0.3.9
func (*RsaCipher) DecodeURIComponent ¶ added in v0.3.9
func (*RsaCipher) EncodeURIComponent ¶ added in v0.3.9
type RsaCipherConfig ¶ added in v0.4.3
type RsaCiphersConfig ¶ added in v0.4.3
type RsaCiphersConfig struct { Client RsaCipherConfig `yaml:"client" json:"client"` Server RsaCipherConfig `yaml:"server" json:"server"` }
Click to show internal directories.
Click to hide internal directories.