Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DecryptMap = map[string]func(raw, key []byte) ([]byte, error){ "": func(raw, key []byte) ([]byte, error) { return raw, nil }, ypb.EncMode_Raw.String(): func(raw, key []byte) ([]byte, error) { return raw, nil }, ypb.EncMode_XorBase64.String(): func(raw, key []byte) ([]byte, error) { return XorBase64Decode(raw, key) }, ypb.EncMode_Base64.String(): func(raw, key []byte) ([]byte, error) { return codec.DecodeBase64(string(raw)) }, ypb.EncMode_AesRaw.String(): func(raw, key []byte) ([]byte, error) { return codec.AESECBDecrypt(raw, aesKeyPaddingWithZero(key), nil) }, ypb.EncMode_AesBase64.String(): func(raw, key []byte) ([]byte, error) { bytes, err := codec.DecodeBase64(string(raw)) if err != nil { return nil, err } return codec.AESECBDecrypt(aesKeyPaddingWithZero(key), bytes, nil) }, }
View Source
var EncryptMap = map[string]func(raw, key []byte) ([]byte, error){ "": func(raw, key []byte) ([]byte, error) { return raw, nil }, ypb.EncMode_Raw.String(): func(raw, key []byte) ([]byte, error) { return raw, nil }, ypb.EncMode_XorBase64.String(): func(raw, key []byte) ([]byte, error) { return XorBase64Encode(raw, key) }, ypb.EncMode_Base64.String(): func(raw, key []byte) ([]byte, error) { return []byte(codec.EncodeBase64(raw)), nil }, ypb.EncMode_AesRaw.String(): func(raw, key []byte) ([]byte, error) { return codec.AESECBEncrypt(aesKeyPaddingWithZero(key), raw, nil) }, ypb.EncMode_AesBase64.String(): func(raw, key []byte) ([]byte, error) { bytes, err := codec.AESECBEncrypt(aesKeyPaddingWithZero(key), raw, nil) if err != nil { return nil, err } return []byte(codec.EncodeBase64(bytes)), nil }, }
Functions ¶
func XorBase64Decode ¶
func XorBase64Encode ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.