1
This commit is contained in:
parent
3c315f7df2
commit
5f9768183e
2 changed files with 0 additions and 53 deletions
|
|
@ -1,38 +0,0 @@
|
|||
//go:build ignore
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"encoding/hex"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/zeevdiukman/z/crypt"
|
||||
"github.com/zeevdiukman/z/helper"
|
||||
)
|
||||
|
||||
func main() {
|
||||
var _ = crypt.Encrypt
|
||||
t := time.Now()
|
||||
key := "1b1ef1cf714a412d57ec7be1647e6e1e7f8141a1cd009dd13b52041e5c62dbd6"
|
||||
keyBytes, _ := hex.DecodeString(key)
|
||||
plaintext := "hello, world!"
|
||||
encryptedText, err := crypt.Encrypt(plaintext, keyBytes)
|
||||
|
||||
if err != nil {
|
||||
fmt.Println("Error encrypting:", err)
|
||||
return
|
||||
}
|
||||
decryptedText, err := crypt.Decrypt(encryptedText, keyBytes)
|
||||
if err != nil {
|
||||
fmt.Println("Error decrypting:", err)
|
||||
return
|
||||
}
|
||||
tt := time.Since(t)
|
||||
|
||||
fmt.Println("Key:", key)
|
||||
fmt.Println("Encrypted:", encryptedText)
|
||||
fmt.Println("Decrypted:", decryptedText)
|
||||
fmt.Println("Generated in", tt)
|
||||
helper.PrintOldStyleMetrics()
|
||||
}
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
//go:build ignore
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"github.com/zeevdiukman/z/dns"
|
||||
"github.com/zeevdiukman/z/helper"
|
||||
)
|
||||
|
||||
func main() {
|
||||
dnsApp := dns.New()
|
||||
dnsApp.Mux.HandleFunc(".", dnsApp.HandleTypeA)
|
||||
go dnsApp.Run()
|
||||
helper.StartHTTP()
|
||||
}
|
||||
Loading…
Reference in a new issue