https://github.com/jonath-z/go-vigenere-cipher
Vigenere Cipher algorithm written in go
https://github.com/jonath-z/go-vigenere-cipher
cipher-algorithms cryptography go golang vigenere-cipher-algorithm
Last synced: 9 months ago
JSON representation
Vigenere Cipher algorithm written in go
- Host: GitHub
- URL: https://github.com/jonath-z/go-vigenere-cipher
- Owner: Jonath-z
- Created: 2023-01-29T15:23:35.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2025-03-16T08:39:55.000Z (9 months ago)
- Last Synced: 2025-03-16T09:27:13.392Z (9 months ago)
- Topics: cipher-algorithms, cryptography, go, golang, vigenere-cipher-algorithm
- Language: Go
- Homepage:
- Size: 1.95 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Vigenère Cipher
This is a Vigenère Cipher algorithm written in go
## Description
The Vigenère cipher is a classic cipher originally developed by Italian cryptographer Giovan Battista Bellaso and published in 1553. It is named after a later French cryptographer Blaise de Vigenère, who had developed a stronger autokey cipher (a cipher that incorporates the message of the text into the key).
The cipher survived three centuries of attempts to break it, earning it the nickname "le chiffre indéchiffrable" or "the indecipherable cipher."
From Wikipedia:
The Vigenère cipher is a method of encrypting alphabetic text by using a series of different Caesar ciphers based on the letters of a keyword. It is a simple form of polyalphabetic substitution.
In a Caesar cipher, each letter of the alphabet is shifted along some number of places; for example, in a Caesar cipher of shift 3, A would become D, B would become E, Y would become B and so on. The Vigenère cipher consists of several Caesar ciphers in sequence with different shift values.
Assume the key is repeated for the length of the text, character by character. Note that some implementations repeat the key over characters only if they are part of the alphabet -- this is not the case here.
The shift is derived by applying a Caesar shift to a character with the corresponding index of the key in the alphabet.
Visual representation:
```go
"my secret code i want to secure"; // message
"passwordpasswordpasswordpasswor"; // key
```
## Example
```go
encodedString := encode("Vigenere-cipher algorihtm", encryptionKey)
decodedString := decode(encodedString, encryptionKey)
fmt.Println("Encoded String", encodedString) //$sCu{%|s|p+;EnzwsFkd<_[:A
fmt.Println("Decoded String", decodedString) // Vigenere-cipher algorihtm
```
## Local test
1. Clone the repository
```bash
git clone https://github.com/Jonath-z/go-vigenere-cipher.git
```
2. Navigate into the cloned folder
3. Run
```shell
go run main.go
```
## Author
- [Jonathan z.](https://www.linkedin.com/in/jonathan-z-0a40ab209/)