Categorygithub.com/Jimeux/chacha
modulepackage
0.0.0-20190618021917-fa3f5fedff8f
Repository: https://github.com/jimeux/chacha.git
Documentation: pkg.go.dev

# README

chacha

Sample code for using package chacha20poly1305 with benchmarks.

encrypt package

Encrypter is a simple utility type using the package that provides the following features:

  • Protects against double encryption / decrypting unencrypted values
  • Generates 24-byte nonce values per encryption
  • Supports a simple mechanism for switching cipher keys

Benchmarks

The benchmarks compare encrypting struct values serialized with JSON and Protobuf.

User struct with short values

FunctionExecutionsTime
BenchmarkRegularJSONEncrypt-810000002070 ns/op
BenchmarkRegularJSONDecrypt-83000003370 ns/op
BenchmarkRegularProtobufEncrypt-810000001418 ns/op
BenchmarkRegularProtobufDecrypt-82000000722 ns/op

User struct with long values

FunctionExecutionsTime
BenchmarkBigJSONEncrypt-83000004345 ns/op
BenchmarkBigJSONDecrypt-820000010114 ns/op
BenchmarkBigProtobufEncrypt-85000003094 ns/op
BenchmarkBigProtobufDecrypt-85000002350 ns/op

# Packages

No description provided by the author
No description provided by the author