2

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?

Guokas
  • 750
  • 7
  • 23

2 Answers2

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.

MZM
  • 105
  • 1
  • 3
1

MQo= means 0x31 0x0a, MQ== means 0x31. Windows echo command does not support -n argument, reference: windows echo