Documentation ¶
Overview ¶
Package utils @Description: Operation with rsa encryption
Index ¶
- Constants
- func CiphertextFormat(ciphertext string) string
- func CiphertextReplace(ciphertext string) string
- func ComparePassword(hashedPassword, currPassword string, saltStr string) bool
- func DecodeURIComponent(str string) string
- func EncodeURIComponent(str string) string
- func NewAesCipher(key string, nBits int) (*aesCipher, error)
- func RandInt(min, max int) int
- func Rc4ClientDecrypt(ciphertext string) (string, error)
- func Rc4ClientEncrypt(plaintext string) (string, error)
- func Rc4Decrypt(ciphertext string, key string) (string, error)
- func Rc4Encrypt(plaintext string, key string) (string, error)
- func RsaDecrypt(cryptText, priKey string) (plainText []byte, err error)
- func RsaEncrypt(plainText, pubKey string) (cryptText string, err error)
- type AesKeySizeError
- type Encrypt
Constants ¶
View Source
const ( DefaultAesKey = `159054a86e3bfb85b5f1991cdb07645e` BlockSize = 16 // block size fixed at 16 bytes / 128 bits (Nb=4) for AES DefaultAesNBits = 256 )
Variables ¶
This section is empty.
Functions ¶
func CiphertextFormat ¶
CiphertextFormat Client encrypt content format
func CiphertextReplace ¶
func ComparePassword ¶
ComparePassword Check if two passwords compare
func DecodeURIComponent ¶
func EncodeURIComponent ¶
func NewAesCipher ¶
func Rc4ClientDecrypt ¶
Rc4ClientDecrypt Client RC4 Config file Decrypt
func Rc4ClientEncrypt ¶
Rc4ClientEncrypt Client RC4 Config file Encrypt
func RsaDecrypt ¶
func RsaEncrypt ¶
Types ¶
type AesKeySizeError ¶
type AesKeySizeError int
func (AesKeySizeError) Error ¶
func (k AesKeySizeError) Error() string
Click to show internal directories.
Click to hide internal directories.