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
- Host: GitHub
- URL: https://github.com/h5law/vinegar
- Owner: h5law
- License: bsd-3-clause
- Created: 2024-05-10T02:21:46.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-08-28T06:58:27.000Z (about 1 year ago)
- Last Synced: 2024-08-28T07:29:43.897Z (about 1 year ago)
- Topics: cryptography, encryption-decryption, vigenere, vigenere-cipher, vigenere-cipher-algorithm
- Language: Go
- Homepage: https://pkg.go.dev/github.com/h5law/vinegar
- Size: 20.5 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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 mainimport (
"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
}
```