GithubHelp home page GithubHelp logo

Comments (3)

kr avatar kr commented on August 31, 2024

BecstsYSkJY33Us91kgl6qPubHowWXcqaBxqhu7Nu6_= is invalid base64 data.
DecodeKey should be returning an error, but it's not. I'll fix this.

from fernet-go.

kr avatar kr commented on August 31, 2024

Wait, that's not it. The string is valid URL-safe-flavor base64. Still investigating.

from fernet-go.

kr avatar kr commented on August 31, 2024

Data to be encoded in base64 is padded with 0 to a multiple of 6 bits.
Each group of 6 bits is then encoded into an ascii char, and the whole
string is then padded with = to a multiple of 4 chars.

When decoding, the process is reversed, and padding is discarded
in the process. The go base64 package checks the = padding for
validity, but apparently it silently discards the binary 0 padding.
If any of this padding is nonzero, it is silently ignored.

The base64 rfc doesn't say what to do with invalid 0 padding.
I'll test some other implementations (python, ruby, and the reference
implementation at http://josefsson.org/base-encoding/, for starters)
to see how they handle this.

It's possible that some base-64 encodings are simply not unique.

from fernet-go.

Related Issues (7)

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.