Questions tagged [base64]

Questions about encoding/decoding file or stdin by using base64

Filter by
Sorted by
Tagged with
-5
votes
2answers
61 views

The following text is encoded in base 64. How do I decode it and get the answer?

Ik5ldmVyIHRydXN0IGEgY29tcHV0ZXIgeW91IGNhbid0IHRocm93IG91dCBhIHdpbmRvdyIgLSBTdGV2ZSBXb3puaWFr How do I decode this and get the answer?
1
vote
2answers
42 views

Unexpected grep behaviour when using command substituiton

I'm trying to find and print out all the files that contain a base64 encoded string, using grep and command substitution. If I first encode the base64 string, and then grep, I'm able to find the file:...
1
vote
1answer
51 views

How can I source a base 64 encoded file in bash?

Is there a way to source a base64 encoded file in bash instead of doing this? cat $DIR/data/saves/$savegame | base64 --decode > $DIR/data/saves/$savegame.decoded . $DIR/data/saves/$savegame....
-4
votes
1answer
70 views

For base64 encoding/decoding, can base64 and uuencode/uudecode be used exchangeably?

Do both base64 (from coreutils) and uuencode -m and uudecode (from sharutils) implement base64 encoding and decoding? Can they be used exchangeably?
-1
votes
1answer
91 views

Bash: Is it better to echo or <<<? [closed]

When passing input, which method is better? > echo 'test' | base64 dGVzdAo= > base64 <<< 'test' dGVzdAo= With variables as well, which method should be use? > t='test' > ...
0
votes
1answer
449 views

How to decode base64 text in ldif file in Linux?

I need to decode base64 embedded in ldif (openldap) backups. I found here a way to join lines starting with a blank. Then, based on this question about "How to decode base64 text in xml file in ...
1
vote
1answer
4k views

How do you convert a base64 utf-8 encoded string to a binary file from bash?

Is there a tool that will do this in bash?
0
votes
3answers
4k views

What's the right way to base64 encode a binary file on CentOS 7?

I'm using CentOS 7 with bash shell. I thought base64-encoding a binary file would be as simple as [rails@server lib]$ cat mybinary.file | base64 > /tmp/output.base64 However, I notice when I ...
0
votes
2answers
1k views

How can the, encrypted with AES, and BASE64 encoded, SSH private key, have size smaller than specified?

This might be obvious to some, but I wonder, if I generated 8192 key in size with: ssh-keygen -t rsa -b 8192 How can the, encrypted with AES, and BASE64 encoded, SSH private key, have size smaller ...
-1
votes
1answer
55 views

is there a Base64-based dist?

Is there a Linux distribution or Unix version where everything is Base64 encoded in memory? I'm interested in the concept of being able to dump the entire system state and print it as a book.
1
vote
1answer
775 views

Javascript BTOA vs base64 in bash?

I need to convert a username and password combination into base64 before sending to an API. The javascript BTOA function is working for me, but when I try to use base64 command in bash I get slightly ...
1
vote
2answers
474 views

Using Linux, how would I find an image stored in base64 locally? [closed]

I've been given a project handled by a former coder in our organization. It's a php based application and it is Massive (as in tons of files everywhere). I'm trying to find a logo that's stored......
0
votes
1answer
700 views

openssl decoding does not work with echo

I encrypted some data: echo -n aaaa | openssl enc -aes-128-ecb -K E5E9FA1BA31ECD1AE84F75CAAA474F3A -nosalt -out o This decodes it correctly: base64 o | openssl enc -d -aes-128-ecb -K ...
0
votes
2answers
1k views

Concatenate 2 binary strings in base64 form

I have two BASE64 encoded strings and I would like to get the BASE64 encoding of the binary concatenation of the two string using just the command line. Example: > $ echo -n "\x01\x02" |base64 ...
0
votes
1answer
708 views

Base64 decode and overwrite file

