<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Haiders WebSpace &#187; Cryptography</title>
	<atom:link href="http://blog.creativeitp.com/category/posts-and-articles/cryptography/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.creativeitp.com</link>
	<description>Let&#039;s talk about IT</description>
	<lastBuildDate>Sat, 27 Feb 2010 13:15:05 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Introduction to OpenPGP – Encrypt, decrypt, sign and verify files for free!</title>
		<link>http://blog.creativeitp.com/posts-and-articles/cryptography/introduction-to-openpgp-%e2%80%93-encrypt-decrypt-sign-and-verify-files-for-free/</link>
		<comments>http://blog.creativeitp.com/posts-and-articles/cryptography/introduction-to-openpgp-%e2%80%93-encrypt-decrypt-sign-and-verify-files-for-free/#comments</comments>
		<pubDate>Sat, 23 Jan 2010 00:44:06 +0000</pubDate>
		<dc:creator>Haider al-Khateeb</dc:creator>
				<category><![CDATA[Cryptography]]></category>
		<category><![CDATA[Asymmetric Encryption]]></category>

		<guid isPermaLink="false">http://blog.creativeitp.com/?p=221</guid>
		<description><![CDATA[I have also posted this to HackThisSite.org articles Introduction Are you looking for a safe way to encrypt your files and messages? What if there is a method that can do all that and more and yet it is FREE to use? If you are interested, keep reading to know about encrypting and exchanging files [...]]]></description>
			<content:encoded><![CDATA[<p><em>I have also posted this to HackThisSite.org articles</em></p>
<p><b>Introduction</b></p>
<p>Are you looking for a safe way to encrypt your files and messages? What if there is a method that can do all that and more and yet it is FREE to use? If you are interested, keep reading to know about encrypting and exchanging files safely with GPG and PGP.</p>
<p><span id="more-221"></span><br />
<a href="http://www.gnupg.org" target="_blank">GPG</a> is an acronym for Gnu Privacy Guard. It was developed as a free and open source alternative to <a href="http://www.pgp.com" target="_blank">PGP</a>, a famous commercial encryption product. Both GPG and PGP can encrypt and decrypt data on your system, in addition they can be used to authenticate emails and files you exchange with other people, this means that if Bob is sending files and emails to Alice, she can check if the data has been altered in the way by any third party and if the sender is Bob for sure and no one else. Furthermore, with these applications, Bob can also make sure that only Alice will be able to decrypt and read/view the data he is sending. </p>
<p>Before proceeding with how this works in practice, let me first start with a small formal introduction to the protocol these programs use, that is OpenPGP (<a href="http://tools.ietf.org/html/rfc4880" target="_blank">RFC 4880</a>).</p>
<p><b>OpenGPG</b></p>
<p>OpenPGP is the most used email encryption standard now a day. It uses public-keys in combination with symmetric cryptography and hash-function to provide security solutions for electronic communications and data storage. Any OpenPGP software should support data confidentiality, integrity and authentication.</p>
<p>So OpenGPG is the standard or the protocol, while PGP and GPG are the applications you can use. </p>
<p><b>The software</b></p>
<p>It is best now to get your own copy of the software. GPG is free, if you are using Windows, you can get GPG4win from: <a href=" http://www.gpg4win.org" target="_blank"> http://www.gpg4win.org</a>.</p>
<p>For Mac and Unix/Linux systems, download the copy that is best for you from: <a href="http://www.gnupg.org/related_software/frontends.en.html" target="_blank">here</a></p>
<p>Usually GPG is installed by default in most Linux distributions. In Ubuntu for example, you can start working on it directly using your command line, but to save yourself time and make your life easier,  add the suitable frontend for Gnome: Seahorse, by running the following commands:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> seahorse</pre></div></div>

<p>And also install its plug-ins</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> seahorse-plugins</pre></div></div>

<p>If you are a KDE user then you should get KGpg instead of Seahorse.</p>
<p>On the other hand, you can also use PGP. It is commercial, but the good news is that: if you decide to use their trial version without entering the license key, it works as a freeware version. It does not give you the full functionality of a commercial license of course, however, what you get is convenient enough (I personally use it). You can download the trial version and try it yourself from <a href="http://www.pgp.com/downloads/desktoptrial/desktoptrial2.html“ target="_blank">here</a></p>
<p><b>How it works</b></p>
<p>Now, that you installed a software (I assume), you should have a small program responsible for key management, that will usually be GPA if you got GPG4win, KGpg for KDE Linux or else, Seahorse if you are using Gnome. A Key Manager is used to create, delete, import, export and backup keys in addition to some few other management tasks. So what are these keys used for?</p>
<p>When you create a key, the software generates two, a private key for your own use and a relevant public key that can be sent to all other people to communicate securely with you. </p>
<p><i>What you really need to understand is that:</i></p>
<ul>
<li>All data encrypted with your public key, can only be decrypted with your private key. This is how GPG provide confidentiality i.e. data can only be read by the person who is meant to read it. So, if Bob wants to send a confidential file to Alice, he encrypts the file with her public key and sends it. Do you see how important it is to keep your private key secure? That is why the software makes you protect it with a passphrase.</li>
</ul>
<ul>
<li> All data you encrypt with your private key can be decrypted using the public key: this implies that if Alice is able to decrypt data using Bob’s public key, she knows for sure that he was the one who encrypted it, no one else. </li>
</ul>
<p><b>Digital Signatures</b></p>
<p>But why should Bob encrypt the whole file if all he needs is to prove authenticity to Alice? What if he is sending the file to many people and only Alice needs to authenticate it?</p>
<p>For this reason, we have digital signatures: Bob can simply sign the file with his private key instead of encrypting it.</p>
<p>Signing files can be done using Kleopatra if you installed GPG4win, otherwise simply right-click any file and the popup menu you get should have a new option to let you sign and/or encrypt the file. </p>
<p>Signing a file results in a digital signature, which contains a message digest (can be produced using a hash function such as MD5 algorithm) of the original file encrypted with Bob’s private key. The message digest maintains data integrity, because any change happens to the file changes its digest as well. While the fact that it has been encrypted with Bob’s private key proves him as the original sender. Interestingly, this can also be used as a method of non-repudiation, which implies that it prevents the sender from claiming that he or she did not actually send the information!</p>
<p>Now if Bob’s public key can decrypt and read the signature, Alice knows he is the sender, and then she uses the content (the message digest hash) to compare with a new calculated hash of the file she received. If they match, then the file has not been altered. Meanwhile, other people who might have received the file and does not have Bob’s public key, can simply use the file (because it is not encrypted) and ignore the digital signature.</p>
<p>Of course all of this is done easily by the software, no much manual work for you other than understanding how the software works.</p>
<p><b>Key Servers and Public Key Distribution</b></p>
<p>Exchanging public keys can be easy with a friend you already know, but what if you don’t have a direct contact with the person? How can you make sure the key you get isn’t fake? What if someone else made it up?</p>
<p>As a solution, Key Servers host public keys for everyone and provide you with solutions to work around this problem. <a href="https://keyserver.pgp.com" target="_blank">PGP Global Directory</a> for example verify the email address attached to every key before listing them online, hence, if you recognize the email address, you could trust the public key attached belongs to the owner of the email address.</p>
<p>Another one is <a href="http://keys.gnupg.net" target="_blank">SKS OpenPGP Keyserver</a>. It shows you how many users trusted a certain public key and signed it as valid. In principle, if you see that many users signed a key, you might have a reason to think it actually belongs to its owner. This method is called “web of trust&#8221; and it helps to authenticate keys. So, it is best that you sign the keys you personally trust and ask the people who know you to sign your key as well to show it as valid. Make sure you don’t forget publishing any public key you sign to the key servers.</p>
<p>There are many key servers and many of them are linked together, so once you send your public key to one of them manually or by using your software, consequently, they will update each other with your information. </p>
<p><b>Digital Certificates</b></p>
<p>When someone signs a public key as valid, this operation results in what we call: a digital certificate. So, a digital certificate consists of a public key, identity information (owner’s name, email etc) and a digital signature by a third party to verify that the identity information belongs to the public keys. The third party can be a person, group, organization etc. </p>
<p><b>Conclusion</b></p>
<p>An interesting idea if you have some private data that you share with somebody is to encrypt it twice with both of your public keys. That way, neither of you can make use of it alone!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.creativeitp.com/posts-and-articles/cryptography/introduction-to-openpgp-%e2%80%93-encrypt-decrypt-sign-and-verify-files-for-free/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>MD5 checksums to verify files integrity</title>
		<link>http://blog.creativeitp.com/posts-and-articles/cryptography/md5-checksums-to-verify-files-integrity/</link>
		<comments>http://blog.creativeitp.com/posts-and-articles/cryptography/md5-checksums-to-verify-files-integrity/#comments</comments>
		<pubDate>Sat, 16 Jan 2010 19:59:57 +0000</pubDate>
		<dc:creator>Haider al-Khateeb</dc:creator>
				<category><![CDATA[Cryptography]]></category>
		<category><![CDATA[Hash Function]]></category>

		<guid isPermaLink="false">http://blog.creativeitp.com/?p=204</guid>
		<description><![CDATA[MD5 (Message-Digest algorithm 5) can be used effectively to verify files integrity and authenticity by computing and checking MD5 hashes. In Windows: MD5summer can be used to perform the task. While in Linux: The famous md5sum utility is usually used. The following examples shows how md5sum can be used from the command line. To compute [...]]]></description>
			<content:encoded><![CDATA[<p>MD5 (Message-Digest algorithm 5) can be used effectively to verify files integrity and authenticity by computing and checking MD5 hashes.</p>
<p>In Windows: <a href="http://www.md5summer.org" target="_blank">MD5summer</a> can be used to perform the task.</p>
<p>While in Linux: The famous <a href="http://manpages.ubuntu.com/manpages/lucid/en/man1/md5sum.1.html" target="_blank">md5sum</a> utility is usually used.</p>
<p> <span id="more-204"></span><br />
The following examples shows how <b>md5sum</b> can be used from the command line.</p>
<p>To compute the MD5 sum of an ISO file for example use:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">md5sum filename.iso</pre></div></div>

<p>The result will be something like:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">f8c7451b0de5a1e5f7a68fb3d15f4064 filename.zip</pre></div></div>

<p>Note that the wild card can be used too, so if you are in a folder containing many files, you can compute the hashes to all files using:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">md5sum <span style="color: #000000; font-weight: bold;">*</span></pre></div></div>

<p>or</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">md5sum h<span style="color: #000000; font-weight: bold;">*</span>.exe</pre></div></div>

<p>Some applications/distributions provide a file with all MD5 hashes of the released files. Ubuntu for example provide a file called MD5SUMS and it looks like this from inside:</p>
<p><b><br />
836440698456aa2936a4347b5485fdd6 *ubuntu-9.10-alternate-amd64.iso<br />
3faa345d298deec3854e0e02410973dc *ubuntu-9.10-alternate-i386.iso<br />
dc51c1d7e3e173dcab4e0b9ad2be2bbf *ubuntu-9.10-desktop-amd64.iso<br />
d91659de6e945dbb96eb8970b2b4590a *ubuntu-9.10-desktop-armel+dove.img<br />
297875d2a7531824a0fb08f241d33e85 *ubuntu-9.10-desktop-armel+imx51.img<br />
8790491bfa9d00f283ed9dd2d77b3906 *ubuntu-9.10-desktop-i386.iso<br />
ed6e77587b87fe0d92a2f21855869f00 *ubuntu-9.10-netbook-remix-i386.iso<br />
14707e8847b9c9ba2dd1869fb5086e4f *ubuntu-9.10-server-amd64.iso<br />
55618ad5f180692f9dac20cbff352634 *ubuntu-9.10-server-i386.iso<br />
37a04db193b1a342f961f59aea2fada8 *wubi.exe<br />
</b></p>
<p>Now assume you downloaded: ubuntu-9.10-alternate-i386.iso<br />
You can verify it&#8217;s hash against that list with the following command:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">md5sum ubuntu-<span style="color: #000000;">9.10</span>-alternate-i386.iso <span style="color: #660033;">-c</span> MD5SUMS</pre></div></div>

<p>If the comparison results in a single match then your file is alright.</p>
<p>To cultivate the result, use the following to show the positive match only:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">md5sum ubuntu-<span style="color: #000000;">9.10</span>-alternate-i386.iso <span style="color: #660033;">-c</span> MD5SUMS <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #660033;">-v</span> <span style="color: #ff0000;">&quot;FAILED$&quot;</span></pre></div></div>

<p><b>grep -v &#8220;FAILED$&#8221;</b> is used to ignore the failed comparisons in the results, hence, if we change it to <b>grep -v &#8220;OK$&#8221;</b> we can get the failed comparisons only. this is useful when you run md5sum to verify many files against a list and need to check if there are any bad files.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.creativeitp.com/posts-and-articles/cryptography/md5-checksums-to-verify-files-integrity/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Introduction to Modern Steganography</title>
		<link>http://blog.creativeitp.com/posts-and-articles/cryptography/introduction-to-modern-steganography/</link>
		<comments>http://blog.creativeitp.com/posts-and-articles/cryptography/introduction-to-modern-steganography/#comments</comments>
		<pubDate>Mon, 11 Jan 2010 12:36:54 +0000</pubDate>
		<dc:creator>Haider al-Khateeb</dc:creator>
				<category><![CDATA[Cryptography]]></category>
		<category><![CDATA[Steganography]]></category>

		<guid isPermaLink="false">http://blog.creativeitp.com/?p=164</guid>
		<description><![CDATA[This article introduces steganography and explains some of its techniques and methods supported by examples. My objective was to make this post as short as possible while covering all important information. Your comments are welcome for any possible enhancements or for future articles about steganography by me or other people. I have also posted this [...]]]></description>
			<content:encoded><![CDATA[<p>This article introduces steganography and explains some of its techniques and methods supported by examples. My objective was to make this post as short as possible while covering all important information. Your comments are welcome for any possible enhancements or for future articles about steganography by me or other people.<br />
<i>I have also posted this to HackThisSite.org articles.</i></p>
<p><b>Steganography</b></p>
<p>Steganography is all the techniques used to exchange secret messages without drawing attention. It is the science of hiding information.<span id="more-164"></span></p>
<p>Some of the old school methods to hide information are: invisible ink, null ciphers, microdots or the use of pinpricks, deliberate misspelling or slightly different font to mark certain words in messages and maps.</p>
<p><b>Null cipher</b></p>
<p>It’s a normal text written in the clear, but includes a hidden message. For example:</p>
<p>‘‘Fishing freshwater bends and saltwater coasts rewards anyone feeling stressed. Resourceful anglers usually find masterful leapers fun and admit swordfish rank overwhelming anyday.’’ [2] </p>
<p>If we take out the third letter in each word, we get: <i>Send Lawyers, Guns, and Money</i>.</p>
<p><b>Modern steganography</b> refers to hiding information in digital images, audio files or even video. There are many methods and tools to do that. Nevertheless, and to have double protection, secret messages are first encrypted and then hidden using a steganography tool.</p>
<p>The steganographic process can be described with the following formula:</p>
<p>Cover medium + Data to hide + Stego key<b>*</b> = Stego Medium</p>
<p><b>*</b> Note that if no encryption is added, there is no need for a <i>Stego key</i>.</p>
<p><b>Hiding messages in pictures</b></p>
<p>This is usually done by:</p>
<li>LSB (Least Significant Bit insertion).</li>
<li>Masking &#038; filtering.</li>
<li>Algorithms &#038; transformations.</li>
<p>Using LSB is famous, so I will choose it to explain how data can be hidden in images.</p>
<p>LSB is always the last bit on the right-hand side of any binary number. Changing this bit causes the least possible effect to the original value.<br />
<br />
In a 24-bit image, there are 3 bytes of data to represent RGB values for every pixel in that image. This implies that we can store/hide 3 bits in every pixel. For example, if the image has the following bits:</p>
<p>10010101   00001101   11001001<br />
10010110   00001111   11001010<br />
10011111   00010000   11001011</p>
<p>To store <b>101101101</b>. we replace with the original LSBs like this:</p>
<p>1001010<b>1</b>   0000110<b>0</b>   1100100<b>1</b><br />
1001011<b>1</b>   0000111<b>0</b>   1100101<b>1</b><br />
1001111<b>1</b>   0001000<b>0</b>   1100101<b>1</b></p>
<p>To reveal the stored message, the LSBs are extracted alone from the <i>Stego Medium</i> and combined together.</p>
<p><b>Hiding messages in audio files</b></p>
<p>Two known methods to store message in audio files are: <i>Frequency Domain</i> and <i>Time Domain</i>.</p>
<p>In Frequency Domain, a message can be stored in practically unused frequencies of audio files. For instance, In a CD where the sample rate is 44.1 kHz, the highest frequency without aliasing is 22.05 kHz.<br />
<br />
Now, because the average peak frequency that an adult can hear is approximately 18 kHz, this leaves 4 kHz of frequency that is &#8220;practically unused&#8221;. This space can then be used to hide a message (a copyright message for example).</p>
<p>In Time Domain, a message can be stored in the LSBs, something similar to what we saw with images. To maintain CD quality, it is important to encode at 16 bits per sample at a rate of 44.1kHz.  However, we can also record at 8 bits per sample using the high significant bits (first bits on your left-hand side) and save the other 4 LSBs to hide our message without making any perceptible change to the audio quality.</p>
<p>In a comparison between the two, detecting messages hidden with time domain is harder because it requires more resources. [4]</p>
<p><b>Watermarking (digital watermarking)</b></p>
<p>Whenever there is a topic about steganography now a day, <i>Digital Watermarking</i> is also mentioned. It refers to embedding hidden messages as well, but not for the purpose of sending secret information. Instead, Watermarking is usually used for the following:</p>
<ol>
<li>Copyright protection: include ownership information.</li>
<li>Copy protection: include instructions to stop data copying devices from making and distributing copies of the original.</li>
<li>Prove data authenticity.</li>
<li>Tracking: If copies of a file are distributed illegally, the source can be revealed if the master copies had unique watermarks included.</li>
</ol>
<p><b>Stego Tools</b></p>
<p>The following freeware tools have been tested by me on Windows 7 and they work great:</p>
<li>4t HIT Mail Privacy LITE 1.01</li>
<li>S-Tools 4.0</li>
<p>To find more tools (commercials and freeware) make use of the following lists as they are the best I found online or do your own googling:</p>
<li><a href="http://home.comcast.net/~ebm.md/stego/software.html" target="_blank">http://home.comcast.net/~ebm.md/stego/software.html</a></li>
<li><a href="http://www.jjtc.com/Security/stegtools.htm" target="_blank">http://www.jjtc.com/Security/stegtools.htm</a></li>
<p><b>Steganalyses and countermeasures</b></p>
<p>Steganalyses aim to investigate suspected information to determine whether they include any sealed data and reveal the hidden message if exist.</p>
<p>Any <u>unusual patterns</u> (visual or statistical) are usually analyzed to detect suspected information. Hence, any method can be useful, for instance, image editors and hex editors (e.g. HEX Workshop). </p>
<p>Some methods are designed and developed to detect and reveal information hidden by known steganography tools.  There are also enhanced and powerful digital forensic analysis tools such as StegAlyzerSS (Steganography Analyzer Signature Scanner) developed by the Steganography Analysis and Research Center [5]. </p>
<p><b>Conclusion note<b/></p>
<p>The references at the end of this article are quite informative, have a go on them in your free time if you are looking for more details.</p>
<p><b>References</b></p>
<p>[1] Introduction to Steganography. [cited 2010 Jan 08]; Available from:</p>
<p>http://www.infosyssec.com/infosyssec/Steganography/menu.htm</p>
<p>
[2] Johnson, N. F., Duric, Z., Jajodia, S. Information Hiding: Steganography and Watermarking &#8211; Attacks and Countermeasures. Kluwer Academic Press. Norwrll, MA, New York, The Hague, London, 2000.<br />
<br />
[3] Gary C. Kessler. Steganography: Hiding Data Within Data. 2001 [cited 2010 Jan 08]; Available from:</p>
<p>http://www.garykessler.net/library/steganography.html</p>
<p>
[4] Steganography in Signals. [cited 2010 Jan 09]; Available from:</p>
<p>http://www.owlnet.rice.edu/~elec301/Projects01/smokey_steg/steg.html</p>
<p>
[5] Steganography Analyzer Signature Scanner. [cited 2010 Jan 09]; Available from:</p>
<p>http://www.sarc-wv.com/stegalyzerss.aspx</p>
<p>[6] Gary C. Kessler. An Overview of Steganography for the Computer Forensics Examiner. [cited 2010 Jan 10]; Available from: http://www.fbi.gov/hq/lab/fsc/backissu/july2004/research/2004_03_research01.htm</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.creativeitp.com/posts-and-articles/cryptography/introduction-to-modern-steganography/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>The pigpen cipher aka Masonic cipher</title>
		<link>http://blog.creativeitp.com/posts-and-articles/cryptography/the-pigpen-cipher-aka-masonic-cipher/</link>
		<comments>http://blog.creativeitp.com/posts-and-articles/cryptography/the-pigpen-cipher-aka-masonic-cipher/#comments</comments>
		<pubDate>Sun, 11 Jan 2009 08:16:17 +0000</pubDate>
		<dc:creator>Haider al-Khateeb</dc:creator>
				<category><![CDATA[Cryptography]]></category>
		<category><![CDATA[Symmetric Encryption]]></category>

		<guid isPermaLink="false">http://blog.creativeitp.com/?p=44</guid>
		<description><![CDATA[Have you seen a code similar to this before? An interesting example from real life is the stone of James Leeson, who died in 1792. For a long time, the box-and-dot code at the top of the stone (Figure 1) remained a mystery for the public, but the secret was revealed as Meyer Berger explained [...]]]></description>
			<content:encoded><![CDATA[</p>
<p><img src="http://blog.creativeitp.com/wp-content/uploads/2010/01/pigpen3.gif" border="0" /></p>
<p>Have you seen a code similar to this before?</p>
<p>An interesting example from real life is the stone of James Leeson, who died in 1792. For a long time, the box-and-dot code at the top of the stone (Figure 1) remained a mystery for the public, but the secret was revealed as Meyer Berger explained in his NY Times column in the 1950s, it was finally decrypted. It says: &#8220;Remember death&#8221;. It was a Masonic cipher.</p>
</p>
<div id="attachment_38" class="wp-caption aligncenter" style="width: 294px"><img src="http://blog.creativeitp.com/wp-content/uploads/2010/01/pigpen-f1.jpg" alt="" title="pigpen-f1" width="284" height="214" class="size-full wp-image-38" /><p class="wp-caption-text">Figure 1: Stone of James Leeson 1</p></div>
<p><span id="more-44"></span></p>
<p>The pigpen cipher or the Masonic/Freemason&#8217;s cipher is a simple encryption scheme used in the 16th century to secure correspondence between the Freemasons members. [2][3]</p>
</p>
<p>The cipher is created by replacing each letter of the alphabet with a symbol, therefore it is defined nowadays as a simple substitution cipher.</p>
</p>
<p>Symbols used in pigpen are created by drawing a grid like the one in Figure 2.</p>
</p>
<div id="attachment_39" class="wp-caption aligncenter" style="width: 222px"><img src="http://blog.creativeitp.com/wp-content/uploads/2010/01/pigpen-f2.gif" alt="" title="pigpen-f2" width="212" height="212" class="size-full wp-image-39" /><p class="wp-caption-text">Figure 2: A typical example for a pigpen cipher key.</p></div>
<p>Based on the key (grid) in Figure 2</p>
<p><img src="http://blog.creativeitp.com/wp-content/uploads/2010/01/pigpen1.gif" border="0" /></p>
<p>A sentence like &#8220;FREE WORLD&#8221; can be encrypted to be:</p>
<p><img src="http://blog.creativeitp.com/wp-content/uploads/2010/01/pigpen2.gif" border="0" /></p>
<table style="height: 166px; background-color: #f0f0f0;" border="0" width="515">
<tbody>
<tr>
<td>
<p><strong>Fun exercise:</strong></p>
<p><strong><span style="color: #ff0000;">Question:</span></strong> Who was behind the invention of the frequency analysis technique for breaking monoalphabetic substitution ciphers?</p>
<p><strong><span style="color: #008000;">Answer:</span></strong></p>
<p><img src="http://blog.creativeitp.com/wp-content/uploads/2010/01/pigpen3.gif" border="0" /></p>
<p>(decrypt to find out)</p>
</td>
</tr>
</tbody>
</table>
<p></b></p>
<p><span style="color: #008000;"><strong> </strong></span></p>
<p>To enhance security, let us choose a key such as &#8220;PEACE&#8221; and put it into the grid, Figure 3:</p>
<div id="attachment_40" class="wp-caption aligncenter" style="width: 222px"><img src="http://blog.creativeitp.com/wp-content/uploads/2010/01/pigpen-f3.gif" alt="" title="pigpen-f3" width="212" height="212" class="size-full wp-image-40" /><p class="wp-caption-text">Figure 3</p></div>
<p>I excluded the last &#8220;E&#8221; in &#8220;PEACE&#8221; because no letter should be written twice. Now let’s fill in the rest of the letters and have our personalized grid</p>
</p>
<div id="attachment_41" class="wp-caption aligncenter" style="width: 222px"><img src="http://blog.creativeitp.com/wp-content/uploads/2010/01/pigpen-f4.gif" alt="" title="pigpen-f4" width="212" height="212" class="size-full wp-image-41" /><p class="wp-caption-text">Figure 4</p></div>
<p>Although we can change the grid every time we use a different keyword, this encryption scheme is not secure as it used to be at its time, because the use of symbols is no impediment to modern cryptanalysis techniques.</p>
<p>At the end of this article, here is a gift for you:</p>
</p>
<p>Right Click on Figure 5 and choose <em>Save Target As</em> to download a Masonic Cipher &amp; Symbols Font for your MS Word, so you could write the symbols easily and have fun with your friends.</p>
</p>
</p>
<div id="attachment_42" class="wp-caption aligncenter" style="width: 230px"><a href="http://blog.creativeitp.com/wp-content/uploads/2010/01/fam-code.zip"><img src="http://blog.creativeitp.com/wp-content/uploads/2010/01/pigpen-f5.gif" alt="" title="pigpen-f5" width="220" height="194" class="size-full wp-image-42" /></a><p class="wp-caption-text">Figure 5: Masonic Cipher &amp; Symbols Font (4)</p></div>
<p>To install the font file Right Click on it and select Install or simply move it to your C:\Windows\Fonts folder.</p>
</p>
<p><strong>References:</strong></p>
<p>[1] http://www.forgotten-ny.com/forgottentour17/tour17.html <br />[2] David Kahn, &#8220;The Codebreakers. The Story of Secret Writing.&#8221; Macmillan, 1967. <br />[3] David E. Newton, &#8220;Freemason&#8217;s Cipher&#8221; in Encyclopedia of Cryptology, 1998.<br />[4] FAM-Code© http://www.odr.org/anonymous/fam-code.htm</p>
</p>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.creativeitp.com/posts-and-articles/cryptography/the-pigpen-cipher-aka-masonic-cipher/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>
