Git Product home page Git Product logo

libpaseto's Introduction

C library for PASETO

libpaseto is a low-level implementation of Platform-Agnostic Security Tokens in C. It only supports v2 public and private tokens, v1 is not supported. PASETO Registered Claims are not in the scope of this project but can be built ontop of libpaseto.

Building

libpaseto only depends on libsodium and uses CMake. It can be built using the following commands:

mkdir build
cd build
cmake ..
make
cd ..
build/pasetotest

Usage overview

  • Initialize the library: paseto_init
  • Load a key using paseto_v2_{local,public}_load_...
  • Encrypt or sign a message using paseto_v2_local_encrypt or paseto_v2_public_sign respectively
  • Decrypt or verify a token using paseto_v2_local_decrypt or paseto_v2_public_verify respectively. They will return the decoded message on success, a null pointer otherwise.
  • Clean up returned results using paseto_free

Refer to example.c for a detailed example.

License

libpaseto is published under the 3-clause BSD license and makes use of libsodium which is published under the ISC license.

libpaseto's People

Contributors

minus7 avatar

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.