GithubHelp home page GithubHelp logo

thangchung / branca-dotnet Goto Github PK

View Code? Open in Web Editor NEW
6.0 3.0 4.0 12 KB

Authenticated and encrypted API tokens using modern crypto

Home Page: https://www.branca.io

License: MIT License

C# 100.00%
api xchacha20-poly1305 token-authetication jwt dotnet-core

branca-dotnet's Introduction

Branca Tokens for .NET Core

Authenticated and encrypted API tokens using modern crypto.

Software License

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. 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.

Install

Install the library using .NET SDK.

$ dotnet restore
$ dotnet run

Usage

Token payload can be any arbitrary data such as string containing an email address. You also must provide a 32 byte secret key. The key is used for encrypting the payload.

TODO

You can keep the token size small by using a space efficient serialization method such as MessagePack or Protocol Buffers.

TODO

Timestamp

Branca token includes a timestamp when it was created. When decoding you can optionally pass a ttl parameter. Value is passed in seconds. Below example throws en exception if token is older than 60 minutes.

TODO

Testing

You can run tests either manually or automatically on every code change.

$ dotnet test

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

License

The MIT License (MIT). Please see License File for more information.

branca-dotnet's People

Contributors

thangchung avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

branca-dotnet's Issues

Wrong email in README

I noticed that you have listed my email address as security contact in your README. I guess you used my README as a template and forgot to change the email address. Could you update the email address to be yours. Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.