base64 gives incorrect result
Asked Answered
O

1

7

Because I am setting up vnc server, I need to convert string to base64 to setup password. (How to setup vnc password

Say, if I want my password to be qwerty, I have to place the encoded string into the password into conf file.

I see there is a base64 utility in Ubuntu. man base64. echo qwerty | base64 gives cXdlcnR5Cg==. But this doesn't work.

But if I use the online base 64 tool. qwerty is encoded to cXdlcnR5. This string WILL WORK.

Question: why the two base64 encode gives different result?

Ozzie answered 7/10, 2018 at 19:10 Comment(1)
S
20

echo adds a '\n' ; try echo -n

$ echo -n qwerty | base64 
cXdlcnR5
Sump answered 7/10, 2018 at 19:16 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.