mack-encryption 0.7.0.1 → 0.7.1
Sign up to get free protection for your applications and to get access to all the features.
- data/doc/classes/Kernel.html +174 -0
- data/doc/classes/Mack.html +109 -0
- data/doc/classes/Mack/Utils/Crypt/DefaultWorker.html +212 -0
- data/doc/classes/Mack/Utils/Crypt/Keeper.html +221 -0
- data/doc/classes/String.html +190 -0
- data/doc/created.rid +1 -0
- data/doc/files/README.html +111 -0
- data/doc/files/lib/mack-encryption/default_worker_rb.html +101 -0
- data/doc/files/lib/mack-encryption/keeper_rb.html +101 -0
- data/doc/files/lib/mack-encryption/kernel_rb.html +101 -0
- data/doc/files/lib/mack-encryption/string_rb.html +101 -0
- data/doc/files/lib/mack-encryption_rb.html +109 -0
- data/doc/fr_class_index.html +31 -0
- data/doc/fr_file_index.html +32 -0
- data/doc/fr_method_index.html +35 -0
- data/doc/index.html +24 -0
- data/doc/rdoc-style.css +208 -0
- data/lib/mack-encryption.rb +1 -1
- data/lib/mack-encryption/default_worker.rb +6 -6
- metadata +21 -4
@@ -0,0 +1,174 @@
|
|
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>Module: Kernel</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="classHeader">
|
50
|
+
<table class="header-table">
|
51
|
+
<tr class="top-aligned-row">
|
52
|
+
<td><strong>Module</strong></td>
|
53
|
+
<td class="class-name-in-header">Kernel</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../files/lib/mack-encryption/kernel_rb.html">
|
59
|
+
lib/mack-encryption/kernel.rb
|
60
|
+
</a>
|
61
|
+
<br />
|
62
|
+
</td>
|
63
|
+
</tr>
|
64
|
+
|
65
|
+
</table>
|
66
|
+
</div>
|
67
|
+
<!-- banner header -->
|
68
|
+
|
69
|
+
<div id="bodyContent">
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
<div id="contextContent">
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
</div>
|
78
|
+
|
79
|
+
<div id="method-list">
|
80
|
+
<h3 class="section-bar">Methods</h3>
|
81
|
+
|
82
|
+
<div class="name-list">
|
83
|
+
<a href="#M000009">_decrypt</a>
|
84
|
+
<a href="#M000008">_encrypt</a>
|
85
|
+
</div>
|
86
|
+
</div>
|
87
|
+
|
88
|
+
</div>
|
89
|
+
|
90
|
+
|
91
|
+
<!-- if includes -->
|
92
|
+
|
93
|
+
<div id="section">
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
|
100
|
+
|
101
|
+
|
102
|
+
<!-- if method_list -->
|
103
|
+
<div id="methods">
|
104
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
105
|
+
|
106
|
+
<div id="method-M000009" class="method-detail">
|
107
|
+
<a name="M000009"></a>
|
108
|
+
|
109
|
+
<div class="method-heading">
|
110
|
+
<a href="#M000009" class="method-signature">
|
111
|
+
<span class="method-name">_decrypt</span><span class="method-args">(value, worker = :default)</span>
|
112
|
+
</a>
|
113
|
+
</div>
|
114
|
+
|
115
|
+
<div class="method-description">
|
116
|
+
<p>
|
117
|
+
A helper method that calls <a
|
118
|
+
href="Mack/Utils/Crypt/Keeper.html">Mack::Utils::Crypt::Keeper</a> with the
|
119
|
+
specified worker and calls the decrypt method on that worker.
|
120
|
+
</p>
|
121
|
+
<p><a class="source-toggle" href="#"
|
122
|
+
onclick="toggleCode('M000009-source');return false;">[Source]</a></p>
|
123
|
+
<div class="method-source-code" id="M000009-source">
|
124
|
+
<pre>
|
125
|
+
<span class="ruby-comment cmt"># File lib/mack-encryption/kernel.rb, line 11</span>
|
126
|
+
11: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">_decrypt</span>(<span class="ruby-identifier">value</span>, <span class="ruby-identifier">worker</span> = <span class="ruby-identifier">:default</span>)
|
127
|
+
12: <span class="ruby-constant">Mack</span><span class="ruby-operator">::</span><span class="ruby-constant">Utils</span><span class="ruby-operator">::</span><span class="ruby-constant">Crypt</span><span class="ruby-operator">::</span><span class="ruby-constant">Keeper</span>.<span class="ruby-identifier">instance</span>.<span class="ruby-identifier">worker</span>(<span class="ruby-identifier">worker</span>).<span class="ruby-identifier">decrypt</span>(<span class="ruby-identifier">value</span>)
|
128
|
+
13: <span class="ruby-keyword kw">end</span>
|
129
|
+
</pre>
|
130
|
+
</div>
|
131
|
+
</div>
|
132
|
+
</div>
|
133
|
+
|
134
|
+
<div id="method-M000008" class="method-detail">
|
135
|
+
<a name="M000008"></a>
|
136
|
+
|
137
|
+
<div class="method-heading">
|
138
|
+
<a href="#M000008" class="method-signature">
|
139
|
+
<span class="method-name">_encrypt</span><span class="method-args">(value, worker = :default)</span>
|
140
|
+
</a>
|
141
|
+
</div>
|
142
|
+
|
143
|
+
<div class="method-description">
|
144
|
+
<p>
|
145
|
+
A helper method that calls <a
|
146
|
+
href="Mack/Utils/Crypt/Keeper.html">Mack::Utils::Crypt::Keeper</a> with the
|
147
|
+
specified worker and calls the encrypt method on that worker.
|
148
|
+
</p>
|
149
|
+
<p><a class="source-toggle" href="#"
|
150
|
+
onclick="toggleCode('M000008-source');return false;">[Source]</a></p>
|
151
|
+
<div class="method-source-code" id="M000008-source">
|
152
|
+
<pre>
|
153
|
+
<span class="ruby-comment cmt"># File lib/mack-encryption/kernel.rb, line 5</span>
|
154
|
+
5: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">_encrypt</span>(<span class="ruby-identifier">value</span>, <span class="ruby-identifier">worker</span> = <span class="ruby-identifier">:default</span>)
|
155
|
+
6: <span class="ruby-constant">Mack</span><span class="ruby-operator">::</span><span class="ruby-constant">Utils</span><span class="ruby-operator">::</span><span class="ruby-constant">Crypt</span><span class="ruby-operator">::</span><span class="ruby-constant">Keeper</span>.<span class="ruby-identifier">instance</span>.<span class="ruby-identifier">worker</span>(<span class="ruby-identifier">worker</span>).<span class="ruby-identifier">encrypt</span>(<span class="ruby-identifier">value</span>)
|
156
|
+
7: <span class="ruby-keyword kw">end</span>
|
157
|
+
</pre>
|
158
|
+
</div>
|
159
|
+
</div>
|
160
|
+
</div>
|
161
|
+
|
162
|
+
|
163
|
+
</div>
|
164
|
+
|
165
|
+
|
166
|
+
</div>
|
167
|
+
|
168
|
+
|
169
|
+
<div id="validator-badges">
|
170
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
171
|
+
</div>
|
172
|
+
|
173
|
+
</body>
|
174
|
+
</html>
|
@@ -0,0 +1,109 @@
|
|
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>Module: Mack</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="classHeader">
|
50
|
+
<table class="header-table">
|
51
|
+
<tr class="top-aligned-row">
|
52
|
+
<td><strong>Module</strong></td>
|
53
|
+
<td class="class-name-in-header">Mack</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../files/lib/mack-encryption/default_worker_rb.html">
|
59
|
+
lib/mack-encryption/default_worker.rb
|
60
|
+
</a>
|
61
|
+
<br />
|
62
|
+
<a href="../files/lib/mack-encryption/keeper_rb.html">
|
63
|
+
lib/mack-encryption/keeper.rb
|
64
|
+
</a>
|
65
|
+
<br />
|
66
|
+
</td>
|
67
|
+
</tr>
|
68
|
+
|
69
|
+
</table>
|
70
|
+
</div>
|
71
|
+
<!-- banner header -->
|
72
|
+
|
73
|
+
<div id="bodyContent">
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
<div id="contextContent">
|
78
|
+
|
79
|
+
|
80
|
+
|
81
|
+
</div>
|
82
|
+
|
83
|
+
|
84
|
+
</div>
|
85
|
+
|
86
|
+
|
87
|
+
<!-- if includes -->
|
88
|
+
|
89
|
+
<div id="section">
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
|
98
|
+
<!-- if method_list -->
|
99
|
+
|
100
|
+
|
101
|
+
</div>
|
102
|
+
|
103
|
+
|
104
|
+
<div id="validator-badges">
|
105
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
106
|
+
</div>
|
107
|
+
|
108
|
+
</body>
|
109
|
+
</html>
|
@@ -0,0 +1,212 @@
|
|
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>Class: Mack::Utils::Crypt::DefaultWorker</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="classHeader">
|
50
|
+
<table class="header-table">
|
51
|
+
<tr class="top-aligned-row">
|
52
|
+
<td><strong>Class</strong></td>
|
53
|
+
<td class="class-name-in-header">Mack::Utils::Crypt::DefaultWorker</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../../../../files/lib/mack-encryption/default_worker_rb.html">
|
59
|
+
lib/mack-encryption/default_worker.rb
|
60
|
+
</a>
|
61
|
+
<br />
|
62
|
+
</td>
|
63
|
+
</tr>
|
64
|
+
|
65
|
+
<tr class="top-aligned-row">
|
66
|
+
<td><strong>Parent:</strong></td>
|
67
|
+
<td>
|
68
|
+
Object
|
69
|
+
</td>
|
70
|
+
</tr>
|
71
|
+
</table>
|
72
|
+
</div>
|
73
|
+
<!-- banner header -->
|
74
|
+
|
75
|
+
<div id="bodyContent">
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
<div id="contextContent">
|
80
|
+
|
81
|
+
<div id="description">
|
82
|
+
<p>
|
83
|
+
The default worker is one that is used when no other worker is specified or
|
84
|
+
the specified worker does not exist. It uses the EzCrypto library and
|
85
|
+
get‘s it‘s secret key from app_config.default_secret_key
|
86
|
+
</p>
|
87
|
+
|
88
|
+
</div>
|
89
|
+
|
90
|
+
|
91
|
+
</div>
|
92
|
+
|
93
|
+
<div id="method-list">
|
94
|
+
<h3 class="section-bar">Methods</h3>
|
95
|
+
|
96
|
+
<div class="name-list">
|
97
|
+
<a href="#M000007">decrypt</a>
|
98
|
+
<a href="#M000006">encrypt</a>
|
99
|
+
<a href="#M000005">new</a>
|
100
|
+
</div>
|
101
|
+
</div>
|
102
|
+
|
103
|
+
</div>
|
104
|
+
|
105
|
+
|
106
|
+
<!-- if includes -->
|
107
|
+
|
108
|
+
<div id="section">
|
109
|
+
|
110
|
+
|
111
|
+
|
112
|
+
|
113
|
+
|
114
|
+
|
115
|
+
|
116
|
+
|
117
|
+
<!-- if method_list -->
|
118
|
+
<div id="methods">
|
119
|
+
<h3 class="section-bar">Public Class methods</h3>
|
120
|
+
|
121
|
+
<div id="method-M000005" class="method-detail">
|
122
|
+
<a name="M000005"></a>
|
123
|
+
|
124
|
+
<div class="method-heading">
|
125
|
+
<a href="#M000005" class="method-signature">
|
126
|
+
<span class="method-name">new</span><span class="method-args">()</span>
|
127
|
+
</a>
|
128
|
+
</div>
|
129
|
+
|
130
|
+
<div class="method-description">
|
131
|
+
<p><a class="source-toggle" href="#"
|
132
|
+
onclick="toggleCode('M000005-source');return false;">[Source]</a></p>
|
133
|
+
<div class="method-source-code" id="M000005-source">
|
134
|
+
<pre>
|
135
|
+
<span class="ruby-comment cmt"># File lib/mack-encryption/default_worker.rb, line 9</span>
|
136
|
+
9: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>
|
137
|
+
10: <span class="ruby-ivar">@aes_key</span> = <span class="ruby-constant">EzCrypto</span><span class="ruby-operator">::</span><span class="ruby-constant">Key</span>.<span class="ruby-identifier">with_password</span>((<span class="ruby-identifier">app_config</span>.<span class="ruby-identifier">default_secret_key</span> <span class="ruby-operator">||</span> (<span class="ruby-constant">String</span>.<span class="ruby-identifier">randomize</span>(<span class="ruby-value">40</span>))), <span class="ruby-constant">Mack</span><span class="ruby-operator">::</span><span class="ruby-constant">VERSION</span>)
|
138
|
+
11: <span class="ruby-keyword kw">end</span>
|
139
|
+
</pre>
|
140
|
+
</div>
|
141
|
+
</div>
|
142
|
+
</div>
|
143
|
+
|
144
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
145
|
+
|
146
|
+
<div id="method-M000007" class="method-detail">
|
147
|
+
<a name="M000007"></a>
|
148
|
+
|
149
|
+
<div class="method-heading">
|
150
|
+
<a href="#M000007" class="method-signature">
|
151
|
+
<span class="method-name">decrypt</span><span class="method-args">(x)</span>
|
152
|
+
</a>
|
153
|
+
</div>
|
154
|
+
|
155
|
+
<div class="method-description">
|
156
|
+
<p>
|
157
|
+
Decrypts a string using the EzCrypto library and the secret key found in
|
158
|
+
app_config.default_secret_key
|
159
|
+
</p>
|
160
|
+
<p><a class="source-toggle" href="#"
|
161
|
+
onclick="toggleCode('M000007-source');return false;">[Source]</a></p>
|
162
|
+
<div class="method-source-code" id="M000007-source">
|
163
|
+
<pre>
|
164
|
+
<span class="ruby-comment cmt"># File lib/mack-encryption/default_worker.rb, line 21</span>
|
165
|
+
21: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">decrypt</span>(<span class="ruby-identifier">x</span>)
|
166
|
+
22: <span class="ruby-ivar">@aes_key</span>.<span class="ruby-identifier">decrypt</span>(<span class="ruby-identifier">x</span>)
|
167
|
+
23: <span class="ruby-keyword kw">end</span>
|
168
|
+
</pre>
|
169
|
+
</div>
|
170
|
+
</div>
|
171
|
+
</div>
|
172
|
+
|
173
|
+
<div id="method-M000006" class="method-detail">
|
174
|
+
<a name="M000006"></a>
|
175
|
+
|
176
|
+
<div class="method-heading">
|
177
|
+
<a href="#M000006" class="method-signature">
|
178
|
+
<span class="method-name">encrypt</span><span class="method-args">(x)</span>
|
179
|
+
</a>
|
180
|
+
</div>
|
181
|
+
|
182
|
+
<div class="method-description">
|
183
|
+
<p>
|
184
|
+
Encrypts a string using the EzCrypto library and the secret key found in
|
185
|
+
app_config.default_secret_key
|
186
|
+
</p>
|
187
|
+
<p><a class="source-toggle" href="#"
|
188
|
+
onclick="toggleCode('M000006-source');return false;">[Source]</a></p>
|
189
|
+
<div class="method-source-code" id="M000006-source">
|
190
|
+
<pre>
|
191
|
+
<span class="ruby-comment cmt"># File lib/mack-encryption/default_worker.rb, line 15</span>
|
192
|
+
15: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">encrypt</span>(<span class="ruby-identifier">x</span>)
|
193
|
+
16: <span class="ruby-ivar">@aes_key</span>.<span class="ruby-identifier">encrypt</span>(<span class="ruby-identifier">x</span>)
|
194
|
+
17: <span class="ruby-keyword kw">end</span>
|
195
|
+
</pre>
|
196
|
+
</div>
|
197
|
+
</div>
|
198
|
+
</div>
|
199
|
+
|
200
|
+
|
201
|
+
</div>
|
202
|
+
|
203
|
+
|
204
|
+
</div>
|
205
|
+
|
206
|
+
|
207
|
+
<div id="validator-badges">
|
208
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
209
|
+
</div>
|
210
|
+
|
211
|
+
</body>
|
212
|
+
</html>
|