<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.johnlradford.io/index.php?action=history&amp;feed=atom&amp;title=Base_64</id>
	<title>Base 64 - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.johnlradford.io/index.php?action=history&amp;feed=atom&amp;title=Base_64"/>
	<link rel="alternate" type="text/html" href="https://wiki.johnlradford.io/index.php?title=Base_64&amp;action=history"/>
	<updated>2026-05-05T15:48:29Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.42.1</generator>
	<entry>
		<id>https://wiki.johnlradford.io/index.php?title=Base_64&amp;diff=6&amp;oldid=prev</id>
		<title>Admin: Created page with &quot;== On The Command Line ==  * To decode messages which are in Base 64 simply copy the content of the message into a text file. For example, lets decode the base 64 listed below.   TWFuIGlzIGRpc3Rpbmd1aXNoZWQsIG5vdCBvbmx5IGJ5IGhpcyByZWFzb24sIGJ1dCBieSB0aGlz  IHNpbmd1bGFyIHBhc3Npb24gZnJvbSBvdGhlciBhbmltYWxzLCB3aGljaCBpcyBhIGx1c3Qgb2Yg  dGhlIG1pbmQsIHRoYXQgYnkgYSBwZXJzZXZlcmFuY2Ugb2YgZGVsaWdodCBpbiB0aGUgY29udGlu  dWVkIGFuZCBpbmRlZmF0aWdhYmxlIGdlbmVyYXRpb24gb2Yga25vd2xlZGdlLC...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.johnlradford.io/index.php?title=Base_64&amp;diff=6&amp;oldid=prev"/>
		<updated>2023-10-04T09:46:37Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;== On The Command Line ==  * To decode messages which are in Base 64 simply copy the content of the message into a text file. For example, lets decode the base 64 listed below.   TWFuIGlzIGRpc3Rpbmd1aXNoZWQsIG5vdCBvbmx5IGJ5IGhpcyByZWFzb24sIGJ1dCBieSB0aGlz  IHNpbmd1bGFyIHBhc3Npb24gZnJvbSBvdGhlciBhbmltYWxzLCB3aGljaCBpcyBhIGx1c3Qgb2Yg  dGhlIG1pbmQsIHRoYXQgYnkgYSBwZXJzZXZlcmFuY2Ugb2YgZGVsaWdodCBpbiB0aGUgY29udGlu  dWVkIGFuZCBpbmRlZmF0aWdhYmxlIGdlbmVyYXRpb24gb2Yga25vd2xlZGdlLC...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== On The Command Line ==&lt;br /&gt;
&lt;br /&gt;
* To decode messages which are in Base 64 simply copy the content of the message into a text file. For example, lets decode the base 64 listed below.&lt;br /&gt;
&lt;br /&gt;
 TWFuIGlzIGRpc3Rpbmd1aXNoZWQsIG5vdCBvbmx5IGJ5IGhpcyByZWFzb24sIGJ1dCBieSB0aGlz&lt;br /&gt;
 IHNpbmd1bGFyIHBhc3Npb24gZnJvbSBvdGhlciBhbmltYWxzLCB3aGljaCBpcyBhIGx1c3Qgb2Yg&lt;br /&gt;
 dGhlIG1pbmQsIHRoYXQgYnkgYSBwZXJzZXZlcmFuY2Ugb2YgZGVsaWdodCBpbiB0aGUgY29udGlu&lt;br /&gt;
 dWVkIGFuZCBpbmRlZmF0aWdhYmxlIGdlbmVyYXRpb24gb2Yga25vd2xlZGdlLCBleGNlZWRzIHRo&lt;br /&gt;
 ZSBzaG9ydCB2ZWhlbWVuY2Ugb2YgYW55IGNhcm5hbCBwbGVhc3VyZS4=&lt;br /&gt;
&lt;br /&gt;
To do so copy this text into a file named text.txt. Then cat that file and pipe the output through the base64 decoder.&lt;br /&gt;
&lt;br /&gt;
 cat text.txt | base64 -d &lt;br /&gt;
&lt;br /&gt;
And tahdah! The message appears,&lt;br /&gt;
&lt;br /&gt;
 Man is distinguished, not only by his reason, but by this singular passion from other animals, which is a &lt;br /&gt;
 lust of the mind, that by a perseverance of delight in the continued and indefatigable generation of &lt;br /&gt;
 knowledge, exceeds the short vehemence of any carnal pleasure.&lt;br /&gt;
&lt;br /&gt;
* To encode a message as base 64 simply run base64 on a file.&lt;br /&gt;
 &lt;br /&gt;
 File as is,&lt;br /&gt;
 cat file&lt;br /&gt;
 This is a text file&lt;br /&gt;
&lt;br /&gt;
 File in base64&lt;br /&gt;
 cat file | base64&lt;br /&gt;
 VGhpcyBpcyBhIHRleHQgZmlsZQo=&lt;br /&gt;
&lt;br /&gt;
For more information about how to use the base64 command in the terminal run,&lt;br /&gt;
 &lt;br /&gt;
 base64 --help&lt;br /&gt;
&lt;br /&gt;
Or read the wikipedia page about the encoding [https://en.wikipedia.org/wiki/Base64 here].&lt;br /&gt;
&lt;br /&gt;
== With Python3 ==&lt;br /&gt;
&lt;br /&gt;
* Encode &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; import base64&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; message=&amp;quot;blah&amp;quot;&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; message_bytes = message.encode(&amp;#039;utf8&amp;#039;)&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; base64_bytes = base64.b64encode(message_bytes)&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; base64_message = base64_bytes.decode(&amp;#039;utf8&amp;#039;)&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; print(base64_message)&lt;br /&gt;
YmxhaA==&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
* Decode&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; import base64&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; message=&amp;quot;YmxhaA==&amp;quot;&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; base64.b64decode(message)&lt;br /&gt;
b&amp;#039;blah&amp;#039;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
</feed>