crypto

package
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 22, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

README

import (
	"fmt"

	"github.com/eaglexpf/crypto"
)

data, err := crypto.NewRsa()
if err != nil {
	fmt.Println("error")
} else {
	fmt.Println(string(data.PrivateKey))
	fmt.Println(string(data.PublicKey))
}
encodeData, _ := crypto.EncodeRSA(data.PublicKey, []byte("Hello World!!!this is a success message!"))
decodeData, _ := crypto.DecodeRSA(data.PrivateKey, encodeData)
fmt.Println(encodeData)
fmt.Println(string(decodeData))

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeRSA

func DecodeRSA(privateKey, ciphertext []byte) ([]byte, error)

func EncodeRSA

func EncodeRSA(publicKey, origData []byte) ([]byte, error)

func Md5

func Md5(value string) string

Encode md5 encryption

Types

type RsaData

type RsaData struct {
	PrivateKey []byte
	PublicKey  []byte
}

func NewRsa

func NewRsa() (RsaData, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL