ruby-aes-table2 1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,235 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7
+ <head>
8
+ <title>File: README</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <meta http-equiv="Content-Script-Type" content="text/javascript" />
11
+ <link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
12
+ <script type="text/javascript">
13
+ // <![CDATA[
14
+
15
+ function popupCode( url ) {
16
+ window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
17
+ }
18
+
19
+ function toggleCode( id ) {
20
+ if ( document.getElementById )
21
+ elem = document.getElementById( id );
22
+ else if ( document.all )
23
+ elem = eval( "document.all." + id );
24
+ else
25
+ return false;
26
+
27
+ elemStyle = elem.style;
28
+
29
+ if ( elemStyle.display != "block" ) {
30
+ elemStyle.display = "block"
31
+ } else {
32
+ elemStyle.display = "none"
33
+ }
34
+
35
+ return true;
36
+ }
37
+
38
+ // Make codeblocks hidden by default
39
+ document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
40
+
41
+ // ]]>
42
+ </script>
43
+
44
+ </head>
45
+ <body>
46
+
47
+
48
+
49
+ <div id="fileHeader">
50
+ <h1>README</h1>
51
+ <table class="header-table">
52
+ <tr class="top-aligned-row">
53
+ <td><strong>Path:</strong></td>
54
+ <td>README
55
+ </td>
56
+ </tr>
57
+ <tr class="top-aligned-row">
58
+ <td><strong>Last Update:</strong></td>
59
+ <td>Sun Jul 29 18:32:22 CEST 2007</td>
60
+ </tr>
61
+ </table>
62
+ </div>
63
+ <!-- banner header -->
64
+
65
+ <div id="bodyContent">
66
+
67
+
68
+
69
+ <div id="contextContent">
70
+
71
+ <div id="description">
72
+ <p>
73
+ README for ruby-aes
74
+ </p>
75
+ <h6>=============</h6>
76
+ <p>
77
+ Ruby AES &lt;<a
78
+ href="http://rubyforge.org/projects/ruby-aes">rubyforge.org/projects/ruby-aes</a>&gt;
79
+ is an implementation of the Rijndael algorithm.
80
+ </p>
81
+ <p>
82
+ Written by Alex Boussinet &lt;<a
83
+ href="mailto:alex.boussinet@gmail.com">alex.boussinet@gmail.com</a>&gt;
84
+ </p>
85
+ <p>
86
+ This release is mainly an import from the Ruby Application Archive (RAA).
87
+ I&#8217;ve added all the versions I was working on (algorithm variations)
88
+ and a new C extension for improved performance. 6 variations are available:
89
+ </p>
90
+ <ul>
91
+ <li>&quot;Normal&quot;:
92
+
93
+ </li>
94
+ </ul>
95
+ <p>
96
+ Pure Ruby implementation of the Rijndael algorithm specifications. Useful
97
+ for understanding the algorithm.
98
+ </p>
99
+ <ul>
100
+ <li>&quot;Optimized&quot;:
101
+
102
+ </li>
103
+ </ul>
104
+ <p>
105
+ Pure Ruby implementation based on the &quot;Normal&quot; code but optimized
106
+ for speed. The SubBytes and ShiftRows methods have been combined.
107
+ </p>
108
+ <ul>
109
+ <li>&quot;Table Optimized 1&quot;:
110
+
111
+ </li>
112
+ </ul>
113
+ <p>
114
+ Pure Ruby implementation based on the C code from the Rijndael website. The
115
+ arrays of constants are bigger because all the operations are already
116
+ computed so it&#8217;s mainly based on table look ups.
117
+ </p>
118
+ <ul>
119
+ <li>&quot;Table Optimized 2&quot;:
120
+
121
+ </li>
122
+ </ul>
123
+ <p>
124
+ Pure Ruby implementation based on the &quot;Table Optimized 1&quot; code.
125
+ The arrays of constants are bigger because all the operations are already
126
+ computed and table look ups are also combined.
127
+ </p>
128
+ <ul>
129
+ <li>&quot;Table Unroll Optimized 1&quot;:
130
+
131
+ </li>
132
+ </ul>
133
+ <p>
134
+ Pure Ruby implementation based on the &quot;Table Optimized 1&quot; code.
135
+ The change here is that the loops are unrolled.
136
+ </p>
137
+ <ul>
138
+ <li>&quot;Table Unroll Optimized 2&quot;:
139
+
140
+ </li>
141
+ </ul>
142
+ <p>
143
+ Pure Ruby implementation based on the &quot;Table Optimized 2&quot; code.
144
+ The change here is that the loops are unrolled.
145
+ </p>
146
+ <ul>
147
+ <li>&quot;EXT Table Unroll Optimized 2&quot;:
148
+
149
+ </li>
150
+ </ul>
151
+ <p>
152
+ C extension based on the &quot;Table Unroll Optimized 2&quot; code. This
153
+ extension is provided for major speed improvement.
154
+ </p>
155
+ <p>
156
+ All those variations share the same API:
157
+ </p>
158
+ <pre>
159
+ Default key_length: 128
160
+ Default mode: 'ECB'
161
+ Default IV: 16 null chars (&quot;00&quot; * 16 in hex format)
162
+ Default key: 16 null chars (&quot;00&quot; * 16 in hex format)
163
+ Default input text: &quot;PLAINTEXT&quot;
164
+
165
+ Aes.check_key(key_string, key_length)
166
+ Aes.check_iv(iv_string)
167
+ Aes.check_kl(key_length)
168
+ Aes.check_mode(mode)
169
+ Aes.init(key_length, mode, key, iv)
170
+ Aes.encrypt_block(key_length, mode, key, iv, block) # no padding
171
+ Aes.decrypt_block(key_length, mode, key, iv, block) # no padding
172
+ Aes.encrypt_buffer(key_length, mode, key, iv, block) # padding
173
+ Aes.decrypt_buffer(key_length, mode, key, iv, block) # padding
174
+ Aes.encrypt_stream(key_length, mode, key, iv, sin, sout)
175
+ Aes.decrypt_stream(key_length, mode, key, iv, sin, sout)
176
+ Aes.bs() # block size for read operations (stream)
177
+ Aes.bs=(bs)
178
+ </pre>
179
+ <p>
180
+ Valid modes are:
181
+ </p>
182
+ <pre>
183
+ * ECB (Electronic Code Book)
184
+ * CBC (Cipher Block Chaining)
185
+ * OFB (Output Feedback)
186
+ * CFB (Cipher Feedback)
187
+ </pre>
188
+ <p>
189
+ Valid key length:
190
+ </p>
191
+ <pre>
192
+ * 128 bits
193
+ * 192 bits
194
+ * 256 bits
195
+ </pre>
196
+ <p>
197
+ For a really good encryption, 256 bits CBC is recommanded.
198
+ </p>
199
+ <p>
200
+ For more information on AES-Rijndael, see: &lt;<a
201
+ href="http://csrc.nist.gov/encryption/aes/rijndael">csrc.nist.gov/encryption/aes/rijndael</a>/&gt;
202
+ </p>
203
+
204
+ </div>
205
+
206
+
207
+ </div>
208
+
209
+
210
+ </div>
211
+
212
+
213
+ <!-- if includes -->
214
+
215
+ <div id="section">
216
+
217
+
218
+
219
+
220
+
221
+
222
+
223
+
224
+ <!-- if method_list -->
225
+
226
+
227
+ </div>
228
+
229
+
230
+ <div id="validator-badges">
231
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
232
+ </div>
233
+
234
+ </body>
235
+ </html>
@@ -0,0 +1,108 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7
+ <head>
8
+ <title>File: aes_alg.rb</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <meta http-equiv="Content-Script-Type" content="text/javascript" />
11
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
12
+ <script type="text/javascript">
13
+ // <![CDATA[
14
+
15
+ function popupCode( url ) {
16
+ window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
17
+ }
18
+
19
+ function toggleCode( id ) {
20
+ if ( document.getElementById )
21
+ elem = document.getElementById( id );
22
+ else if ( document.all )
23
+ elem = eval( "document.all." + id );
24
+ else
25
+ return false;
26
+
27
+ elemStyle = elem.style;
28
+
29
+ if ( elemStyle.display != "block" ) {
30
+ elemStyle.display = "block"
31
+ } else {
32
+ elemStyle.display = "none"
33
+ }
34
+
35
+ return true;
36
+ }
37
+
38
+ // Make codeblocks hidden by default
39
+ document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
40
+
41
+ // ]]>
42
+ </script>
43
+
44
+ </head>
45
+ <body>
46
+
47
+
48
+
49
+ <div id="fileHeader">
50
+ <h1>aes_alg.rb</h1>
51
+ <table class="header-table">
52
+ <tr class="top-aligned-row">
53
+ <td><strong>Path:</strong></td>
54
+ <td>lib/ruby-aes/aes_alg.rb
55
+ </td>
56
+ </tr>
57
+ <tr class="top-aligned-row">
58
+ <td><strong>Last Update:</strong></td>
59
+ <td>Wed Aug 01 17:33:07 CEST 2007</td>
60
+ </tr>
61
+ </table>
62
+ </div>
63
+ <!-- banner header -->
64
+
65
+ <div id="bodyContent">
66
+
67
+
68
+
69
+ <div id="contextContent">
70
+
71
+
72
+ <div id="requires-list">
73
+ <h3 class="section-bar">Required files</h3>
74
+
75
+ <div class="name-list">
76
+ ruby-aes/aes_cons&nbsp;&nbsp;
77
+ </div>
78
+ </div>
79
+
80
+ </div>
81
+
82
+
83
+ </div>
84
+
85
+
86
+ <!-- if includes -->
87
+
88
+ <div id="section">
89
+
90
+
91
+
92
+
93
+
94
+
95
+
96
+
97
+ <!-- if method_list -->
98
+
99
+
100
+ </div>
101
+
102
+
103
+ <div id="validator-badges">
104
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
105
+ </div>
106
+
107
+ </body>
108
+ </html>
@@ -0,0 +1,101 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7
+ <head>
8
+ <title>File: aes_cons.rb</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <meta http-equiv="Content-Script-Type" content="text/javascript" />
11
+ <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
12
+ <script type="text/javascript">
13
+ // <![CDATA[
14
+
15
+ function popupCode( url ) {
16
+ window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
17
+ }
18
+
19
+ function toggleCode( id ) {
20
+ if ( document.getElementById )
21
+ elem = document.getElementById( id );
22
+ else if ( document.all )
23
+ elem = eval( "document.all." + id );
24
+ else
25
+ return false;
26
+
27
+ elemStyle = elem.style;
28
+
29
+ if ( elemStyle.display != "block" ) {
30
+ elemStyle.display = "block"
31
+ } else {
32
+ elemStyle.display = "none"
33
+ }
34
+
35
+ return true;
36
+ }
37
+
38
+ // Make codeblocks hidden by default
39
+ document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
40
+
41
+ // ]]>
42
+ </script>
43
+
44
+ </head>
45
+ <body>
46
+
47
+
48
+
49
+ <div id="fileHeader">
50
+ <h1>aes_cons.rb</h1>
51
+ <table class="header-table">
52
+ <tr class="top-aligned-row">
53
+ <td><strong>Path:</strong></td>
54
+ <td>lib/ruby-aes/aes_cons.rb
55
+ </td>
56
+ </tr>
57
+ <tr class="top-aligned-row">
58
+ <td><strong>Last Update:</strong></td>
59
+ <td>Wed Aug 01 17:33:07 CEST 2007</td>
60
+ </tr>
61
+ </table>
62
+ </div>
63
+ <!-- banner header -->
64
+
65
+ <div id="bodyContent">
66
+
67
+
68
+
69
+ <div id="contextContent">
70
+
71
+
72
+
73
+ </div>
74
+
75
+
76
+ </div>
77
+
78
+
79
+ <!-- if includes -->
80
+
81
+ <div id="section">
82
+
83
+
84
+
85
+
86
+
87
+
88
+
89
+
90
+ <!-- if method_list -->
91
+
92
+
93
+ </div>
94
+
95
+
96
+ <div id="validator-badges">
97
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
98
+ </div>
99
+
100
+ </body>
101
+ </html>
@@ -0,0 +1,108 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7
+ <head>
8
+ <title>File: ruby-aes.rb</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <meta http-equiv="Content-Script-Type" content="text/javascript" />
11
+ <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
12
+ <script type="text/javascript">
13
+ // <![CDATA[
14
+
15
+ function popupCode( url ) {
16
+ window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
17
+ }
18
+
19
+ function toggleCode( id ) {
20
+ if ( document.getElementById )
21
+ elem = document.getElementById( id );
22
+ else if ( document.all )
23
+ elem = eval( "document.all." + id );
24
+ else
25
+ return false;
26
+
27
+ elemStyle = elem.style;
28
+
29
+ if ( elemStyle.display != "block" ) {
30
+ elemStyle.display = "block"
31
+ } else {
32
+ elemStyle.display = "none"
33
+ }
34
+
35
+ return true;
36
+ }
37
+
38
+ // Make codeblocks hidden by default
39
+ document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
40
+
41
+ // ]]>
42
+ </script>
43
+
44
+ </head>
45
+ <body>
46
+
47
+
48
+
49
+ <div id="fileHeader">
50
+ <h1>ruby-aes.rb</h1>
51
+ <table class="header-table">
52
+ <tr class="top-aligned-row">
53
+ <td><strong>Path:</strong></td>
54
+ <td>lib/ruby-aes.rb
55
+ </td>
56
+ </tr>
57
+ <tr class="top-aligned-row">
58
+ <td><strong>Last Update:</strong></td>
59
+ <td>Sun Jul 29 18:32:22 CEST 2007</td>
60
+ </tr>
61
+ </table>
62
+ </div>
63
+ <!-- banner header -->
64
+
65
+ <div id="bodyContent">
66
+
67
+
68
+
69
+ <div id="contextContent">
70
+
71
+
72
+ <div id="requires-list">
73
+ <h3 class="section-bar">Required files</h3>
74
+
75
+ <div class="name-list">
76
+ ruby-aes/aes_alg&nbsp;&nbsp;
77
+ </div>
78
+ </div>
79
+
80
+ </div>
81
+
82
+
83
+ </div>
84
+
85
+
86
+ <!-- if includes -->
87
+
88
+ <div id="section">
89
+
90
+
91
+
92
+
93
+
94
+
95
+
96
+
97
+ <!-- if method_list -->
98
+
99
+
100
+ </div>
101
+
102
+
103
+ <div id="validator-badges">
104
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
105
+ </div>
106
+
107
+ </body>
108
+ </html>