String encoding with modified Caesar cipher for Golang.
Encoding is done using rolling cipher.
Minimal required Go version: v1.18
go get github.com/julyskies/strenco
package main
import "github.com/julyskies/strenco"
func main() {
plaintext := "Lorem ipsum dolor sit amet, consectetur adipiscing elit."
encoded, encodingError := strenco.Encode(plaintext)
if encodingError != nil {
println(encodingError.Error())
} else {
println(encoded) // %%7z;1tsk1JA!NbAFwzj j&{r(3#"+L%m*{<D%Wrh@iyB(qM!eG)>B/ox/%%
}
}
package main
import "github.com/julyskies/strenco"
func main() {
encoded := `%%7z;1tsk1JA!NbAFwzj j&{r(3#"+L%m*{<D%Wrh@iyB(qM!eG)>B/ox/%%`
decoded, decodingError := strenco.Decode(encoded)
if decodingError != nil {
println(decodingError.Error())
} else {
println(decoded) // Lorem ipsum dolor sit amet, consectetur adipiscing elit.
}
}
This module is not secure, since its main goal is to make the original value unreadable. There are no additional keys, passphrases or secrets required, meaning that anyone can decode encoded value. It is not recommended to store sensitive data encoded with this module.
Deploy project locally
git clone https://github.com/julyskies/strenco
cd ./strenco
gvm use go1.18
Run tests
go test -v