Code Monkey home page Code Monkey logo

paseto's People

Contributors

dependabot[bot] avatar zenithar avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

kumsumit

paseto's Issues

Test with paseto v4 from other languages

Describe the bug
I've been checking your library and wanted to try to encrypt in GO and decrypt in nodeJS.
I've generated a token using a string as key that is 'vZ2WkkcJCeFXuQtpogPt2Ywof43X0h0x'
Then i went on doing this in javascript

import { PasetoV4Local } from "paseto-browser";

const localKey = 'vZ2WkkcJCeFXuQtpogPt2Ywof43X0h0x';//generateKeys('local');

const token = 'v4.local.GeneratedToken';

try {
  let key = new TextEncoder("utf-8").encode(localKey);
  console.log(key)
  const paseto = new PasetoV4Local(key)
  const decrypted = await paseto.decrypt(token, key, {
    validatePayload: false,
  });
  console.log(decrypted);
} catch(err) {
    console.log(err)
}

It gave me this error 'Error: Invalid tag'

I tried another library that is paseto-ts and it gave me the same error, it seems the tag always differ from the go implementation.
I'm not sure if i missuse something there but i didn't add any kind of custom things, here is my encrypt call

// account is a marshalled json
token, err := pasetov4.Encrypt(rand.Reader, "vZ2WkkcJCeFXuQtpogPt2Ywof43X0h0x", account, nil, nil)

Expected behavior
Encrypting on go should still have a valid decode using other language libraries

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.