skip to Main Content

I am using OpenSSL to encode base64 string.

On windows:

echo -n "1" | openssl.exe base64 
MQo=

On Debian:

echo -n "1" | openssl base64
MQ==

I get MQo= from Windows, but MQ== from linux.

Does anyone know the reason? and which platform generated the right one?

2

Answers


  1. It may not be OS dependent, according to the explanation given below:
    Why does a base64 encoded string have an = sign at the end

    But the example you’ve provided the data is the same on both OS.

    Login or Signup to reply.
  2. MQo= means 0x31 0x0a, MQ== means 0x31. Windows echo command does not support -n argument, reference: windows echo

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search