Closed idodidodi closed 5 years ago
I think it's not directly caused by this module.
You might need to use base64url
encoding. Basically, -
and _
instead of +
and /
, which are not URL-safe characters.
You can achieve this with something like BASE64_STRING.replace(/\-/g, '+').replace(/_/g, '/')
.
Okay, thanks a lot. When I changed it to query string the browser replace those char with URL chars.
But I'll consider your suggestion and check support for all the browsers before I deploy my app.
עידו
On Fri, Oct 18, 2019 at 7:32 PM Snack notifications@github.com wrote:
I think it's not directly caused by this module.
You might need to use base64url encoding https://tools.ietf.org/html/rfc4648#section-5. Basically, - and _ instead of + and /, which are not URL-safe characters.
You can achieve this with something like BASE64STRING.replace(/-/g, '+').replace(//g, '/').
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Snack-X/rijndael-js/issues/2?email_source=notifications&email_token=ADDUWPDWSV6KL3K2H4TG4KLQPHQKFA5CNFSM4JB4HZLKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBVBXGI#issuecomment-543824793, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADDUWPHLM2ES543H3JPXUULQPHQKFANCNFSM4JB4HZLA .
Okay, I have a some more questions.
Thanks a lot.
I think it's not directly caused by this module.
You might need to use
base64url
encoding. Basically,-
and_
instead of+
and/
, which are not URL-safe characters.You can achieve this with something like
BASE64_STRING.replace(/\-/g, '+').replace(/_/g, '/')
.
If you are using it in Node.js environment with .toString(‘base64’)
, you are 100% fine. Base64 is a standard data encoding format.
Actually I do use Node.js environment, and toString('base64') const encryptedStr = encrypted.toString('base64'); console.log('Encrypt output: ', encryptedStr); but the output comes as this: 7JHcGZ59xGe/vPFYMtpeJer6pfpJ4fROXZcA1XJSsm4= With non safe URL chars.
עידו
On Sun, Oct 20, 2019 at 3:57 AM Snack notifications@github.com wrote:
If you are using it in Node.js environment with .toString(‘base64’), you are 100% fine. Base64 is a standard data encoding format.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Snack-X/rijndael-js/issues/2?email_source=notifications&email_token=ADDUWPBPFHAHYM2UOZPXJBLQPOUIDA5CNFSM4JB4HZLKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBX7YKY#issuecomment-544209963, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADDUWPHP5RS4ZADHIFJVG5DQPOUIDANCNFSM4JB4HZLA .
Hi, I have a problem with the slashes in encryption result. While there are slashes I can't use the encryption string as a token in the url link, because it confuses the router. My Vue.js router expects something like that: path: '/:token', // http://localhost:8080/#/ But when it get this: http://localhost:8080/#/ySWUWGwOqEtJIavEAQk9c4RiF6X7cF3y2tshAYDFz/4= it cannot read the token. An example of the encryption result: ySWUWGwOqEtJIavEAQk9c4RiF6X7cF3y2tshAYDFz/4=
I am sure I can change definitions in routes, but wouldn't it be easier if there would be no slashes in the encrtiotion result, like there are no '&' chars.
What do you think?