RSA加密与解密

### RSA加密与解密 ````golang package crypto import ( "crypto/rand" "crypto/rsa" "crypto/x509" "encoding/pem" "errors" "io/ioutil" ) func RsaEncrypt(origData []byte) ([]byte, error) { publicKey, err := ioutil.ReadFile("public.pem")...阅读全文

2018-01-17 14:40:49 hfyarvin
阅读:1933 评论:0

RSA生成密钥

**RSA生成密钥** ````golang package crypto import ( "crypto/rand" "crypto/rsa" "crypto/x509" "encoding/pem" "os" ) func GenRsaKey(bits int) error { privateKey, err := rsa.GenerateKey(rand.Reader, bits) if err != nil { return er...阅读全文

2018-01-17 14:46:06 hfyarvin
阅读:2686 评论:0