Using the Ronin CLI - Encoding

Table of Contents

encode

The ronin encode command can be used to encode a given String into a variety of formats, such as Base64:

$ ronin encode --base64 --string "foo bar baz"
Zm9vIGJhciBiYXo=

Multiple encoding options can be specified, which will cause ronin encode to encode the String with additional encodings in the order that the options were given:

$ ronin encode --zlib --base64 --uri --string "foo bar"
%65%4A%78%4C%79%38%39%58%53%45%6F%73%41%67%41%4B%63%41%4B%61%0A

Supported string formats:

Note:

The ronin encode command behaves the same as if you chained multiple Ruby method calls together on a String:

"foo bar".zlib_deflate.base64_encode.uri_encode
# => "%65%4A%78%4C%79%38%39%58%53%45%6F%73%41%67%41%4B%63%41%4B%61%0A"

decode

The ronin decode command can be used to encode a given String into a variety of formats, such as Base64:

$ ronin decode --base64 --string "Zm9vIGJhciBiYXo="
foo bar baz

Multiple encoding options can be specified, which will cause ronin decode to decode the String with additional encodings in the order that the options were given:

$ ronin decode --uri --base64 --zlib --string "%65%4A%78%4C%79%38%39%58%53%45%6F%73%41%67%41%4B%63%41%4B%61%0A"
foo bar

Supported string formats:

escape

The ronin escape command is similar to the ronin encode command, except that it only escapes special characters:

$ ronin escape --uri --string "foo bar"
foo%20bar

Supported string formats:

unescape

The ronin unescape command is the opposite of the ronin escape command, and will decode escaped special characters:

$ ronin unescape --uri --string "foo%20bar"
foo bar

Supported string formats:

quote

The ronin quote command will escape and quote a given file or string for a variety of languages or formats:

$ ronin quote --c file.bin
"..."

Supported string formats:

unquote

The ronin unquote command is the opposite of the ronin quote command, and will convert a quoted string back into it’s raw format:

$ ronin unquote --c --string '"\x66\x6f\x6f\x20\x62\x61\x72"'
foo bar

Supported string formats: