Documentation
¶
Overview ¶
Example ¶
strEncrypted, err := DesEncrypt([]byte("hello world"), []byte("12345678")) if err != nil { log.Fatal(err) } strDecrypted, err := DesDecrypt(strEncrypted, []byte("12345678")) if err != nil { log.Fatal(err) } fmt.Println("Encrypted:", strEncrypted) fmt.Println("Decrypted:", string(strDecrypted))
Output: Encrypted: 28dba02eb5f6dd476042daebfa59687a Decrypted: hello world
Index ¶
- func DecodePriKey(b []byte) *ecdsa.PrivateKey
- func DecodePubKey(b []byte) *ecdsa.PublicKey
- func DesDecrypt(decrypted string, key []byte) ([]byte, error)
- func DesEncrypt(text, key []byte) (string, error)
- func EncodePriKey(priKey *ecdsa.PrivateKey) []byte
- func EncodePubKey(pubKey *ecdsa.PublicKey) []byte
- func NewKeys() (*ecdsa.PrivateKey, *ecdsa.PublicKey)
- func TrimKey(key []byte) []byte
- func Verity(data, sign []byte, pubKey *ecdsa.PublicKey) bool
- func ZeroPadding(ciphertext []byte, blockSize int) []byte
- func ZeroUnPadding(origData []byte) []byte
- type Wallet
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodePriKey ¶
func DecodePriKey(b []byte) *ecdsa.PrivateKey
func DecodePubKey ¶
func DesEncrypt ¶
func EncodePriKey ¶
func EncodePriKey(priKey *ecdsa.PrivateKey) []byte
func EncodePubKey ¶
func ZeroPadding ¶
func ZeroUnPadding ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.