Documentation ¶
Overview ¶
Package cryptos 加密.
加密、解密,AES、DES,多用于配置文件密码加密.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrUnpaddingLength = errors.New("invalid unpadding length") ErrNoEncrypt = errors.New("no encrypt") )
Functions ¶
func Encrypt ¶
Encrypt 加密.
Example ¶
package main import ( "fmt" "github.com/xuender/oils/cryptos" ) func main() { key := "key" str := cryptos.Encrypt("aaa", key, cryptos.AES) fmt.Println(cryptos.Decrypt(str, key)) str = cryptos.Encrypt("AAA", key, cryptos.DES) fmt.Println(cryptos.Decrypt(str, key)) }
Output: aaa <nil> AAA <nil>
Types ¶
Click to show internal directories.
Click to hide internal directories.