Skip to content

String encoding with modified Caesar cipher for Golang

License

Notifications You must be signed in to change notification settings

julyskies/strenco

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

strenco

String encoding with modified Caesar cipher for Golang.

Encoding is done using rolling cipher.

Minimal required Go version: v1.18

Install

go get github.com/julyskies/strenco

Usage

Encode plaintext string
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/%%
  }
}
Decode encoded string
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.
  }
}

Other implementations

Security

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.

Testing

Deploy project locally

git clone https://github.com/julyskies/strenco
cd ./strenco
gvm use go1.18

Run tests

go test -v

License

MIT