https://github.com/matusollah/xorcipher
XOR Cipher library for Go
https://github.com/matusollah/xorcipher
go golang xor xor-cipher xor-encryption
Last synced: about 1 year ago
JSON representation
XOR Cipher library for Go
- Host: GitHub
- URL: https://github.com/matusollah/xorcipher
- Owner: MatusOllah
- License: mit
- Created: 2024-07-12T11:11:38.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-07-12T11:15:02.000Z (almost 2 years ago)
- Last Synced: 2025-02-09T16:22:44.386Z (over 1 year ago)
- Topics: go, golang, xor, xor-cipher, xor-encryption
- Language: Go
- Homepage: https://pkg.go.dev/github.com/MatusOllah/xorcipher
- Size: 3.91 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# xorcipher
[](https://pkg.go.dev/github.com/MatusOllah/xorcipher) [](https://goreportcard.com/report/github.com/MatusOllah/xorcipher)
**xorcipher** is a XOR Cipher library for Go.
## Basic Usage
```go
package main
import (
"fmt"
"encoding/hex"
"github.com/MatusOllah/xorcipher"
)
func main() {
key := []byte("horalky")
plaintext := []byte("Hello, World!")
block, err := xorcipher.NewCipher(key)
if err != nil {
panic(err)
}
ciphertext := make([]byte, len(plaintext))
block.Encrypt(ciphertext, plaintext)
fmt.Println(hex.EncodeToString(ciphertext)) // > 200a1e0d0347593f00000d084a
}
```