theTardigrade / golang-caesarCipher

This package provides simple functions to encrypt and decrypt text using a Caesar cipher.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

golang-caesarCipher

This package provides simple functions to encrypt and decrypt text using a Caesar cipher.

Blog Post

For more information, read this blog post.

Example

package main

import (
	caesarCipher "github.com/theTardigrade/golang-caesarCipher"

	"fmt"
)

func main() {
	const encryptShift = 15
	const input = "THIS IS A TEST"

	encrypted := caesarCipher.Encrypt(input, encryptShift)
	decrypted := caesarCipher.Decrypt(encrypted, encryptShift)

	fmt.Printf(
		"INPUT: %s\nENCRYPTED: %s\nDECRYPTED: %s\nINPUT EQUALS DECRYPTED: %t\n",
		input, encrypted, decrypted, input == decrypted,
	)
}

About

This package provides simple functions to encrypt and decrypt text using a Caesar cipher.

License:GNU General Public License v3.0


Languages

Language:Go 100.0%