Siv
siv-aes (rfc5297) authenticated encryption with associated data implementation for Go.
Install / Use
/learn @ChandraNarreddy/SivREADME
siv
SIV-AES (rfc5297) implementation for Golang.
SIV was proposed by Phil Rogaway and Thomas Shrimpton. Synthetic Initialization Vector (SIV) Authenticated Encryption Using the Advanced Encryption Standard (AES) was proposed as a nonce-reuse misuse resistant Deterministic Authenticated Encryption mechanism in rfc5297.
Usage
- Import siv into your source
go get github.com/ChandraNarreddy/siv
import "github.com/ChandraNarreddy/siv"
- Create a Blockpair as -
pair, _ := siv.NewAesSIVBlockPair(key)
where key can be 256, 384 or 512 bit sized []byte array
- Initialize SIV as -
siv, _ := siv.NewSIV(pair)
- Wrap plaintext and additionalData using -
plainBytes := []byte(plainText)
additionalDataBytes := [][]byte{[]byte("first additional data"), []byte("second additional data")}
cipherBytes, _ := siv.Wrap(plainBytes, additionalDataBytes...)
- Unwrap encrypted bytes -
plainBytes, failure := siv.Unwrap(cipherBytes, additionalDataBytes...)
if failure != nil {
//Unwrap failed because of wrong {cipherBytes, additionalDataBytes... and key) combination
} else {
//do what you want to do with plainBytes here
}
Author
Chandrakanth Narreddy
Contributing
Please submit issues for suggestions. Pull requests are welcome too.
License
MIT License
Acknowledgments
- Andreas Auernhammer for CMAC
Related Skills
node-connect
351.4kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
xurl
351.4kA CLI tool for making authenticated requests to the X (Twitter) API. Use this skill when you need to post tweets, reply, quote, search, read posts, manage followers, send DMs, upload media, or interact with any X API v2 endpoint.
frontend-design
110.7kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
351.4kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
