https://github.com/connesc/cipherio
Golang package allowing to use block ciphers with io.Reader and io.Writer
https://github.com/connesc/cipherio
aes block blockmode cbc cipher crypto go golang io reader stream writer
Last synced: 4 months ago
JSON representation
Golang package allowing to use block ciphers with io.Reader and io.Writer
- Host: GitHub
- URL: https://github.com/connesc/cipherio
- Owner: connesc
- License: mit
- Created: 2020-05-22T17:21:22.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-05-29T12:34:22.000Z (about 6 years ago)
- Last Synced: 2024-06-18T20:20:13.294Z (about 2 years ago)
- Topics: aes, block, blockmode, cbc, cipher, crypto, go, golang, io, reader, stream, writer
- Language: Go
- Homepage: https://pkg.go.dev/github.com/connesc/cipherio
- Size: 25.4 KB
- Stars: 7
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# cipherio
[](https://pkg.go.dev/github.com/connesc/cipherio)
[](https://goreportcard.com/report/github.com/connesc/cipherio)
[](https://github.com/connesc/cipherio/tags)
[](LICENSE)
This Golang package allows to use block ciphers with `io.Reader` and `io.Writer`.
Golang already provides [`io.Reader`](https://golang.org/pkg/io/#Reader) and [`io.Writer`](https://golang.org/pkg/io/#Writer) implementations for [`cipher.Stream`](https://golang.org/pkg/crypto/cipher/#Stream), but not for [`cipher.BlockMode`](https://golang.org/pkg/crypto/cipher/#BlockMode) (such as AES-CBC). The purpose of this package is to fill the gap.
Block ciphers require data size to be a multiple of the block size. The `io.Reader` and `io.Writer` implementations found here can either enforce this requirement or automatically apply a user-defined padding.
This package has been written with performance in mind: buffering and copies are avoided as much as possible.