16 lines
255 B
Go
16 lines
255 B
Go
|
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)
|
||
|
}
|