'what does it mean, or what is Cg== [closed]
Could someone tell me what Cg== means, I just know it's related to Base64.
I have searched but I still don't have a correct answer or an idea of what it is, and I don't have much knowledge about base64
Solution 1:[1]
Cg== is the base64 encode of the new line character in the latest position. So if you want to encode ABC you will get QUJD, however if you include a "return character" after ABC you will get QUJDCg==.
Solution 2:[2]
You can use hexdump or xxd to reveal the actual value of the character in hexadecimal. In the case of Cg==, it's a linefeed (0A) which can be verified with the following:
? echo -n "Cg==" | base64 -d | hexdump -C
00000000 0a |.|
00000001
Solution 3:[3]
In my experience Cg== arises from passing a string (usually credentials) to base64 using echo (without the -n switch and thus appending the default newline character at the end) rather than e.g. with printf.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | doctore |
| Solution 2 | 0xack13 |
| Solution 3 | mirekphd |
