Skip to content

Instantly share code, notes, and snippets.

@ayubmalik
ayubmalik / cipherstreams.go
Last active September 27, 2023 19:43
Go (golang) crypto sample using cipher.StreamWriter and cipher.StreamReader to wrap io.Writer and io.Reader with AES encryption.
package main
import (
"crypto/aes"
"crypto/cipher"
"crypto/md5"
"crypto/rand"
"errors"
"fmt"
"io"