An open API service indexing awesome lists of open source software.

https://github.com/h5law/vinegar

A Golang library for creating and using Vigenere Ciphers
https://github.com/h5law/vinegar

cryptography encryption-decryption vigenere vigenere-cipher vigenere-cipher-algorithm

Last synced: 7 months ago
JSON representation

A Golang library for creating and using Vigenere Ciphers

Awesome Lists containing this project

README

          

# vinegar

vinegar is a library for producing, Vigenere tables and encrypting/decrypting
messages with them.

Plaintext messages have their spaces removed during encryption as the library
uses the standard latin alphabet modified by a keyword (with duplicates removed).
This means the decrypted message will also have no spaces but will match the
plaintext input in all other ways.

```go
package main

import (
"fmt"

"github.com/h5law/vinegar"
)

func main() {
vig := vinegar.NewVigenere("kyrptos")
cipher := vig.Encrypt("this is a secret hidden message", "neddih")
plain := vig.Decrypt(cipher, "neddih")
fmt.Println(cipher) // wzzjtqklunlzwzzqzzfpujuusv
fmt.Println(plain) // thisisasecrethiddenmessage
// Using the wrong key
fmt.Println(vig.Decrypt(cipher, "hidden")) // cdisnyfrecsscdidhsxhesdrma
}
```