-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathexample.go
More file actions
31 lines (25 loc) · 707 Bytes
/
Copy pathexample.go
File metadata and controls
31 lines (25 loc) · 707 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package main
import (
"fmt"
"github.com/mtamer/cryptory/cryptory"
)
func main() {
fmt.Println(cryptory.CeasarEnc("hello"))
fmt.Println(cryptory.CeasarEnc("W0rLd"))
fmt.Println(cryptory.CeasarEnc("3, 32, 5"))
fmt.Println(cryptory.MonoAlphaEnc("hello"))
fmt.Println(cryptory.MonoAlphaEnc("W0rLd"))
fmt.Println(cryptory.MonoAlphaEnc("3, 32, 5"))
orig := "HELLOO"
fmt.Printf("Original Message: %v \n", orig)
encrypted, key, err := cryptory.HillEnc(orig)
if err != nil {
fmt.Errorf("Error:", err)
}
fmt.Printf("Encrypted Message: %v \n", encrypted)
msg, err := cryptory.HillDec(encrypted, key)
if err != nil {
fmt.Errorf("Error:", err)
}
fmt.Printf("Decrypted Message: %v \n", msg)
}