gobase/test/crypto_test.go

16 lines
255 B
Go
Raw Normal View History

package test
import (
"gobase/utils"
"log"
"testing"
)
func TestCrypto(t *testing.T) {
pub, pri := utils.GenRsaKey(1024)
enc, e := utils.RSAEncrypt([]byte{1, 2, 3}, pub)
log.Print(enc, e)
dec, e := utils.RSADecrypt(enc, pri)
log.Print(dec, e)
}