27 lines
493 B
Go
27 lines
493 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
zcrypt "github.com/zeevdiukman/z/zcrypt"
|
|
)
|
|
|
|
func main() {
|
|
key := []byte("your_secret_key")
|
|
plaintext := "hello, world!"
|
|
|
|
encryptedText, err := zcrypt.Encrypt(plaintext, key)
|
|
if err != nil {
|
|
fmt.Println("Error encrypting:", err)
|
|
return
|
|
}
|
|
|
|
decryptedText, err := zcrypt.Decrypt(encryptedText, key)
|
|
if err != nil {
|
|
fmt.Println("Error decrypting:", err)
|
|
return
|
|
}
|
|
|
|
fmt.Println("Encrypted:", encryptedText)
|
|
fmt.Println("Decrypted:", decryptedText)
|
|
}
|