I have a file which contains base64 encoded image data: ~/dog/1.jpg I put it there via SSH, and base 64 encoded the data so it would be safe to transfer in the terminal. Assume the base64 image data ...
2
votes
1answer
78 views

What is the point of hashing?

I was looking at my companies hashing implementation and I saw that the passwords for the root user are stored in base64 encoding. What is to stop anyone from simply copying the password and doing a ...
3
votes
1answer
984 views

bash: how do I write base64-encoded content into a file to specified line

I'm working on an "edgemax feature-wizard" which is kind of a plugin system. There are only three files allowed in a plugin tarball: a bash script as backend, a HTML file as frontend and a validation....
1
vote
1answer
184 views

How can I decrypt back a base64 encoded shaX binary string?

For the encrypted base64 encoded SHAX strings, what command can decrypt it back to original string, thanks
8
votes
1answer
8k views

Can OpenSSL decode base64 data that does not contain line breaks?

I have two chunks of base64 data in a bash variable. The usual line breaks within the base64 data have been replaced by spaces and the variable is basically one very long one-line string. I can ...
4
votes
3answers
975 views

Is it possible to convert linux salted sha512 password hash to LDAP format?

We have an LDAP server which stores passwords and other user data. The server is not used for authentication of client machines though but only for authentication of client apps. So users change their ...
4
votes
2answers
3k views

How do I decode a list of base64-encoded file names?

I have a list of base64-encoded file names in the pattern of {base64-encoded part here}_2015-11-12.pdf. I'm trying to decode that list of files and return it on the command line as another list, ...
6
votes
1answer
2k views

How to extract first base64 code out of file?

On Linux I'm having text files and each contains 1 or 2 base64 blocks of code. Following is part of the file and 1 base64 block. Content-Transfer-Encoding: base64 ...
1
vote
0answers
1k views

curl --data-urlencode and underscores

I've been using curl -XPOST to post some links to a Telegram channel via a bot api/key, the urls are in form of https://site/x/pre_encoded_string, where pre_encoded_string is in form (real samples) ...
1
vote
1answer
5k views

Apply SHA256 and Base64 to string in script

I'm trying to apply SHA256 and then Base64 encode a string inside a shell script. Got it working with PHP: php -r 'echo base64_encode(hash("sha256", "asdasd", false));'. But I'm trying to get rid of ...
5
votes
5answers
6k views

Is there a CLI tool that would prettify a JSON string

On my host I enter the following, which returns a bunch of information which isn't particularly easy to read at the CLI. echo $ENV_VAR | base64 --decode Is there a way to format it? This is a ...
1
vote
3answers
5k views

How to decode base64 text in xml file in Linux?

I'm new in linux (shell). I need to decode base64 text in xml file using linux shell script. Could you please help me to write linux shell script for decoding the values of those tags where attribute ...
4
votes
1answer
809 views

What is this seemingly base64 data set by setfattr?

I have written a short shell script that simply wraps setfattr in a slightly more convenient form for setting the extended attribute that corresponds to a free-text comment: #!/bin/sh test "$2" &&...
0
votes
1answer
787 views

base64 encoded e-mails and compression

I sent an e-mail which included almost 2500 characters of text and one attached 60KiB PNG file. This text included number 185 eight times. However, after the e-mail was encoded to base64 and sent, I'm ...
0
votes
1answer
2k views

Extracting a file attachment from an email message and saving it to a file?

I have an email stored in plaintext (yes, headers, messages, attachments, everything in one plaintext file) and I'd like to extract a PDF document from it. I've copied the base64-encoded text, then ...
29
votes
5answers
24k views

How can I get a base64 encoded shaX on the cli?

sha1sum outputs a hex encoded format of the actual sha. I would like to see a base64 encoded variant. possibly some command that outputs the binary version that I can pipe, like so: echo -n "message" |...
2
votes
2answers
3k views

How can I check the Base64 value for an integer?

I would like to check the Base64 value for an integer. There is a base64 linux command but I don't understand how I can apply it on integers. I have tried with base64 10 but then I get the error ...