Implementation of Different Algos
Ceasar's Cipher
func main() {
fmt.Println(cryptory.CeasarEnc("HELLO"))
// KHOOR
fmt.Println(cryptory.CeasarDec("KHOOR"))
// HELLO
}
MonoAlphabetic Cipher
func main() {
fmt.Println(cryptory.MonoAlphaEnc("HELLO"))
// QOBBU
fmt.Println(cryptory.MonoAlphaDec("QOBBU"))
// HELLO
}
Hill Cipher
func main() {
orig := "HATS"
fmt.Printf("Original Message: %v \n", orig)
// HATS
key, encrypted, err := cryptory.HillEnc(orig)
if err != nil {
fmt.Errorf("Error:", err)
}
fmt.Printf("Encrypted Message: %v \n", encrypted)
// VOHY
msg, err := cryptory.HillDec(encrypted, key)
if err != nil {
fmt.Errorf("Error:", err)
}
fmt.Printf("Decrypted Message: %v \n", msg)
// HATS
}
Hill Cipher - Remove hard coded encryption key Hill Cipher - Ugly byte to int to byte conversions Playfair Cipher