Comments (3)
BecstsYSkJY33Us91kgl6qPubHowWXcqaBxqhu7Nu6_=
is invalid base64 data.
DecodeKey should be returning an error, but it's not. I'll fix this.
from fernet-go.
Wait, that's not it. The string is valid URL-safe-flavor base64. Still investigating.
from fernet-go.
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fernet-go.