26 lines
661 B
Go
26 lines
661 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"git.send.nrw/sendnrw/sendnrwlib/netcrypto"
|
|
"git.send.nrw/sendnrw/sendnrwlib/netproto"
|
|
)
|
|
|
|
func main() {
|
|
key, _ := netcrypto.AES_GenerateKey()
|
|
fmt.Println(netcrypto.AES_KeyToString(key))
|
|
enc, _ := netcrypto.AES_Encrypt("test", key)
|
|
fmt.Println(enc)
|
|
dec, _ := netcrypto.AES_Decrypt(enc, key)
|
|
fmt.Println(dec)
|
|
|
|
a := netproto.GenerateNetworkProtocol(netproto.GenerateMainHeader(1, "A", netproto.GenerateEHT1("127.0.0.1", "", ""), netproto.GenerateEHT2("8.8.8.8", "", "80"), netproto.GenerateEHT3("JSON", "0", "0")), "")
|
|
fmt.Println(a)
|
|
b, _ := netproto.ToJSON(a)
|
|
fmt.Println(b)
|
|
netproto.FromJSON(b, &a)
|
|
fmt.Println(a)
|
|
|
|
}
|