<?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>Fri, 18 Nov 2011 17:36:57 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>TrueCrypt: A tool to encrypt volumes on-the-fly</title>
		<link>http://blog.creativeitp.com/posts-and-articles/cryptography/truecrypt-a-windowslinux-tool-to-encrypt-volumes-on-the-fly/</link>
		<comments>http://blog.creativeitp.com/posts-and-articles/cryptography/truecrypt-a-windowslinux-tool-to-encrypt-volumes-on-the-fly/#comments</comments>
		<pubDate>Tue, 15 Nov 2011 00:55:03 +0000</pubDate>
		<dc:creator>Haider al-Khateeb</dc:creator>
				<category><![CDATA[Cryptography]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://blog.creativeitp.com/?p=578</guid>
		<description><![CDATA[TrueCrypt is a powerful yet free Open-Source disk encryption Software. I am quite satisfied with the software that I decided to introduce it here in my blog, may all future releases remain free to use! With TrueCrypt you can maintain an on-the-fly-encrypted volume (data storage device). On their website they explain &#8216;On-the-fly encryption&#8217; as an [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_579" class="wp-caption aligncenter" style="width: 310px"><a href="http://blog.creativeitp.com/wp-content/uploads/2011/11/TrueCrypt.jpg"><img src="http://blog.creativeitp.com/wp-content/uploads/2011/11/TrueCrypt-300x220.jpg" alt="" title="TrueCrypt" width="300" height="220" class="size-medium wp-image-579" /></a><p class="wp-caption-text">TrueCrypt</p></div>
<p><a href="http://www.truecrypt.org" title="TrueCrypt website" target="_blank">TrueCrypt</a> is a powerful yet free Open-Source disk encryption Software. I am quite satisfied with the software that I decided to introduce it here in my blog, may all future releases remain free to use!</p>
<p>With TrueCrypt you can maintain an on-the-fly-encrypted volume (data storage device). On their website they explain &#8216;On-the-fly encryption&#8217; as an automatic continuing encryption process to data right before it is saved and decrypted right after it is loaded. In simple words, you will end up having an encrypted volume to secure all your sensitive data inside. This volume can be mounted and accesses like any regular folder in your system each time you provide the right password and then dismounted to prevent access.</p>
<p>What I personally think makes this software special is the ease of using encrypted files right from the secured volume to the computer&#8217;s RAM. As such, if you have a video file, you will not wait until it is fully decrypted to play it, instead the stream will be decrypted right into the RAM while playing, the performance and speed is quite similar to playing any regular video file you have on your system. Brilliant, isn&#8217;t it?<br />
<span id="more-578"></span><br />
Similarly, files can be copied to and from a mounted TrueCrypt volume just like they are copied to/from any normal disk (drag-and-drop). Files are automatically being decrypted on the fly (in memory/RAM) while they are being read or copied from an encrypted TrueCrypt volume. </p>
<p>TrueCrypt &#8216;never saves any decrypted data to a disk – it only stores them temporarily in RAM (memory)&#8217;. In addition, it supports &#8216;hidden volumes&#8217;, which means that you may easily hide an encrypted volume inside an another encrypted volume without showing any evidence of its existence to other users of the system. This is a very important feature in case someone forces you to decrypt your sensitive data. (check TrueCrypt documentation for more information about hidden volumes).</p>
<p>To install and use in Linux, download the appropriate package from their website: <a href="http://www.truecrypt.org" title="TrueCrypt website" target="_blank">www.truecrypt.org</a>. </p>
<p>Since windows installation is wizard-based, I will leave that and cover the Linux installation procedure. First, download the Console-only version, in my case the file is called: <b>truecrypt-7.1-linux-console-x86.tar.gz</b> and was downloaded from the internet to: <strong>/home/haider/Downloads</strong>. Lets move it to the <b>/usr/local/bin</b> directory</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mv</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>haider<span style="color: #000000; font-weight: bold;">/</span>Downloads<span style="color: #000000; font-weight: bold;">/</span>truecrypt-<span style="color: #000000;">7.1</span>-linux-console-x86.tar.gz <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>bin</pre></div></div>

<p>Then navigate to where it was moved and extract the file</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>bin
<span style="color: #c20cb9; font-weight: bold;">tar</span> xfzv truecrypt-<span style="color: #000000;">7.1</span>-linux-console-x86.tar.gz</pre></div></div>

<p>This should produce the bin file to be excuted: <strong>truecrypt-7.1-setup-console-x86</strong>. Good! lets now delete the archive file since we do not need it any more.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">rm</span> truecrypt-<span style="color: #000000;">7.1</span>-linux-console-x86.tar.gz</pre></div></div>

<p>Now, change the file&#8217;s permissions to 755</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #000000;">755</span> truecrypt-<span style="color: #000000;">7.1</span>-setup-console-x86</pre></div></div>

<p>Install using the following command and accept the terms of use (select option 1 to install)</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">.<span style="color: #000000; font-weight: bold;">/</span>truecrypt-<span style="color: #000000;">7.1</span>-setup-console-x86</pre></div></div>

<p>After a successful installation, you may display all the software&#8217;s arguments and options with</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">truecrypt <span style="color: #660033;">-help</span></pre></div></div>

<p>Further, lets create an encrypted volume. To do that use <strong>truecrypt -c</strong>.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">truecrypt <span style="color: #660033;">-c</span></pre></div></div>

<p>Check out the following example from my Linux box:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">Volume <span style="color: #7a0874; font-weight: bold;">type</span>:
 <span style="color: #000000;">1</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> Normal
 <span style="color: #000000;">2</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> Hidden
Select <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">1</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>: <span style="color: #000000;">1</span>
&nbsp;
Enter volume path: <span style="color: #000000; font-weight: bold;">/</span>root<span style="color: #000000; font-weight: bold;">/</span>my-crypt
&nbsp;
Enter volume <span style="color: #c20cb9; font-weight: bold;">size</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>sizeK<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">size</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>M<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #000000; font-weight: bold;">/</span>sizeG<span style="color: #7a0874; font-weight: bold;">&#41;</span>: 500m
&nbsp;
Encryption algorithm:
 <span style="color: #000000;">1</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> AES
 <span style="color: #000000;">2</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> Serpent
 <span style="color: #000000;">3</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> Twofish
 <span style="color: #000000;">4</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> AES-Twofish
 <span style="color: #000000;">5</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> AES-Twofish-Serpent
 <span style="color: #000000;">6</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> Serpent-AES
 <span style="color: #000000;">7</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> Serpent-Twofish-AES
 <span style="color: #000000;">8</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> Twofish-Serpent
Select <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">1</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>: <span style="color: #000000;">1</span>
&nbsp;
Hash algorithm:
 <span style="color: #000000;">1</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> RIPEMD-<span style="color: #000000;">160</span>
 <span style="color: #000000;">2</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> SHA-<span style="color: #000000;">512</span>
 <span style="color: #000000;">3</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> Whirlpool
Select <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">1</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>: <span style="color: #000000;">2</span>
&nbsp;
Filesystem:
 <span style="color: #000000;">1</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> None
 <span style="color: #000000;">2</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> FAT
 <span style="color: #000000;">3</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> Linux Ext2
 <span style="color: #000000;">4</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> Linux Ext3
 <span style="color: #000000;">5</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> Linux Ext4
Select <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">2</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>: <span style="color: #000000;">5</span>
&nbsp;
Enter password: 
WARNING: Short passwords are easy to crack using brute force techniques<span style="color: #000000; font-weight: bold;">!</span>
&nbsp;
We recommend choosing a password consisting of <span style="color: #c20cb9; font-weight: bold;">more</span> than <span style="color: #000000;">20</span> characters. Are you sure you want to use a short password? <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #007800;">y</span>=Yes<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">n</span>=No<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>No<span style="color: #7a0874; font-weight: bold;">&#93;</span>: y
&nbsp;
Re-enter password: 
&nbsp;
Enter keyfile path <span style="color: #7a0874; font-weight: bold;">&#91;</span>none<span style="color: #7a0874; font-weight: bold;">&#93;</span>: 
&nbsp;
Please <span style="color: #7a0874; font-weight: bold;">type</span> at least <span style="color: #000000;">320</span> randomly chosen characters and <span style="color: #000000; font-weight: bold;">then</span> press Enter:
Characters remaining: <span style="color: #000000;">259</span>
Characters remaining: <span style="color: #000000;">190</span>
&nbsp;
&nbsp;
Done: <span style="color: #000000;">100.000</span><span style="color: #000000; font-weight: bold;">%</span>  Speed:  <span style="color: #000000;">7.0</span> MB<span style="color: #000000; font-weight: bold;">/</span>s  Left: <span style="color: #000000;">0</span> s          
&nbsp;
The TrueCrypt volume has been successfully created.</pre></div></div>

<p>From above, the volume&#8217;s path is: <strong>/root/my-crypt</strong><br />
Let mount it to a directory called <strong>encrypted-volume</strong> to start encrypting files.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>haider<span style="color: #000000; font-weight: bold;">/</span>encrypted-volume</pre></div></div>

<p>Now lets mount them.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">truecrypt <span style="color: #000000; font-weight: bold;">/</span>root<span style="color: #000000; font-weight: bold;">/</span>my-crypt <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>haider<span style="color: #000000; font-weight: bold;">/</span>encrypted-volume<span style="color: #000000; font-weight: bold;">/</span></pre></div></div>

<p>This will open a gate to the encrypted volume, as such we must provide the correct password:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">Enter password <span style="color: #000000; font-weight: bold;">for</span> <span style="color: #000000; font-weight: bold;">/</span>root<span style="color: #000000; font-weight: bold;">/</span>my-crypt: 
Enter keyfile <span style="color: #7a0874; font-weight: bold;">&#91;</span>none<span style="color: #7a0874; font-weight: bold;">&#93;</span>: 
Protect hidden volume <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000; font-weight: bold;">if</span> any<span style="color: #7a0874; font-weight: bold;">&#41;</span>? <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #007800;">y</span>=Yes<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">n</span>=No<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>No<span style="color: #7a0874; font-weight: bold;">&#93;</span>: n</pre></div></div>

<p>From this point, to encrypt files just move them to the <strong>encrypted-volume</strong> directory. Once finished, demount the two to protect your files:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">truecrypt <span style="color: #660033;">-d</span></pre></div></div>

<p>In the future, if you require access to your encrypted files, or if you want to encrypt more files in that volume. Mount it again. That&#8217;s all! <img src='http://blog.creativeitp.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.creativeitp.com/posts-and-articles/cryptography/truecrypt-a-windowslinux-tool-to-encrypt-volumes-on-the-fly/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Applet implementation to code Caesar&#8217;s substitution cipher</title>
		<link>http://blog.creativeitp.com/posts-and-articles/cryptography/applet-implementation-to-code-caesars-substitution-cipher/</link>
		<comments>http://blog.creativeitp.com/posts-and-articles/cryptography/applet-implementation-to-code-caesars-substitution-cipher/#comments</comments>
		<pubDate>Wed, 16 Mar 2011 01:04:05 +0000</pubDate>
		<dc:creator>Haider al-Khateeb</dc:creator>
				<category><![CDATA[Cryptography]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Substitution Cipher]]></category>
		<category><![CDATA[Symmetric Encryption]]></category>

		<guid isPermaLink="false">http://blog.creativeitp.com/?p=454</guid>
		<description><![CDATA[In cryptography, Caesar cipher is one of the simplest encryption techniques. It is a substitution cipher in which each letter in the plaintext is replaced by a letter after a fixed number of positions down the alphabet. However, this applet shifts each character (letter, number of symbol) after a number of positions down the ASCII [...]]]></description>
			<content:encoded><![CDATA[<p>In cryptography, Caesar cipher is one of the simplest encryption techniques. It is a <i>substitution cipher</i> in which each letter in the plaintext is replaced by a letter after a fixed number of positions down the alphabet. However, this applet shifts each character (letter, number of symbol) after a number of positions down the <a href="http://en.wikipedia.org/wiki/ASCII" target="_blank">ASCII table</a>. Caesar&#8217;s cipher is categorised as a <i>symmetric encryption</i> and the secret key in this case is the number of shifts!</p>
<ul>
<li>To encrypt, select the encode mode, number of shifts and click Run.</ul>
<ul>
<li>You may encode a message multiple times.</ul>
<ul>
<li>To Decrypt, select the <span id="more-454"></span>decode mode and reverse your steps.</ul>
<p>
<div align="center">
<applet code="CaesarCodePackage/CaesarCode.class" archive="http://www.creativeitp.com/labs/caesar/CaesarCode.jar" width="400" height="400"><br />
    <font color=red><b>Cannot run Applet!</b></font><br />
	You do not have Java 2 JDK, Standard Edition v 1.5.0_05 support for APPLET!!<br />
</applet></div>
<p>
<font color=red><strong>IMPORTANT NOTICE:</strong></font> please note that I did not sign this applet so you may not be able to copy/paste text between the applet and your computer. To read more about this issue I posted another blog called: <a href="../java/creating-an-executable-jar-file-for-an-applet/" target="_blank">Creating an executable jar file for an applet</a>.<br />
If you like this piece of software, download the applet to your computer from <a href="http://www.creativeitp.com/labs/caesar/CaesarCode.jar" target="_blank">here</a> (executable jar file). Running the software on your system will solve the copy/paste problem. To successfully execute jar files on your system, you -of course- need to have the Java Runtime Environment (JRE) installed. If you still can not run the jar file, use the &#8216;Open with&#8217; option and select javax.exe (javax.exe is located inside the bin directory of your JRE folder e.g. C:\Program Files\Java\jre6\bin).</p>
<p>Further, here is the source code I developed for this applet for you to check and compile if you are interested. </p>
<p></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
</pre></td><td class="code"><pre class="java" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">/*
 * CaesarCode.java
 *
 * By Haider al-Khateeb (http://blog.creativeitp.com)
 * Created on Mar 14, 2011.
 */</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">package</span> <span style="color: #006699;">CaesarCodePackage</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javax.swing.JOptionPane</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> CaesarCode <span style="color: #000000; font-weight: bold;">extends</span> javax.<span style="color: #006633;">swing</span>.<span style="color: #003399;">JApplet</span> <span style="color: #009900;">&#123;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #003399;">String</span> inputText<span style="color: #339933;">;</span>
	<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000066; font-weight: bold;">char</span> <span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> inputTextChr<span style="color: #339933;">;</span>
	<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000066; font-weight: bold;">int</span> <span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> inputTextInt<span style="color: #339933;">;</span>
	<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000066; font-weight: bold;">char</span> <span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> outputTextChr<span style="color: #339933;">;</span>
	<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #003399;">String</span> intArray <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #003399;">String</span> cipher <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #003399;">String</span> plain <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #003399;">String</span> newLine <span style="color: #339933;">=</span> <span style="color: #003399;">System</span>.<span style="color: #006633;">getProperty</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;line.separator&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
             <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> inputText<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span> inputText<span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">inputText</span> <span style="color: #339933;">=</span> inputText<span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399;">String</span> getinputText<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">return</span> inputText<span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> convertToChar<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
        <span style="color: #009900;">&#123;</span>
		inputTextChr <span style="color: #339933;">=</span> inputText.<span style="color: #006633;">toCharArray</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> convertCharToInt<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
        <span style="color: #009900;">&#123;</span>
		inputTextInt <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #000066; font-weight: bold;">int</span><span style="color: #009900;">&#91;</span>inputTextChr.<span style="color: #006633;">length</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
		<span style="color: #000000; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">int</span> i<span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>i<span style="color: #339933;">&lt;</span>inputTextChr.<span style="color: #006633;">length</span><span style="color: #339933;">;</span>i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span>
                    <span style="color: #009900;">&#123;</span>
			<span style="color: #000066; font-weight: bold;">int</span> inputTextInt2 <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">int</span><span style="color: #009900;">&#41;</span> inputTextChr<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
			inputTextInt<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> inputTextInt2<span style="color: #339933;">;</span>
                    <span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399;">String</span> getIntArray<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">int</span> i<span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>i<span style="color: #339933;">&lt;</span>inputTextInt.<span style="color: #006633;">length</span><span style="color: #339933;">;</span>i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span>
                    <span style="color: #009900;">&#123;</span>
			intArray <span style="color: #339933;">+=</span> inputTextInt<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span> <span style="color: #339933;">+</span> <span style="color: #0000ff;">&quot;, &quot;</span><span style="color: #339933;">;</span>
                    <span style="color: #009900;">&#125;</span>
		<span style="color: #000000; font-weight: bold;">return</span> intArray<span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399;">String</span> encrypt<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">int</span> shift<span style="color: #009900;">&#41;</span>
        <span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">int</span> i<span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>i<span style="color: #339933;">&lt;</span>inputTextInt.<span style="color: #006633;">length</span><span style="color: #339933;">;</span>i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span>
                        <span style="color: #009900;">&#123;</span>
&nbsp;
			<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>inputTextInt<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">+</span>shift<span style="color: #009900;">&#41;</span><span style="color: #339933;">&gt;</span> <span style="color: #cc66cc;">126</span><span style="color: #009900;">&#41;</span>
			<span style="color: #009900;">&#123;</span>
				inputTextInt<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>shift<span style="color: #339933;">-</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">126</span><span style="color: #339933;">-</span>inputTextInt<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">+</span><span style="color: #cc66cc;">31</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
&nbsp;
			<span style="color: #000000; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>	inputTextInt<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span> <span style="color: #339933;">+=</span> shift<span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
&nbsp;
			<span style="color: #009900;">&#125;</span>
		outputTextChr <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #000066; font-weight: bold;">char</span><span style="color: #009900;">&#91;</span>inputTextInt.<span style="color: #006633;">length</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
		<span style="color: #000000; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">int</span> i<span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>i<span style="color: #339933;">&lt;</span>outputTextChr.<span style="color: #006633;">length</span><span style="color: #339933;">;</span>i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
			<span style="color: #000066; font-weight: bold;">char</span> outputTextChr2 <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">char</span><span style="color: #009900;">&#41;</span> inputTextInt<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
			outputTextChr<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> outputTextChr2<span style="color: #339933;">;</span>
                        <span style="color: #009900;">&#125;</span>
		<span style="color: #000000; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">int</span> i<span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>i<span style="color: #339933;">&lt;</span>outputTextChr.<span style="color: #006633;">length</span><span style="color: #339933;">;</span>i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
			cipher <span style="color: #339933;">+=</span> outputTextChr<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
		<span style="color: #000000; font-weight: bold;">return</span> cipher<span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399;">String</span> decrypt<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">int</span> shift<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">int</span> i<span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>i<span style="color: #339933;">&lt;</span>inputTextInt.<span style="color: #006633;">length</span><span style="color: #339933;">;</span>i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span>
                <span style="color: #009900;">&#123;</span>
			<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>inputTextInt<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">-</span>shift<span style="color: #009900;">&#41;</span><span style="color: #339933;">&lt;</span> <span style="color: #cc66cc;">32</span><span style="color: #009900;">&#41;</span>
			<span style="color: #009900;">&#123;</span>
				inputTextInt<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">127</span><span style="color: #339933;">-</span><span style="color: #009900;">&#40;</span>shift<span style="color: #339933;">-</span><span style="color: #009900;">&#40;</span>inputTextInt<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">-</span><span style="color: #cc66cc;">32</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
&nbsp;
			<span style="color: #000000; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span> inputTextInt<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span> <span style="color: #339933;">-=</span> shift<span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>
			<span style="color: #009900;">&#125;</span>
		outputTextChr <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #000066; font-weight: bold;">char</span><span style="color: #009900;">&#91;</span>inputTextInt.<span style="color: #006633;">length</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
		<span style="color: #000000; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">int</span> i<span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>i<span style="color: #339933;">&lt;</span>outputTextChr.<span style="color: #006633;">length</span><span style="color: #339933;">;</span>i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
			<span style="color: #000066; font-weight: bold;">char</span> outputTextChr2 <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">char</span><span style="color: #009900;">&#41;</span> inputTextInt<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
			outputTextChr<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> outputTextChr2<span style="color: #339933;">;</span>
                    <span style="color: #009900;">&#125;</span>
		<span style="color: #000000; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">int</span> i<span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>i<span style="color: #339933;">&lt;</span>outputTextChr.<span style="color: #006633;">length</span><span style="color: #339933;">;</span>i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
			plain <span style="color: #339933;">+=</span> outputTextChr<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
		<span style="color: #000000; font-weight: bold;">return</span> plain<span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
&nbsp;
    <span style="color: #008000; font-style: italic; font-weight: bold;">/** Initializes the applet CaesarCode */</span>
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> init<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">try</span> <span style="color: #009900;">&#123;</span>
            java.<span style="color: #006633;">awt</span>.<span style="color: #003399;">EventQueue</span>.<span style="color: #006633;">invokeAndWait</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">Runnable</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> run<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                    initComponents<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #009900;">&#125;</span>
            <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">catch</span> <span style="color: #009900;">&#40;</span><span style="color: #003399;">Exception</span> ex<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            ex.<span style="color: #006633;">printStackTrace</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #008000; font-style: italic; font-weight: bold;">/** This method is called from within the init() method to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */</span>
    @SuppressWarnings<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;unchecked&quot;</span><span style="color: #009900;">&#41;</span>
    <span style="color: #666666; font-style: italic;">// &lt;editor-fold defaultstate=&quot;collapsed&quot; desc=&quot;Generated Code&quot;&gt;//GEN-BEGIN:initComponents</span>
    <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000066; font-weight: bold;">void</span> initComponents<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
        jPanel1 <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> javax.<span style="color: #006633;">swing</span>.<span style="color: #003399;">JPanel</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        jLabel1 <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> javax.<span style="color: #006633;">swing</span>.<span style="color: #003399;">JLabel</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        jScrollPane1 <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> javax.<span style="color: #006633;">swing</span>.<span style="color: #003399;">JScrollPane</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        jTextArea1 <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> javax.<span style="color: #006633;">swing</span>.<span style="color: #003399;">JTextArea</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        jComboBox1 <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> javax.<span style="color: #006633;">swing</span>.<span style="color: #003399;">JComboBox</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        jLabel2 <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> javax.<span style="color: #006633;">swing</span>.<span style="color: #003399;">JLabel</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        jLabel3 <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> javax.<span style="color: #006633;">swing</span>.<span style="color: #003399;">JLabel</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        jScrollPane2 <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> javax.<span style="color: #006633;">swing</span>.<span style="color: #003399;">JScrollPane</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        jList1 <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> javax.<span style="color: #006633;">swing</span>.<span style="color: #003399;">JList</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        jButton1 <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> javax.<span style="color: #006633;">swing</span>.<span style="color: #003399;">JButton</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        jButton2 <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> javax.<span style="color: #006633;">swing</span>.<span style="color: #003399;">JButton</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        jButton3 <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> javax.<span style="color: #006633;">swing</span>.<span style="color: #003399;">JButton</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        jButton4 <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> javax.<span style="color: #006633;">swing</span>.<span style="color: #003399;">JButton</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        jButton5 <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> javax.<span style="color: #006633;">swing</span>.<span style="color: #003399;">JButton</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        jPanel1.<span style="color: #006633;">setBackground</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> java.<span style="color: #006633;">awt</span>.<span style="color: #003399;">Color</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">102</span>, <span style="color: #cc66cc;">204</span>, <span style="color: #cc66cc;">255</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        jPanel1.<span style="color: #006633;">setBorder</span><span style="color: #009900;">&#40;</span>javax.<span style="color: #006633;">swing</span>.<span style="color: #003399;">BorderFactory</span>.<span style="color: #006633;">createEtchedBorder</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> java.<span style="color: #006633;">awt</span>.<span style="color: #003399;">Color</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">102</span>, <span style="color: #cc66cc;">255</span>, <span style="color: #cc66cc;">255</span><span style="color: #009900;">&#41;</span>, <span style="color: #000066; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        jLabel1.<span style="color: #006633;">setText</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Input your message in the following box&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        jTextArea1.<span style="color: #006633;">setColumns</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">20</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        jTextArea1.<span style="color: #006633;">setLineWrap</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        jTextArea1.<span style="color: #006633;">setRows</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">5</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        jTextArea1.<span style="color: #006633;">setWrapStyleWord</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        jScrollPane1.<span style="color: #006633;">setViewportView</span><span style="color: #009900;">&#40;</span>jTextArea1<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        jComboBox1.<span style="color: #006633;">setModel</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> javax.<span style="color: #006633;">swing</span>.<span style="color: #003399;">DefaultComboBoxModel</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">String</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#123;</span> <span style="color: #0000ff;">&quot;Encode&quot;</span>, <span style="color: #0000ff;">&quot;Decode&quot;</span> <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        jLabel2.<span style="color: #006633;">setText</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Select mode&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        jLabel3.<span style="color: #006633;">setHorizontalAlignment</span><span style="color: #009900;">&#40;</span>javax.<span style="color: #006633;">swing</span>.<span style="color: #003399;">SwingConstants</span>.<span style="color: #006633;">RIGHT</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        jLabel3.<span style="color: #006633;">setText</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Number of shifts&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        jList1.<span style="color: #006633;">setModel</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> javax.<span style="color: #006633;">swing</span>.<span style="color: #003399;">AbstractListModel</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #003399;">String</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> strings <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span> <span style="color: #0000ff;">&quot;01&quot;</span>, <span style="color: #0000ff;">&quot;02&quot;</span>, <span style="color: #0000ff;">&quot;03&quot;</span>, <span style="color: #0000ff;">&quot;04&quot;</span>, <span style="color: #0000ff;">&quot;05&quot;</span>, <span style="color: #0000ff;">&quot;06&quot;</span>, <span style="color: #0000ff;">&quot;07&quot;</span>, <span style="color: #0000ff;">&quot;08&quot;</span>, <span style="color: #0000ff;">&quot;09&quot;</span>, <span style="color: #0000ff;">&quot;10&quot;</span>, <span style="color: #0000ff;">&quot;11&quot;</span>, <span style="color: #0000ff;">&quot;12&quot;</span>, <span style="color: #0000ff;">&quot;13&quot;</span>, <span style="color: #0000ff;">&quot;14&quot;</span>, <span style="color: #0000ff;">&quot;15&quot;</span>, <span style="color: #0000ff;">&quot;16&quot;</span>, <span style="color: #0000ff;">&quot;17&quot;</span>, <span style="color: #0000ff;">&quot;18&quot;</span>, <span style="color: #0000ff;">&quot;19&quot;</span>, <span style="color: #0000ff;">&quot;20&quot;</span>, <span style="color: #0000ff;">&quot;21&quot;</span>, <span style="color: #0000ff;">&quot;22&quot;</span>, <span style="color: #0000ff;">&quot;23&quot;</span>, <span style="color: #0000ff;">&quot;24&quot;</span>, <span style="color: #0000ff;">&quot;25&quot;</span>, <span style="color: #0000ff;">&quot;26&quot;</span>, <span style="color: #0000ff;">&quot;27&quot;</span>, <span style="color: #0000ff;">&quot;28&quot;</span>, <span style="color: #0000ff;">&quot;29&quot;</span>, <span style="color: #0000ff;">&quot;30&quot;</span>, <span style="color: #0000ff;">&quot;31&quot;</span>, <span style="color: #0000ff;">&quot;32&quot;</span>, <span style="color: #0000ff;">&quot;33&quot;</span>, <span style="color: #0000ff;">&quot;34&quot;</span>, <span style="color: #0000ff;">&quot;35&quot;</span>, <span style="color: #0000ff;">&quot;36&quot;</span>, <span style="color: #0000ff;">&quot;37&quot;</span>, <span style="color: #0000ff;">&quot;38&quot;</span>, <span style="color: #0000ff;">&quot;39&quot;</span>, <span style="color: #0000ff;">&quot;40&quot;</span>, <span style="color: #0000ff;">&quot;41&quot;</span>, <span style="color: #0000ff;">&quot;42&quot;</span>, <span style="color: #0000ff;">&quot;43&quot;</span>, <span style="color: #0000ff;">&quot;44&quot;</span>, <span style="color: #0000ff;">&quot;45&quot;</span>, <span style="color: #0000ff;">&quot;46&quot;</span>, <span style="color: #0000ff;">&quot;47&quot;</span>, <span style="color: #0000ff;">&quot;48&quot;</span>, <span style="color: #0000ff;">&quot;49&quot;</span>, <span style="color: #0000ff;">&quot;50&quot;</span> <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
            <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">int</span> getSize<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #000000; font-weight: bold;">return</span> strings.<span style="color: #006633;">length</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>
            <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399;">Object</span> getElementAt<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">int</span> i<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #000000; font-weight: bold;">return</span> strings<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>
        <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        jList1.<span style="color: #006633;">setSelectionMode</span><span style="color: #009900;">&#40;</span>javax.<span style="color: #006633;">swing</span>.<span style="color: #003399;">ListSelectionModel</span>.<span style="color: #006633;">SINGLE_SELECTION</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        jList1.<span style="color: #006633;">setVisibleRowCount</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">3</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        jScrollPane2.<span style="color: #006633;">setViewportView</span><span style="color: #009900;">&#40;</span>jList1<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        jButton1.<span style="color: #006633;">setText</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Run&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        jButton1.<span style="color: #006633;">addActionListener</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> java.<span style="color: #006633;">awt</span>.<span style="color: #006633;">event</span>.<span style="color: #003399;">ActionListener</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> actionPerformed<span style="color: #009900;">&#40;</span>java.<span style="color: #006633;">awt</span>.<span style="color: #006633;">event</span>.<span style="color: #003399;">ActionEvent</span> evt<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                jButton1ActionPerformed<span style="color: #009900;">&#40;</span>evt<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
        <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        jButton2.<span style="color: #006633;">setText</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Help?&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        jButton2.<span style="color: #006633;">addActionListener</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> java.<span style="color: #006633;">awt</span>.<span style="color: #006633;">event</span>.<span style="color: #003399;">ActionListener</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> actionPerformed<span style="color: #009900;">&#40;</span>java.<span style="color: #006633;">awt</span>.<span style="color: #006633;">event</span>.<span style="color: #003399;">ActionEvent</span> evt<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                jButton2ActionPerformed<span style="color: #009900;">&#40;</span>evt<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
        <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        jButton3.<span style="color: #006633;">setText</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Copy&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        jButton3.<span style="color: #006633;">addActionListener</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> java.<span style="color: #006633;">awt</span>.<span style="color: #006633;">event</span>.<span style="color: #003399;">ActionListener</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> actionPerformed<span style="color: #009900;">&#40;</span>java.<span style="color: #006633;">awt</span>.<span style="color: #006633;">event</span>.<span style="color: #003399;">ActionEvent</span> evt<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                jButton3ActionPerformed<span style="color: #009900;">&#40;</span>evt<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
        <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        jButton4.<span style="color: #006633;">setText</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Paste&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        jButton4.<span style="color: #006633;">addActionListener</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> java.<span style="color: #006633;">awt</span>.<span style="color: #006633;">event</span>.<span style="color: #003399;">ActionListener</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> actionPerformed<span style="color: #009900;">&#40;</span>java.<span style="color: #006633;">awt</span>.<span style="color: #006633;">event</span>.<span style="color: #003399;">ActionEvent</span> evt<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                jButton4ActionPerformed<span style="color: #009900;">&#40;</span>evt<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
        <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        jButton5.<span style="color: #006633;">setText</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Select All&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        jButton5.<span style="color: #006633;">addActionListener</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> java.<span style="color: #006633;">awt</span>.<span style="color: #006633;">event</span>.<span style="color: #003399;">ActionListener</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> actionPerformed<span style="color: #009900;">&#40;</span>java.<span style="color: #006633;">awt</span>.<span style="color: #006633;">event</span>.<span style="color: #003399;">ActionEvent</span> evt<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                jButton5ActionPerformed<span style="color: #009900;">&#40;</span>evt<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
        <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        javax.<span style="color: #006633;">swing</span>.<span style="color: #006633;">GroupLayout</span> jPanel1Layout <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> javax.<span style="color: #006633;">swing</span>.<span style="color: #006633;">GroupLayout</span><span style="color: #009900;">&#40;</span>jPanel1<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        jPanel1.<span style="color: #006633;">setLayout</span><span style="color: #009900;">&#40;</span>jPanel1Layout<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        jPanel1Layout.<span style="color: #006633;">setHorizontalGroup</span><span style="color: #009900;">&#40;</span>
            jPanel1Layout.<span style="color: #006633;">createParallelGroup</span><span style="color: #009900;">&#40;</span>javax.<span style="color: #006633;">swing</span>.<span style="color: #006633;">GroupLayout</span>.<span style="color: #006633;">Alignment</span>.<span style="color: #006633;">LEADING</span><span style="color: #009900;">&#41;</span>
            .<span style="color: #006633;">addGroup</span><span style="color: #009900;">&#40;</span>jPanel1Layout.<span style="color: #006633;">createSequentialGroup</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
                .<span style="color: #006633;">addGap</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">19</span>, <span style="color: #cc66cc;">19</span>, <span style="color: #cc66cc;">19</span><span style="color: #009900;">&#41;</span>
                .<span style="color: #006633;">addGroup</span><span style="color: #009900;">&#40;</span>jPanel1Layout.<span style="color: #006633;">createParallelGroup</span><span style="color: #009900;">&#40;</span>javax.<span style="color: #006633;">swing</span>.<span style="color: #006633;">GroupLayout</span>.<span style="color: #006633;">Alignment</span>.<span style="color: #006633;">LEADING</span><span style="color: #009900;">&#41;</span>
                    .<span style="color: #006633;">addGroup</span><span style="color: #009900;">&#40;</span>jPanel1Layout.<span style="color: #006633;">createSequentialGroup</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
                        .<span style="color: #006633;">addComponent</span><span style="color: #009900;">&#40;</span>jButton2<span style="color: #009900;">&#41;</span>
                        .<span style="color: #006633;">addGap</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">57</span>, <span style="color: #cc66cc;">57</span>, <span style="color: #cc66cc;">57</span><span style="color: #009900;">&#41;</span>
                        .<span style="color: #006633;">addComponent</span><span style="color: #009900;">&#40;</span>jScrollPane2, javax.<span style="color: #006633;">swing</span>.<span style="color: #006633;">GroupLayout</span>.<span style="color: #006633;">PREFERRED_SIZE</span>, <span style="color: #cc66cc;">58</span>, javax.<span style="color: #006633;">swing</span>.<span style="color: #006633;">GroupLayout</span>.<span style="color: #006633;">PREFERRED_SIZE</span><span style="color: #009900;">&#41;</span>
                        .<span style="color: #006633;">addGap</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">29</span>, <span style="color: #cc66cc;">29</span>, <span style="color: #cc66cc;">29</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
                    .<span style="color: #006633;">addComponent</span><span style="color: #009900;">&#40;</span>jScrollPane1, javax.<span style="color: #006633;">swing</span>.<span style="color: #006633;">GroupLayout</span>.<span style="color: #006633;">Alignment</span>.<span style="color: #006633;">TRAILING</span>, javax.<span style="color: #006633;">swing</span>.<span style="color: #006633;">GroupLayout</span>.<span style="color: #006633;">DEFAULT_SIZE</span>, <span style="color: #cc66cc;">348</span>, <span style="color: #003399;">Short</span>.<span style="color: #006633;">MAX_VALUE</span><span style="color: #009900;">&#41;</span>
                    .<span style="color: #006633;">addGroup</span><span style="color: #009900;">&#40;</span>javax.<span style="color: #006633;">swing</span>.<span style="color: #006633;">GroupLayout</span>.<span style="color: #006633;">Alignment</span>.<span style="color: #006633;">TRAILING</span>, jPanel1Layout.<span style="color: #006633;">createSequentialGroup</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
                        .<span style="color: #006633;">addComponent</span><span style="color: #009900;">&#40;</span>jButton1, javax.<span style="color: #006633;">swing</span>.<span style="color: #006633;">GroupLayout</span>.<span style="color: #006633;">PREFERRED_SIZE</span>, <span style="color: #cc66cc;">87</span>, javax.<span style="color: #006633;">swing</span>.<span style="color: #006633;">GroupLayout</span>.<span style="color: #006633;">PREFERRED_SIZE</span><span style="color: #009900;">&#41;</span>
                        .<span style="color: #006633;">addGap</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">8</span>, <span style="color: #cc66cc;">8</span>, <span style="color: #cc66cc;">8</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
                    .<span style="color: #006633;">addGroup</span><span style="color: #009900;">&#40;</span>jPanel1Layout.<span style="color: #006633;">createSequentialGroup</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
                        .<span style="color: #006633;">addGap</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">12</span>, <span style="color: #cc66cc;">12</span>, <span style="color: #cc66cc;">12</span><span style="color: #009900;">&#41;</span>
                        .<span style="color: #006633;">addGroup</span><span style="color: #009900;">&#40;</span>jPanel1Layout.<span style="color: #006633;">createParallelGroup</span><span style="color: #009900;">&#40;</span>javax.<span style="color: #006633;">swing</span>.<span style="color: #006633;">GroupLayout</span>.<span style="color: #006633;">Alignment</span>.<span style="color: #006633;">LEADING</span>, <span style="color: #000066; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span>
                            .<span style="color: #006633;">addGroup</span><span style="color: #009900;">&#40;</span>jPanel1Layout.<span style="color: #006633;">createSequentialGroup</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
                                .<span style="color: #006633;">addComponent</span><span style="color: #009900;">&#40;</span>jButton3<span style="color: #009900;">&#41;</span>
                                .<span style="color: #006633;">addPreferredGap</span><span style="color: #009900;">&#40;</span>javax.<span style="color: #006633;">swing</span>.<span style="color: #006633;">LayoutStyle</span>.<span style="color: #006633;">ComponentPlacement</span>.<span style="color: #006633;">RELATED</span><span style="color: #009900;">&#41;</span>
                                .<span style="color: #006633;">addComponent</span><span style="color: #009900;">&#40;</span>jButton4<span style="color: #009900;">&#41;</span>
                                .<span style="color: #006633;">addPreferredGap</span><span style="color: #009900;">&#40;</span>javax.<span style="color: #006633;">swing</span>.<span style="color: #006633;">LayoutStyle</span>.<span style="color: #006633;">ComponentPlacement</span>.<span style="color: #006633;">RELATED</span><span style="color: #009900;">&#41;</span>
                                .<span style="color: #006633;">addComponent</span><span style="color: #009900;">&#40;</span>jButton5<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
                            .<span style="color: #006633;">addComponent</span><span style="color: #009900;">&#40;</span>jLabel1, javax.<span style="color: #006633;">swing</span>.<span style="color: #006633;">GroupLayout</span>.<span style="color: #006633;">PREFERRED_SIZE</span>, <span style="color: #cc66cc;">278</span>, javax.<span style="color: #006633;">swing</span>.<span style="color: #006633;">GroupLayout</span>.<span style="color: #006633;">PREFERRED_SIZE</span><span style="color: #009900;">&#41;</span>
                            .<span style="color: #006633;">addGroup</span><span style="color: #009900;">&#40;</span>javax.<span style="color: #006633;">swing</span>.<span style="color: #006633;">GroupLayout</span>.<span style="color: #006633;">Alignment</span>.<span style="color: #006633;">TRAILING</span>, jPanel1Layout.<span style="color: #006633;">createSequentialGroup</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
                                .<span style="color: #006633;">addGap</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">74</span>, <span style="color: #cc66cc;">74</span>, <span style="color: #cc66cc;">74</span><span style="color: #009900;">&#41;</span>
                                .<span style="color: #006633;">addComponent</span><span style="color: #009900;">&#40;</span>jLabel3, javax.<span style="color: #006633;">swing</span>.<span style="color: #006633;">GroupLayout</span>.<span style="color: #006633;">DEFAULT_SIZE</span>, javax.<span style="color: #006633;">swing</span>.<span style="color: #006633;">GroupLayout</span>.<span style="color: #006633;">DEFAULT_SIZE</span>, <span style="color: #003399;">Short</span>.<span style="color: #006633;">MAX_VALUE</span><span style="color: #009900;">&#41;</span>
                                .<span style="color: #006633;">addGap</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">45</span>, <span style="color: #cc66cc;">45</span>, <span style="color: #cc66cc;">45</span><span style="color: #009900;">&#41;</span>
                                .<span style="color: #006633;">addGroup</span><span style="color: #009900;">&#40;</span>jPanel1Layout.<span style="color: #006633;">createParallelGroup</span><span style="color: #009900;">&#40;</span>javax.<span style="color: #006633;">swing</span>.<span style="color: #006633;">GroupLayout</span>.<span style="color: #006633;">Alignment</span>.<span style="color: #006633;">LEADING</span><span style="color: #009900;">&#41;</span>
                                    .<span style="color: #006633;">addComponent</span><span style="color: #009900;">&#40;</span>jComboBox1, javax.<span style="color: #006633;">swing</span>.<span style="color: #006633;">GroupLayout</span>.<span style="color: #006633;">PREFERRED_SIZE</span>, javax.<span style="color: #006633;">swing</span>.<span style="color: #006633;">GroupLayout</span>.<span style="color: #006633;">DEFAULT_SIZE</span>, javax.<span style="color: #006633;">swing</span>.<span style="color: #006633;">GroupLayout</span>.<span style="color: #006633;">PREFERRED_SIZE</span><span style="color: #009900;">&#41;</span>
                                    .<span style="color: #006633;">addComponent</span><span style="color: #009900;">&#40;</span>jLabel2, javax.<span style="color: #006633;">swing</span>.<span style="color: #006633;">GroupLayout</span>.<span style="color: #006633;">PREFERRED_SIZE</span>, <span style="color: #cc66cc;">71</span>, javax.<span style="color: #006633;">swing</span>.<span style="color: #006633;">GroupLayout</span>.<span style="color: #006633;">PREFERRED_SIZE</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
                        .<span style="color: #006633;">addGap</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">58</span>, <span style="color: #cc66cc;">58</span>, <span style="color: #cc66cc;">58</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
                .<span style="color: #006633;">addGap</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">27</span>, <span style="color: #cc66cc;">27</span>, <span style="color: #cc66cc;">27</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
        <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        jPanel1Layout.<span style="color: #006633;">setVerticalGroup</span><span style="color: #009900;">&#40;</span>
            jPanel1Layout.<span style="color: #006633;">createParallelGroup</span><span style="color: #009900;">&#40;</span>javax.<span style="color: #006633;">swing</span>.<span style="color: #006633;">GroupLayout</span>.<span style="color: #006633;">Alignment</span>.<span style="color: #006633;">LEADING</span><span style="color: #009900;">&#41;</span>
            .<span style="color: #006633;">addGroup</span><span style="color: #009900;">&#40;</span>jPanel1Layout.<span style="color: #006633;">createSequentialGroup</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
                .<span style="color: #006633;">addContainerGap</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
                .<span style="color: #006633;">addGroup</span><span style="color: #009900;">&#40;</span>jPanel1Layout.<span style="color: #006633;">createParallelGroup</span><span style="color: #009900;">&#40;</span>javax.<span style="color: #006633;">swing</span>.<span style="color: #006633;">GroupLayout</span>.<span style="color: #006633;">Alignment</span>.<span style="color: #006633;">BASELINE</span><span style="color: #009900;">&#41;</span>
                    .<span style="color: #006633;">addComponent</span><span style="color: #009900;">&#40;</span>jLabel2, javax.<span style="color: #006633;">swing</span>.<span style="color: #006633;">GroupLayout</span>.<span style="color: #006633;">DEFAULT_SIZE</span>, javax.<span style="color: #006633;">swing</span>.<span style="color: #006633;">GroupLayout</span>.<span style="color: #006633;">DEFAULT_SIZE</span>, <span style="color: #003399;">Short</span>.<span style="color: #006633;">MAX_VALUE</span><span style="color: #009900;">&#41;</span>
                    .<span style="color: #006633;">addComponent</span><span style="color: #009900;">&#40;</span>jLabel3<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
                .<span style="color: #006633;">addPreferredGap</span><span style="color: #009900;">&#40;</span>javax.<span style="color: #006633;">swing</span>.<span style="color: #006633;">LayoutStyle</span>.<span style="color: #006633;">ComponentPlacement</span>.<span style="color: #006633;">RELATED</span><span style="color: #009900;">&#41;</span>
                .<span style="color: #006633;">addGroup</span><span style="color: #009900;">&#40;</span>jPanel1Layout.<span style="color: #006633;">createParallelGroup</span><span style="color: #009900;">&#40;</span>javax.<span style="color: #006633;">swing</span>.<span style="color: #006633;">GroupLayout</span>.<span style="color: #006633;">Alignment</span>.<span style="color: #006633;">LEADING</span><span style="color: #009900;">&#41;</span>
                    .<span style="color: #006633;">addComponent</span><span style="color: #009900;">&#40;</span>jButton2<span style="color: #009900;">&#41;</span>
                    .<span style="color: #006633;">addComponent</span><span style="color: #009900;">&#40;</span>jScrollPane2, javax.<span style="color: #006633;">swing</span>.<span style="color: #006633;">GroupLayout</span>.<span style="color: #006633;">PREFERRED_SIZE</span>, javax.<span style="color: #006633;">swing</span>.<span style="color: #006633;">GroupLayout</span>.<span style="color: #006633;">DEFAULT_SIZE</span>, javax.<span style="color: #006633;">swing</span>.<span style="color: #006633;">GroupLayout</span>.<span style="color: #006633;">PREFERRED_SIZE</span><span style="color: #009900;">&#41;</span>
                    .<span style="color: #006633;">addComponent</span><span style="color: #009900;">&#40;</span>jComboBox1, javax.<span style="color: #006633;">swing</span>.<span style="color: #006633;">GroupLayout</span>.<span style="color: #006633;">PREFERRED_SIZE</span>, javax.<span style="color: #006633;">swing</span>.<span style="color: #006633;">GroupLayout</span>.<span style="color: #006633;">DEFAULT_SIZE</span>, javax.<span style="color: #006633;">swing</span>.<span style="color: #006633;">GroupLayout</span>.<span style="color: #006633;">PREFERRED_SIZE</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
                .<span style="color: #006633;">addGap</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">16</span>, <span style="color: #cc66cc;">16</span>, <span style="color: #cc66cc;">16</span><span style="color: #009900;">&#41;</span>
                .<span style="color: #006633;">addComponent</span><span style="color: #009900;">&#40;</span>jLabel1<span style="color: #009900;">&#41;</span>
                .<span style="color: #006633;">addPreferredGap</span><span style="color: #009900;">&#40;</span>javax.<span style="color: #006633;">swing</span>.<span style="color: #006633;">LayoutStyle</span>.<span style="color: #006633;">ComponentPlacement</span>.<span style="color: #006633;">RELATED</span><span style="color: #009900;">&#41;</span>
                .<span style="color: #006633;">addGroup</span><span style="color: #009900;">&#40;</span>jPanel1Layout.<span style="color: #006633;">createParallelGroup</span><span style="color: #009900;">&#40;</span>javax.<span style="color: #006633;">swing</span>.<span style="color: #006633;">GroupLayout</span>.<span style="color: #006633;">Alignment</span>.<span style="color: #006633;">BASELINE</span><span style="color: #009900;">&#41;</span>
                    .<span style="color: #006633;">addComponent</span><span style="color: #009900;">&#40;</span>jButton3, javax.<span style="color: #006633;">swing</span>.<span style="color: #006633;">GroupLayout</span>.<span style="color: #006633;">DEFAULT_SIZE</span>, javax.<span style="color: #006633;">swing</span>.<span style="color: #006633;">GroupLayout</span>.<span style="color: #006633;">DEFAULT_SIZE</span>, <span style="color: #003399;">Short</span>.<span style="color: #006633;">MAX_VALUE</span><span style="color: #009900;">&#41;</span>
                    .<span style="color: #006633;">addComponent</span><span style="color: #009900;">&#40;</span>jButton4, javax.<span style="color: #006633;">swing</span>.<span style="color: #006633;">GroupLayout</span>.<span style="color: #006633;">DEFAULT_SIZE</span>, javax.<span style="color: #006633;">swing</span>.<span style="color: #006633;">GroupLayout</span>.<span style="color: #006633;">DEFAULT_SIZE</span>, <span style="color: #003399;">Short</span>.<span style="color: #006633;">MAX_VALUE</span><span style="color: #009900;">&#41;</span>
                    .<span style="color: #006633;">addComponent</span><span style="color: #009900;">&#40;</span>jButton5, javax.<span style="color: #006633;">swing</span>.<span style="color: #006633;">GroupLayout</span>.<span style="color: #006633;">DEFAULT_SIZE</span>, javax.<span style="color: #006633;">swing</span>.<span style="color: #006633;">GroupLayout</span>.<span style="color: #006633;">DEFAULT_SIZE</span>, <span style="color: #003399;">Short</span>.<span style="color: #006633;">MAX_VALUE</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
                .<span style="color: #006633;">addPreferredGap</span><span style="color: #009900;">&#40;</span>javax.<span style="color: #006633;">swing</span>.<span style="color: #006633;">LayoutStyle</span>.<span style="color: #006633;">ComponentPlacement</span>.<span style="color: #006633;">RELATED</span><span style="color: #009900;">&#41;</span>
                .<span style="color: #006633;">addComponent</span><span style="color: #009900;">&#40;</span>jScrollPane1, javax.<span style="color: #006633;">swing</span>.<span style="color: #006633;">GroupLayout</span>.<span style="color: #006633;">PREFERRED_SIZE</span>, <span style="color: #cc66cc;">188</span>, javax.<span style="color: #006633;">swing</span>.<span style="color: #006633;">GroupLayout</span>.<span style="color: #006633;">PREFERRED_SIZE</span><span style="color: #009900;">&#41;</span>
                .<span style="color: #006633;">addPreferredGap</span><span style="color: #009900;">&#40;</span>javax.<span style="color: #006633;">swing</span>.<span style="color: #006633;">LayoutStyle</span>.<span style="color: #006633;">ComponentPlacement</span>.<span style="color: #006633;">RELATED</span><span style="color: #009900;">&#41;</span>
                .<span style="color: #006633;">addComponent</span><span style="color: #009900;">&#40;</span>jButton1<span style="color: #009900;">&#41;</span>
                .<span style="color: #006633;">addContainerGap</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
        <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        javax.<span style="color: #006633;">swing</span>.<span style="color: #006633;">GroupLayout</span> layout <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> javax.<span style="color: #006633;">swing</span>.<span style="color: #006633;">GroupLayout</span><span style="color: #009900;">&#40;</span>getContentPane<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        getContentPane<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">setLayout</span><span style="color: #009900;">&#40;</span>layout<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        layout.<span style="color: #006633;">setHorizontalGroup</span><span style="color: #009900;">&#40;</span>
            layout.<span style="color: #006633;">createParallelGroup</span><span style="color: #009900;">&#40;</span>javax.<span style="color: #006633;">swing</span>.<span style="color: #006633;">GroupLayout</span>.<span style="color: #006633;">Alignment</span>.<span style="color: #006633;">LEADING</span><span style="color: #009900;">&#41;</span>
            .<span style="color: #006633;">addComponent</span><span style="color: #009900;">&#40;</span>jPanel1, javax.<span style="color: #006633;">swing</span>.<span style="color: #006633;">GroupLayout</span>.<span style="color: #006633;">DEFAULT_SIZE</span>, javax.<span style="color: #006633;">swing</span>.<span style="color: #006633;">GroupLayout</span>.<span style="color: #006633;">DEFAULT_SIZE</span>, <span style="color: #003399;">Short</span>.<span style="color: #006633;">MAX_VALUE</span><span style="color: #009900;">&#41;</span>
        <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        layout.<span style="color: #006633;">setVerticalGroup</span><span style="color: #009900;">&#40;</span>
            layout.<span style="color: #006633;">createParallelGroup</span><span style="color: #009900;">&#40;</span>javax.<span style="color: #006633;">swing</span>.<span style="color: #006633;">GroupLayout</span>.<span style="color: #006633;">Alignment</span>.<span style="color: #006633;">LEADING</span><span style="color: #009900;">&#41;</span>
            .<span style="color: #006633;">addComponent</span><span style="color: #009900;">&#40;</span>jPanel1, javax.<span style="color: #006633;">swing</span>.<span style="color: #006633;">GroupLayout</span>.<span style="color: #006633;">DEFAULT_SIZE</span>, javax.<span style="color: #006633;">swing</span>.<span style="color: #006633;">GroupLayout</span>.<span style="color: #006633;">DEFAULT_SIZE</span>, <span style="color: #003399;">Short</span>.<span style="color: #006633;">MAX_VALUE</span><span style="color: #009900;">&#41;</span>
        <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #666666; font-style: italic;">// &lt;/editor-fold&gt;//GEN-END:initComponents</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000066; font-weight: bold;">void</span> jButton1ActionPerformed<span style="color: #009900;">&#40;</span>java.<span style="color: #006633;">awt</span>.<span style="color: #006633;">event</span>.<span style="color: #003399;">ActionEvent</span> evt<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><span style="color: #666666; font-style: italic;">//GEN-FIRST:event_jButton1ActionPerformed</span>
        <span style="color: #666666; font-style: italic;">// TODO add your handling code here:</span>
          <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>jList1.<span style="color: #006633;">getSelectedIndex</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&gt;</span> <span style="color: #339933;">-</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span>
             <span style="color: #009900;">&#123;</span>
		CaesarCode msg <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> CaesarCode<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		msg.<span style="color: #006633;">inputText</span><span style="color: #009900;">&#40;</span>jTextArea1.<span style="color: #006633;">getText</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		msg.<span style="color: #006633;">convertToChar</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//convert plain text string to char data type</span>
		msg.<span style="color: #006633;">convertCharToInt</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// convert char to their equivalent integer (decimal number) in the ASCCI table</span>
		<span style="color: #666666; font-style: italic;">//msg.getIntArray(); // show decimal numbers of the inputText</span>
		<span style="color: #000066; font-weight: bold;">int</span> shift <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span> <span style="color: #339933;">+</span> jList1.<span style="color: #006633;">getSelectedIndex</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			  <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>jComboBox1.<span style="color: #006633;">getSelectedItem</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">&quot;Encode&quot;</span><span style="color: #009900;">&#41;</span>
			  <span style="color: #009900;">&#123;</span>
                                jTextArea1.<span style="color: #006633;">setText</span><span style="color: #009900;">&#40;</span>msg.<span style="color: #006633;">encrypt</span><span style="color: #009900;">&#40;</span>shift<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                                <span style="color: #666666; font-style: italic;">//  msg.encrypt(shift) = encrypt and output cipher</span>
			  <span style="color: #009900;">&#125;</span>
			   <span style="color: #000000; font-weight: bold;">else</span>
			  <span style="color: #009900;">&#123;</span>
				jTextArea1.<span style="color: #006633;">setText</span><span style="color: #009900;">&#40;</span>msg.<span style="color: #006633;">decrypt</span><span style="color: #009900;">&#40;</span>shift<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                                  <span style="color: #666666; font-style: italic;">//  msg.encrypt(shift) = decrypt and output cipher</span>
			  <span style="color: #009900;">&#125;</span>
		<span style="color: #009900;">&#125;</span>
		<span style="color: #000000; font-weight: bold;">else</span>
                <span style="color: #009900;">&#123;</span>
                    <span style="color: #003399;">JOptionPane</span>.<span style="color: #006633;">showMessageDialog</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">null</span>, <span style="color: #0000ff;">&quot;Please select a number of shifts first!&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		 <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #666666; font-style: italic;">//GEN-LAST:event_jButton1ActionPerformed</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000066; font-weight: bold;">void</span> jButton2ActionPerformed<span style="color: #009900;">&#40;</span>java.<span style="color: #006633;">awt</span>.<span style="color: #006633;">event</span>.<span style="color: #003399;">ActionEvent</span> evt<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><span style="color: #666666; font-style: italic;">//GEN-FIRST:event_jButton2ActionPerformed</span>
        <span style="color: #666666; font-style: italic;">// TODO add your handling code here:</span>
        <span style="color: #003399;">JOptionPane</span>.<span style="color: #006633;">showMessageDialog</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">null</span>, <span style="color: #0000ff;">&quot;To encrypt, select the encode mode, the number of shifts and click ‘Run’.&quot;</span> <span style="color: #339933;">+</span> newLine <span style="color: #339933;">+</span>
                                            <span style="color: #0000ff;">&quot;You may encode the same message multiple times.&quot;</span> <span style="color: #339933;">+</span> newLine <span style="color: #339933;">+</span>
                                            <span style="color: #0000ff;">&quot;To Decrypt, select the decode mode and reverse your encryption steps.&quot;</span> <span style="color: #339933;">+</span> newLine <span style="color: #339933;">+</span> newLine <span style="color: #339933;">+</span>
                                            <span style="color: #0000ff;">&quot;By Haider al-Khateeb (http://blog.creativeitp.com)&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #666666; font-style: italic;">//GEN-LAST:event_jButton2ActionPerformed</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000066; font-weight: bold;">void</span> jButton3ActionPerformed<span style="color: #009900;">&#40;</span>java.<span style="color: #006633;">awt</span>.<span style="color: #006633;">event</span>.<span style="color: #003399;">ActionEvent</span> evt<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><span style="color: #666666; font-style: italic;">//GEN-FIRST:event_jButton3ActionPerformed</span>
        <span style="color: #666666; font-style: italic;">// TODO add your handling code here:</span>
        jTextArea1.<span style="color: #006633;">copy</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #666666; font-style: italic;">//GEN-LAST:event_jButton3ActionPerformed</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000066; font-weight: bold;">void</span> jButton4ActionPerformed<span style="color: #009900;">&#40;</span>java.<span style="color: #006633;">awt</span>.<span style="color: #006633;">event</span>.<span style="color: #003399;">ActionEvent</span> evt<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><span style="color: #666666; font-style: italic;">//GEN-FIRST:event_jButton4ActionPerformed</span>
        <span style="color: #666666; font-style: italic;">// TODO add your handling code here:</span>
        jTextArea1.<span style="color: #006633;">paste</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #666666; font-style: italic;">//GEN-LAST:event_jButton4ActionPerformed</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000066; font-weight: bold;">void</span> jButton5ActionPerformed<span style="color: #009900;">&#40;</span>java.<span style="color: #006633;">awt</span>.<span style="color: #006633;">event</span>.<span style="color: #003399;">ActionEvent</span> evt<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><span style="color: #666666; font-style: italic;">//GEN-FIRST:event_jButton5ActionPerformed</span>
        <span style="color: #666666; font-style: italic;">// TODO add your handling code here:</span>
        jTextArea1.<span style="color: #006633;">selectAll</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #666666; font-style: italic;">//GEN-LAST:event_jButton5ActionPerformed</span>
&nbsp;
&nbsp;
    <span style="color: #666666; font-style: italic;">// Variables declaration - do not modify//GEN-BEGIN:variables</span>
    <span style="color: #000000; font-weight: bold;">private</span> javax.<span style="color: #006633;">swing</span>.<span style="color: #003399;">JButton</span> jButton1<span style="color: #339933;">;</span>
    <span style="color: #000000; font-weight: bold;">private</span> javax.<span style="color: #006633;">swing</span>.<span style="color: #003399;">JButton</span> jButton2<span style="color: #339933;">;</span>
    <span style="color: #000000; font-weight: bold;">private</span> javax.<span style="color: #006633;">swing</span>.<span style="color: #003399;">JButton</span> jButton3<span style="color: #339933;">;</span>
    <span style="color: #000000; font-weight: bold;">private</span> javax.<span style="color: #006633;">swing</span>.<span style="color: #003399;">JButton</span> jButton4<span style="color: #339933;">;</span>
    <span style="color: #000000; font-weight: bold;">private</span> javax.<span style="color: #006633;">swing</span>.<span style="color: #003399;">JButton</span> jButton5<span style="color: #339933;">;</span>
    <span style="color: #000000; font-weight: bold;">private</span> javax.<span style="color: #006633;">swing</span>.<span style="color: #003399;">JComboBox</span> jComboBox1<span style="color: #339933;">;</span>
    <span style="color: #000000; font-weight: bold;">private</span> javax.<span style="color: #006633;">swing</span>.<span style="color: #003399;">JLabel</span> jLabel1<span style="color: #339933;">;</span>
    <span style="color: #000000; font-weight: bold;">private</span> javax.<span style="color: #006633;">swing</span>.<span style="color: #003399;">JLabel</span> jLabel2<span style="color: #339933;">;</span>
    <span style="color: #000000; font-weight: bold;">private</span> javax.<span style="color: #006633;">swing</span>.<span style="color: #003399;">JLabel</span> jLabel3<span style="color: #339933;">;</span>
    <span style="color: #000000; font-weight: bold;">private</span> javax.<span style="color: #006633;">swing</span>.<span style="color: #003399;">JList</span> jList1<span style="color: #339933;">;</span>
    <span style="color: #000000; font-weight: bold;">private</span> javax.<span style="color: #006633;">swing</span>.<span style="color: #003399;">JPanel</span> jPanel1<span style="color: #339933;">;</span>
    <span style="color: #000000; font-weight: bold;">private</span> javax.<span style="color: #006633;">swing</span>.<span style="color: #003399;">JScrollPane</span> jScrollPane1<span style="color: #339933;">;</span>
    <span style="color: #000000; font-weight: bold;">private</span> javax.<span style="color: #006633;">swing</span>.<span style="color: #003399;">JScrollPane</span> jScrollPane2<span style="color: #339933;">;</span>
    <span style="color: #000000; font-weight: bold;">private</span> javax.<span style="color: #006633;">swing</span>.<span style="color: #003399;">JTextArea</span> jTextArea1<span style="color: #339933;">;</span>
    <span style="color: #666666; font-style: italic;">// End of variables declaration//GEN-END:variables</span>
&nbsp;
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://blog.creativeitp.com/posts-and-articles/cryptography/applet-implementation-to-code-caesars-substitution-cipher/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<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>2</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>3</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>9</slash:comments>
		</item>
	</channel>
</rss>

