{"repo":"tuupola/branca-spec","free":true,"listed":false,"github":"https://github.com/tuupola/branca-spec","clone":"git clone https://github.com/tuupola/branca-spec.git","description":"Authenticated and encrypted API tokens using modern crypto","language":null,"stars":235,"topics":["xchacha20-poly1305","api","token-authentication","jwt"],"license":null,"category":"auth-billing-email","readme_excerpt":"Branca Token Authenticated and encrypted API tokens using modern crypto. What? Branca is a secure, easy to use token format which makes it hard to shoot yourself in the foot. It uses IETF XChaCha20-Poly1305 AEAD symmetric encryption to create encrypted and tamperproof tokens. The payload itself is an arbitrary sequence of bytes. You can use for example a JSON object, plain text string or even binary data serialized by MessagePack or Protocol Buffers. Although not a goal, it is possible to use Branca as an alternative to JWT. Also see getting started instructions. This specification defines the external format and encryption scheme of the token to help developers create their own implementations. Branca is closely based on the Fernet specification. Design Goals 1. Secure 2. Easy to implement 3. Small token size Token Format A Branca token consists of a header, ciphertext and an authentication tag. The header consists of a version, timestamp and nonce. Putting them all together we get following structure: String representation of the above binary token must use base62 encoding with the following character set. Version Version is 8 bits ie. one byte. Currently, the only version is 0xBA . This is a magic byte which you can use to quickly identify a given token. Version number guarantees the token format and encryption algorithm. Timestamp Timestamp is 32 bits ie. unsigned big-endian 4 byte UNIX timestamp. By having a timestamp instead of expiration time enables the consuming side","default_branch":null,"files":null,"tree":[],"storefront":"/r/tuupola","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/tuupola/branca-spec/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}