An open API service providing package, version and dependency metadata of many open source software ecosystems and registries.

github.com/gorilla/securecookie

Package securecookie encodes and decodes authenticated and optionally encrypted cookie values. Secure cookies can't be forged, because their values are validated using HMAC. When encrypted, the content is also inaccessible to malicious eyes. To use it, first create a new SecureCookie instance: The hashKey is required, used to authenticate the cookie value using HMAC. It is recommended to use a key with 32 or 64 bytes. The blockKey is optional, used to encrypt the cookie value -- set it to nil to not use encryption. If set, the length must correspond to the block size of the encryption algorithm. For AES, used by default, valid lengths are 16, 24, or 32 bytes to select AES-128, AES-192, or AES-256. Strong keys can be created using the convenience function GenerateRandomKey(). Once a SecureCookie instance is set, use it to encode a cookie value: Later, use the same SecureCookie instance to decode and validate a cookie value: We stored a map[string]string, but secure cookies can hold any value that can be encoded using encoding/gob. To store custom types, they must be registered first using gob.Register(). For basic types this is not needed; it works out of the box.

Ecosystem
proxy.golang.org
Latest Release
v1.1.2
over 2 years ago
Versions
2
Dependent Packages
2,561
Dependent Repos
16,980
Links
Registry proxy.golang.org
Source Repository
Docs Documentation
JSON API View JSON
CodeMeta codemeta.json
Package Details
PURL pkg:golang/github.com/gorilla/securecookie
spec
License BSD-3-Clause
Namespace github.com/gorilla
First Release about 9 years ago
Last Synced about 15 hours ago
Repository
Stars 714 on GitHub
Forks 145 on GitHub
Docker Dependents 758
Docker Downloads 4,992,741,166
Commits 63
Committers 22
Avg per Author 2.864
DDS 0.73
Rankings on proxy.golang.org
Overall Top 1.0%
Dependent packages Top 0.1%
Dependent repos Top 0.1%
Forks Top 2.2%
Docker downloads Top 0.1%