obfuscate 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore ADDED
@@ -0,0 +1,22 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ coverage
6
+ InstalledFiles
7
+ lib/bundler/man
8
+ pkg
9
+ rdoc
10
+ spec/reports
11
+ test/tmp
12
+ test/version_tmp
13
+ tmp
14
+
15
+ #idea files
16
+ *.iml
17
+ .idea
18
+
19
+ # YARD artifacts
20
+ .yardoc
21
+ _yardoc
22
+ doc/
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --color
2
+ --format progress
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source 'http://rubygems.org'
2
+
3
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,72 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ obfuscate (0.0.2)
5
+ crypt19 (~> 1.2.0)
6
+
7
+ GEM
8
+ remote: http://rubygems.org/
9
+ specs:
10
+ activemodel (3.2.11)
11
+ activesupport (= 3.2.11)
12
+ builder (~> 3.0.0)
13
+ activerecord (3.2.11)
14
+ activemodel (= 3.2.11)
15
+ activesupport (= 3.2.11)
16
+ arel (~> 3.0.2)
17
+ tzinfo (~> 0.3.29)
18
+ activesupport (3.2.11)
19
+ i18n (~> 0.6)
20
+ multi_json (~> 1.0)
21
+ arel (3.0.2)
22
+ builder (3.0.4)
23
+ coderay (1.0.8)
24
+ crypt19 (1.2.1)
25
+ diff-lcs (1.1.3)
26
+ ffi (1.3.1)
27
+ guard (1.6.2)
28
+ listen (>= 0.6.0)
29
+ lumberjack (>= 1.0.2)
30
+ pry (>= 0.9.10)
31
+ terminal-table (>= 1.4.3)
32
+ thor (>= 0.14.6)
33
+ guard-rspec (2.4.0)
34
+ guard (>= 1.1)
35
+ rspec (~> 2.11)
36
+ i18n (0.6.1)
37
+ listen (0.7.2)
38
+ lumberjack (1.0.2)
39
+ method_source (0.8.1)
40
+ multi_json (1.5.0)
41
+ pry (0.9.11.4)
42
+ coderay (~> 1.0.5)
43
+ method_source (~> 0.8)
44
+ slop (~> 3.4)
45
+ rb-inotify (0.8.8)
46
+ ffi (>= 0.5.0)
47
+ rspec (2.12.0)
48
+ rspec-core (~> 2.12.0)
49
+ rspec-expectations (~> 2.12.0)
50
+ rspec-mocks (~> 2.12.0)
51
+ rspec-core (2.12.2)
52
+ rspec-expectations (2.12.1)
53
+ diff-lcs (~> 1.1.3)
54
+ rspec-mocks (2.12.2)
55
+ slop (3.4.3)
56
+ sqlite3 (1.3.7)
57
+ terminal-table (1.4.5)
58
+ thor (0.17.0)
59
+ tzinfo (0.3.35)
60
+ yard (0.8.3)
61
+
62
+ PLATFORMS
63
+ ruby
64
+
65
+ DEPENDENCIES
66
+ activerecord (> 3.0.0)
67
+ guard-rspec (~> 2.4.0)
68
+ obfuscate!
69
+ rb-inotify (~> 0.8.8)
70
+ rspec (~> 2.12.0)
71
+ sqlite3 (~> 1.3.0)
72
+ yard (~> 0.8.0)
data/Guardfile ADDED
@@ -0,0 +1,9 @@
1
+ # A sample Guardfile
2
+ # More info at https://github.com/guard/guard#readme
3
+
4
+ guard 'rspec' do
5
+ watch(%r{^spec/.+_spec\.rb$})
6
+ watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
7
+ watch('spec/spec_helper.rb') { "spec" }
8
+ end
9
+
data/LICENSE ADDED
@@ -0,0 +1,176 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
data/README.md ADDED
@@ -0,0 +1,101 @@
1
+ # Obfuscate
2
+
3
+ A simple way to obfuscate ids and text. Useful when you have to make ids visible
4
+ to users. Integrates directly with Rails 3.
5
+
6
+ The goal is to make simple obfuscated ids that are not huge. This is achieved by using
7
+ Blowfish and encrypting a single block. This produces a nice id of 11 characters (11
8
+ since the trailing _=_ is removed by default), for example `3NINgAbOhPc`. The caveat is,
9
+ the id must be within _99,999,999_, e.g. a max length of _8_.
10
+
11
+ Text can be obfuscated using Blowfishes string encryption as well, but than it produces
12
+ output that is larger than the elegant 11 character single block encryption.
13
+
14
+ https://github.com/mguymon/obfuscate
15
+
16
+ [RDoc](http://rubydoc.info/gems/obfuscate/frames)
17
+
18
+ ## Install
19
+
20
+ gem install obfuscate
21
+
22
+ ## Ruby Usage
23
+
24
+ A simple example
25
+
26
+ Obfuscate.setup do |config|
27
+ config.salt = "A weak salt ..."
28
+ config.mode = :string # defaults to :string
29
+ end
30
+
31
+ obfuscated = Obfuscate.obfuscate( "test" )
32
+ clarified = Obfuscate.clarify( obfuscated )
33
+
34
+ ## Rails Integration
35
+
36
+ Create an initializer in `config/initializers` with:
37
+
38
+ require 'obfuscate/obfuscatable'
39
+ Obfuscate.setup do |config|
40
+ config.salt = "A weak salt ..."
41
+ end
42
+
43
+ Now add to models that you want to be `Obfuscatable`:
44
+
45
+ class Message < ActiveRecord::Base
46
+ obfuscatable # a hash of config overrides can be passed.
47
+ end
48
+
49
+ To get the 11 character `obfuscated_id`, which uses `mode :block` for the Blowfish single block encryption:
50
+
51
+ message = Message.find(1)
52
+ obfuscated = message.obfuscated_id
53
+ clarified = message.clarify_id( obfuscated )
54
+
55
+ Message.find_by_obfuscated_id( obfuscated )
56
+
57
+ Or `obfuscate` a block of text, defaults to mode :string which uses Blowfish string encryption, allowing longer
58
+ blocks of text to be obfuscated.
59
+
60
+ obfuscated = message.obfuscate( "if you use your imagination, this is a long block of text" )
61
+ clarified = message.clarify( obfuscated )
62
+
63
+
64
+ ## Benchmarks
65
+
66
+ Some benchmarks from my dev machine, with cpu clocking in at 2.53ghz:
67
+
68
+ Obfuscate.setup :salt => 'a very weak salt indead.'
69
+
70
+ puts Benchmark.bm { |bm|
71
+ ids = []
72
+ bm.report("obfuscate x1000:") {
73
+ 1000.times { ids << Obfuscate.obfuscate( rand(1...99999999), {:mode => :block} ) }
74
+ }
75
+
76
+ bm.report("clarify x1000:") {
77
+ ids.each { |id| Obfuscate.clarify( id, {:mode => :block} ) }
78
+ }
79
+ }
80
+
81
+ user system total real
82
+ obfuscate x1000: 27.110000 0.000000 27.110000 ( 27.145539)
83
+ clarify x1000: 27.270000 0.000000 27.270000 ( 27.304084)
84
+
85
+
86
+ ## License
87
+
88
+ Licensed to the Apache Software Foundation (ASF) under one or more
89
+ contributor license agreements. See the NOTICE file distributed with this
90
+ work for additional information regarding copyright ownership. The ASF
91
+ licenses this file to you under the Apache License, Version 2.0 (the
92
+ "License"); you may not use this file except in compliance with the License.
93
+ You may obtain a copy of the License at
94
+
95
+ http://www.apache.org/licenses/LICENSE-2.0
96
+
97
+ Unless required by applicable law or agreed to in writing, software
98
+ distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
99
+ WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
100
+ License for the specific language governing permissions and limitations under
101
+ the License.
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require 'bundler/gem_tasks'
data/lib/obfuscate.rb ADDED
@@ -0,0 +1,67 @@
1
+ # Licensed to the Apache Software Foundation (ASF) under one or more
2
+ # contributor license agreements. See the NOTICE file distributed with this
3
+ # work for additional information regarding copyright ownership. The ASF
4
+ # licenses this file to you under the Apache License, Version 2.0 (the
5
+ # "License"); you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12
+ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13
+ # License for the specific language governing permissions and limitations under
14
+ # the License.
15
+
16
+
17
+ require 'obfuscate/version'
18
+ require 'obfuscate/crypt'
19
+ require 'obfuscate/config'
20
+
21
+ module Obfuscate
22
+
23
+ class << self
24
+ attr_accessor :config
25
+
26
+ # Obfuscate text. Depends on Obfuscate.setup to be called first
27
+ #
28
+ # @param [String] text to be obfuscated
29
+ # @param [Hash] options overrides how obfuscation should be handled
30
+ # @return [String]
31
+ def obfuscate(text, options = {} )
32
+ cryptor( options ).obfuscate( text )
33
+ end
34
+
35
+ # Clarify obfuscated text. Depends on Obfuscate.setup to be called first
36
+ #
37
+ # @param [String] text to be clarified
38
+ # @param [Hash] options overrides how clarify should be handled
39
+ # @return [String]
40
+ def clarify(text, options = {} )
41
+ cryptor( options ).clarify( text )
42
+ end
43
+
44
+ # Create instance of Obfuscate::Crypt. Depends on Obfuscate.setup to be called first
45
+ #
46
+ # @param [Hash] overrides how instance should be created
47
+ # @return [Obfuscate::Crypt]
48
+ def cryptor(options = {} )
49
+ Obfuscate::Crypt.new( @config.apply( options ) )
50
+ end
51
+
52
+ # Setup Obfuscate passing in a hash and/or block
53
+ #
54
+ # @param [Hash] options of configurations
55
+ # @option options [Symbol] :salt A Model specific salt
56
+ # @option options [Symbol] :encode Enable Base64 and URL encoding for this Model. Enabled by default.
57
+ # @option options [Symbol] :remove_trailing_equal When in :block mode, removes the trailing = from the
58
+ # obfuscated text.
59
+ # @param [block] blk of configuration, has precedence over options Hash.
60
+ # @return [Obfuscate::Config]
61
+ def setup(options ={}, &blk)
62
+ @config = @config.apply(options, &blk)
63
+ end
64
+ end
65
+
66
+ self.config = Obfuscate::Config.new
67
+ end
@@ -0,0 +1,67 @@
1
+ # Licensed to the Apache Software Foundation (ASF) under one or more
2
+ # contributor license agreements. See the NOTICE file distributed with this
3
+ # work for additional information regarding copyright ownership. The ASF
4
+ # licenses this file to you under the Apache License, Version 2.0 (the
5
+ # "License"); you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12
+ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13
+ # License for the specific language governing permissions and limitations under
14
+ # the License.
15
+
16
+ class Obfuscate::Config
17
+ attr_accessor :salt, :mode, :encode, :remove_trailing_equal
18
+
19
+ def initialize
20
+ # defaults
21
+ @remove_trailing_equal = true
22
+ @encode = true
23
+ @mode = :string
24
+ end
25
+
26
+ # Set the mode, enforces that mode should be a Symbol
27
+ def mode=(mode)
28
+ @mode = mode.to_sym
29
+ end
30
+
31
+ # Check if mode is :block and remove_trailing_equal is true
32
+ # @return [Boolean]
33
+ def remove_trailing_equal?
34
+ self.mode == :block && self.remove_trailing_equal == true
35
+ end
36
+
37
+ # Creates a new instance of Config with applied changes
38
+ #
39
+ # @param [Hash] options of configurations
40
+ # @option options [Symbol] :salt A Model specific salt
41
+ # @option options [Symbol] :encode Enable Base64 and URL encoding for this Model. Enabled by default.
42
+ # @option options [Symbol] :remove_trailing_equal When in :block mode, removes the trailing = from the
43
+ # obfuscated text.
44
+ # @param [Block] blk of configuration, has precedence over options hash.
45
+ # @return [Obfuscate::Config] new instance
46
+ def apply(options = {}, &blk)
47
+ config = self.class.new
48
+
49
+ changes = self.to_hash.merge( options )
50
+
51
+ config.salt = changes[:salt] unless changes[:salt].nil?
52
+ config.mode = changes[:mode] unless changes[:mode].nil?
53
+ config.encode = changes[:encode] unless changes[:encode].nil?
54
+ config.remove_trailing_equal = changes[:remove_trailing_equal] unless changes[:remove_trailing_equal].nil?
55
+
56
+
57
+ yield(config) if blk
58
+
59
+ config
60
+ end
61
+
62
+ # Hash of Config
63
+ # @return [Hash]
64
+ def to_hash
65
+ { :salt => salt, :mode => mode, :encode => encode, :remove_trailing_equal => remove_trailing_equal }
66
+ end
67
+ end
@@ -0,0 +1,81 @@
1
+ # Licensed to the Apache Software Foundation (ASF) under one or more
2
+ # contributor license agreements. See the NOTICE file distributed with this
3
+ # work for additional information regarding copyright ownership. The ASF
4
+ # licenses this file to you under the Apache License, Version 2.0 (the
5
+ # "License"); you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12
+ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13
+ # License for the specific language governing permissions and limitations under
14
+ # the License.
15
+
16
+ require 'obfuscate'
17
+ require 'crypt/blowfish'
18
+ require 'base64'
19
+
20
+ class Obfuscate::Crypt
21
+
22
+ attr_reader :config
23
+ attr_reader :exec_config
24
+
25
+ # New instance of Obfuscate::Crypt
26
+ #
27
+ # @param [Obfuscate::Config]
28
+ def initialize( config )
29
+ @crypt = Crypt::Blowfish.new( config.salt )
30
+ @config = config
31
+ end
32
+
33
+ # Obfuscate text
34
+ #
35
+ # @param [Symbol] override_mode to explicit set obfuscate mode to :string or :block
36
+ # @return [String]
37
+ def obfuscate( text, override_mode = nil )
38
+
39
+ @exec_config = @config.apply( :mode => (override_mode || @config.mode) )
40
+
41
+ obfuscated = nil
42
+ if @exec_config.mode == :string
43
+ obfuscated = @crypt.encrypt_string(text)
44
+ elsif @exec_config.mode == :block
45
+ obfuscated = @crypt.encrypt_block(text.to_s.ljust(8))
46
+ else
47
+ raise "Unsupport Mode"
48
+ end
49
+
50
+ if @exec_config.encode
51
+ obfuscated = URI.escape(Base64.strict_encode64(obfuscated).strip)
52
+ obfuscated = obfuscated.chomp("=") if @exec_config.remove_trailing_equal?
53
+ end
54
+
55
+ obfuscated
56
+ end
57
+
58
+ # Clarify text
59
+ #
60
+ # @param [Symbol] override_mode to explicit set clarify mode to :string or :block
61
+ # @return [String]
62
+ def clarify( text, override_mode = nil )
63
+
64
+ @exec_config = @config.apply( :mode => (override_mode || @config.mode) )
65
+ obfuscated = text.to_s
66
+
67
+
68
+ if @exec_config.encode
69
+ obfuscated << "=" if @exec_config.remove_trailing_equal?
70
+ obfuscated = Base64.strict_decode64( URI.unescape(obfuscated) )
71
+ end
72
+
73
+ if @exec_config.mode == :string
74
+ @crypt.decrypt_string( obfuscated )
75
+ elsif @exec_config.mode == :block
76
+ @crypt.decrypt_block( obfuscated ).strip
77
+ else
78
+ raise "Unsupport Mode"
79
+ end
80
+ end
81
+ end
@@ -0,0 +1,85 @@
1
+ # Licensed to the Apache Software Foundation (ASF) under one or more
2
+ # contributor license agreements. See the NOTICE file distributed with this
3
+ # work for additional information regarding copyright ownership. The ASF
4
+ # licenses this file to you under the Apache License, Version 2.0 (the
5
+ # "License"); you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12
+ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13
+ # License for the specific language governing permissions and limitations under
14
+ # the License.
15
+
16
+ require 'obfuscate/crypt'
17
+
18
+ module Obfuscate
19
+ module Obfuscatable
20
+ extend ActiveSupport::Concern
21
+
22
+ module ClassMethods
23
+
24
+ # Make this Model Obfuscatable. Adds method obfuscate_id which obfuscates the id to 11 characters.
25
+ # Cavaet: Only supports id lengths up to 8 (e.g. 99,999,999) due to use of Blowfish block encryption.
26
+ #
27
+ # @params [Hash] options to override the default config
28
+ # @option options [Symbol] :salt A Model specific salt
29
+ # @option options [Symbol] :encode Enable Base64 and URL encoding for this Model. Enabled by default.
30
+ # @option options [Symbol] :remove_trailing_equal When in :block mode, removes the trailing = from the
31
+ # obfuscated text.
32
+ def obfuscatable(options = {})
33
+ config = Obfuscate.config.apply(options)
34
+
35
+ cattr_accessor :obfuscatable_config
36
+ self.obfuscatable_config = config
37
+
38
+ cattr_accessor :obfuscatable_crypt
39
+ self.obfuscatable_crypt = Obfuscate::Crypt.new( config )
40
+
41
+ define_method :obfuscate_id do
42
+ self.obfuscatable_crypt.obfuscate( self.id, :block )
43
+ end
44
+
45
+ define_method :clarify_id do |text|
46
+ self.class.clarify_id( text )
47
+ end
48
+
49
+ class << self
50
+
51
+ # Find by obfuscated_id
52
+ #
53
+ # @return [Object]
54
+ def find_by_obfuscated_id( text )
55
+ find_by_id( clarify_id( text ) )
56
+ end
57
+
58
+ # Clarifies obfuscated Model id
59
+ # @return [String]
60
+ def clarify_id( text )
61
+ self.obfuscatable_crypt.clarify( text, :block )
62
+ end
63
+
64
+ # Clarify obfuscated text.
65
+ #
66
+ # @param [String] text to clarify
67
+ # @param [Symbol] mode to clarify, defaults to :string
68
+ def clarify( text, mode = :string)
69
+ self.obfuscatable_crypt.clarify(text, mode)
70
+ end
71
+
72
+ #
73
+ # @param [String] text to clarify
74
+ # @param [Symbol] mode to clarify, defaults to :string
75
+ def obfuscate( text, mode = :string)
76
+ self.obfuscatable_crypt.obfuscate(text, mode)
77
+ end
78
+ end
79
+ end
80
+ end
81
+
82
+ end
83
+ end
84
+
85
+ ActiveRecord::Base.send :include, Obfuscate::Obfuscatable
@@ -0,0 +1,18 @@
1
+ # Licensed to the Apache Software Foundation (ASF) under one or more
2
+ # contributor license agreements. See the NOTICE file distributed with this
3
+ # work for additional information regarding copyright ownership. The ASF
4
+ # licenses this file to you under the Apache License, Version 2.0 (the
5
+ # "License"); you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12
+ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13
+ # License for the specific language governing permissions and limitations under
14
+ # the License.
15
+
16
+ module Obfuscate
17
+ VERSION = "0.0.2"
18
+ end
data/obfuscate.gemspec ADDED
@@ -0,0 +1,28 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "obfuscate/version"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = %q{obfuscate}
7
+ s.license = "MIT"
8
+ s.version = Obfuscate::VERSION
9
+ s.platform = Gem::Platform::RUBY
10
+ s.homepage = %q{https://github.com/mguymon/obfuscate}
11
+ s.authors = ["Michael Guymon"]
12
+ s.email = ["mguymon@tobedevoured.com"]
13
+ s.description = %q{Obfuscate}
14
+ s.summary = %q{Obfuscate}
15
+
16
+ s.files = `git ls-files`.split("\n").sort
17
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
18
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
19
+ s.require_paths = ["lib"]
20
+
21
+ s.add_runtime_dependency(%q<crypt19>, ["~> 1.2.0"])
22
+ s.add_development_dependency(%q<rspec>, ["~> 2.12.0"])
23
+ s.add_development_dependency(%q<guard-rspec>, ["~> 2.4.0"])
24
+ s.add_development_dependency(%q<rb-inotify>, ["~> 0.8.8"])
25
+ s.add_development_dependency(%q<activerecord>, ["> 3.0.0"])
26
+ s.add_development_dependency(%q<sqlite3>, ["~> 1.3.0"])
27
+ s.add_development_dependency(%q<yard>, ["~> 0.8.0"])
28
+ end
@@ -0,0 +1,32 @@
1
+ # Licensed to the Apache Software Foundation (ASF) under one or more
2
+ # contributor license agreements. See the NOTICE file distributed with this
3
+ # work for additional information regarding copyright ownership. The ASF
4
+ # licenses this file to you under the Apache License, Version 2.0 (the
5
+ # "License"); you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12
+ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13
+ # License for the specific language governing permissions and limitations under
14
+ # the License.
15
+
16
+ require 'spec_helper'
17
+ require 'obfuscate/config'
18
+
19
+ describe Obfuscate::Config do
20
+
21
+ it "should have default mode" do
22
+ Obfuscate::Config.new.mode.should eql :string
23
+ end
24
+
25
+ it "should have default encode" do
26
+ Obfuscate::Config.new.encode.should be_true
27
+ end
28
+
29
+ it "should have default remove_trailing_equal" do
30
+ Obfuscate::Config.new.remove_trailing_equal.should be_true
31
+ end
32
+ end
@@ -0,0 +1,112 @@
1
+ # Licensed to the Apache Software Foundation (ASF) under one or more
2
+ # contributor license agreements. See the NOTICE file distributed with this
3
+ # work for additional information regarding copyright ownership. The ASF
4
+ # licenses this file to you under the Apache License, Version 2.0 (the
5
+ # "License"); you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12
+ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13
+ # License for the specific language governing permissions and limitations under
14
+ # the License.
15
+
16
+ require 'spec_helper'
17
+ require 'obfuscate/crypt'
18
+ require 'crypt/blowfish'
19
+ require 'base64'
20
+
21
+ describe Obfuscate::Crypt do
22
+
23
+ describe "obfuscate block mode" do
24
+ before(:each) do
25
+ @config = Obfuscate.setup do |config|
26
+ config.salt = "salt-salt-salt"
27
+ config.mode = :block
28
+ end
29
+ end
30
+
31
+ it "should obfuscate" do
32
+ crypt = Obfuscate::Crypt.new( @config )
33
+ crypt.obfuscate("test123").should eql "R35tG3YxSQk"
34
+ end
35
+
36
+ it "should obfuscate including the equality" do
37
+ crypt = Obfuscate::Crypt.new( @config.apply(:remove_trailing_equal => false) )
38
+ crypt.obfuscate("test123").should eql "R35tG3YxSQk="
39
+ end
40
+
41
+ it "should obfuscate without encoding" do
42
+ crypt = Obfuscate::Crypt.new( @config.apply(:encode => false ) )
43
+ crypt.obfuscate("without encoding").should eql "\x8F\xC7\xE4\n,2\xA2\xA7"
44
+ end
45
+
46
+ it "should be able to override mode" do
47
+ crypt = Obfuscate::Crypt.new( @config.apply( :mode => :string ) )
48
+ crypt.obfuscate("test123", :block).should eql "R35tG3YxSQk"
49
+ end
50
+ end
51
+
52
+ describe "obfuscate string mode" do
53
+ before(:each) do
54
+ @config = Obfuscate.setup do |config|
55
+ config.salt = "salt-salt-salt"
56
+ config.mode = :string
57
+ end
58
+ end
59
+
60
+ it "should obfuscate" do
61
+ crypt = Obfuscate::Crypt.new( @config )
62
+ #crypt.obfuscate("test12345678").should eql ""
63
+ crypt.clarify( crypt.obfuscate("test12345678") ).should eql "test12345678"
64
+ end
65
+
66
+ it "should clarify previously obfuscated text" do
67
+ crypt = Obfuscate::Crypt.new( @config )
68
+ crypt.clarify( "j65H1jCTYh2uw/lsHweLXMw50aaENXYI" ).should eql "test12345678"
69
+ crypt.clarify( "4bxm/ijHwq1ekPBYEGFsr+LuJ8EZVa57" ).should eql "test12345678"
70
+ crypt.clarify( "y2D0gT8x3llEToou6PPbKRagVYX1NeVc" ).should eql "test12345678"
71
+ crypt.clarify( "T/graYvZiWE585V9fkJ5HAj1wyOothyo" ).should eql "test12345678"
72
+ end
73
+
74
+
75
+ it "should be able to override mode" do
76
+ crypt = Obfuscate::Crypt.new( @config.apply( :mode => :block ) )
77
+
78
+ # such a weak spec, but the encrypted string will not be the same every time
79
+ crypt.obfuscate("test123", :string).should_not eql "3NINgAbOhPc"
80
+ end
81
+ end
82
+
83
+ describe "clarify" do
84
+ before(:each) do
85
+ @config = Obfuscate.setup do |config|
86
+ config.salt = "salt-salt-salt"
87
+ config.mode = :string
88
+ end
89
+ end
90
+
91
+ it "should clarify" do
92
+ crypt = Obfuscate::Crypt.new( @config )
93
+ enc = crypt.obfuscate("test123456test123456test123456test123456")
94
+ crypt.clarify(enc).should eql "test123456test123456test123456test123456"
95
+ end
96
+
97
+ it "should be able to override mode" do
98
+ crypt = Obfuscate::Crypt.new( @config )
99
+ crypt.clarify( crypt.obfuscate("test123", :block), :block ).should eql "test123"
100
+ end
101
+
102
+ describe "block mode" do
103
+ it "will trim text larger than 8 characters" do
104
+ crypt = Obfuscate::Crypt.new( @config.apply( :mode => :block ) )
105
+ enc = crypt.obfuscate("1234567890")
106
+ crypt.exec_config.mode.should eql :block
107
+
108
+ crypt.clarify(enc).should eql "12345678"
109
+ end
110
+ end
111
+ end
112
+ end
@@ -0,0 +1,64 @@
1
+ # Licensed to the Apache Software Foundation (ASF) under one or more
2
+ # contributor license agreements. See the NOTICE file distributed with this
3
+ # work for additional information regarding copyright ownership. The ASF
4
+ # licenses this file to you under the Apache License, Version 2.0 (the
5
+ # "License"); you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12
+ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13
+ # License for the specific language governing permissions and limitations under
14
+ # the License.
15
+
16
+ require 'spec_helper'
17
+ require 'obfuscate/obfuscatable'
18
+
19
+ describe Obfuscate::Obfuscatable do
20
+
21
+ it "should give a hoot and not pollute" do
22
+ ActiveRecord::Base.method_defined?( :find_by_obfuscated_id ).should be_false
23
+ end
24
+
25
+ it "should have config" do
26
+ Message.obfuscatable_config.salt.should eql "message salt"
27
+ end
28
+
29
+ it "should have obfuscator" do
30
+ Message.obfuscatable_crypt.is_a?( Obfuscate::Crypt ).should be_true
31
+ end
32
+
33
+ it "should obfuscate text" do
34
+ obfuscated = Message.obfuscate( "blah blah blah blah blah blah blah" )
35
+ Message.clarify( obfuscated ).should eql "blah blah blah blah blah blah blah"
36
+ end
37
+
38
+ describe "instance" do
39
+
40
+ let(:model) do
41
+ model = Message.new
42
+ model.text = "Test"
43
+ model.save
44
+
45
+ model
46
+ end
47
+
48
+ it "should obfuscate id" do
49
+ model.obfuscate_id.should_not be nil
50
+ end
51
+
52
+ it "should clarify id" do
53
+ model.clarify_id( model.obfuscate_id ).to_i.should eql model.id
54
+ end
55
+
56
+ it "should find_by_obfuscated_id" do
57
+ Message.find_by_obfuscated_id( model.obfuscate_id ).should eql model
58
+ end
59
+ end
60
+ end
61
+
62
+ class Message < ActiveRecord::Base
63
+ obfuscatable :salt => 'message salt'
64
+ end
@@ -0,0 +1,22 @@
1
+ # Licensed to the Apache Software Foundation (ASF) under one or more
2
+ # contributor license agreements. See the NOTICE file distributed with this
3
+ # work for additional information regarding copyright ownership. The ASF
4
+ # licenses this file to you under the Apache License, Version 2.0 (the
5
+ # "License"); you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12
+ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13
+ # License for the specific language governing permissions and limitations under
14
+ # the License.
15
+
16
+ require 'spec_helper'
17
+
18
+ describe Obfuscate do
19
+ it "should have VERSION" do
20
+ Obfuscate::VERSION.should_not be_nil
21
+ end
22
+ end
@@ -0,0 +1,61 @@
1
+ # Licensed to the Apache Software Foundation (ASF) under one or more
2
+ # contributor license agreements. See the NOTICE file distributed with this
3
+ # work for additional information regarding copyright ownership. The ASF
4
+ # licenses this file to you under the Apache License, Version 2.0 (the
5
+ # "License"); you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12
+ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13
+ # License for the specific language governing permissions and limitations under
14
+ # the License.
15
+
16
+ require 'spec_helper'
17
+ require 'obfuscate'
18
+
19
+ describe Obfuscate do
20
+
21
+
22
+ it "should setup config by block" do
23
+ Obfuscate.setup do |config|
24
+ config.mode = :block
25
+ config.salt = "salty salt"
26
+ end
27
+
28
+ Obfuscate.config.mode.should eql :block
29
+ Obfuscate.config.salt.should eql "salty salt"
30
+ end
31
+
32
+ it "should setup config by hash" do
33
+ Obfuscate.setup :salt => 'less salt', :mode => :string
34
+
35
+ Obfuscate.config.mode.should eql :string
36
+ Obfuscate.config.salt.should eql "less salt"
37
+ end
38
+
39
+ it "should setup config by hash and overriding block" do
40
+ Obfuscate.setup :salt => 'less salt', :mode => :string do |config|
41
+ config.salt = "mega salt"
42
+ config.encode = false
43
+ end
44
+
45
+ Obfuscate.config.mode.should eql :string
46
+ Obfuscate.config.salt.should eql "mega salt"
47
+ Obfuscate.config.encode.should eql false
48
+ end
49
+
50
+ it "should create Crypt" do
51
+ Obfuscate.setup :salt => 'obfuscate-salt', :mode => :string
52
+ Obfuscate.cryptor.should_not be_nil
53
+ end
54
+
55
+ it "should obfuscate and clarify" do
56
+ Obfuscate.setup :salt => 'obfuscate-salt', :mode => :string
57
+ obfuscated = Obfuscate.obfuscate("test obfuscation")
58
+ Obfuscate.clarify(obfuscated).should eql "test obfuscation"
59
+ end
60
+
61
+ end
data/spec/message.rb ADDED
@@ -0,0 +1,22 @@
1
+ # Licensed to the Apache Software Foundation (ASF) under one or more
2
+ # contributor license agreements. See the NOTICE file distributed with this
3
+ # work for additional information regarding copyright ownership. The ASF
4
+ # licenses this file to you under the Apache License, Version 2.0 (the
5
+ # "License"); you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12
+ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13
+ # License for the specific language governing permissions and limitations under
14
+ # the License.
15
+
16
+ require 'obfuscate/obfuscatable'
17
+
18
+ Obfuscate.salt = "default salt"
19
+
20
+ class Message < ActiveRecord::Base
21
+ obfuscatable
22
+ end
@@ -0,0 +1,43 @@
1
+ # Licensed to the Apache Software Foundation (ASF) under one or more
2
+ # contributor license agreements. See the NOTICE file distributed with this
3
+ # work for additional information regarding copyright ownership. The ASF
4
+ # licenses this file to you under the Apache License, Version 2.0 (the
5
+ # "License"); you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12
+ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13
+ # License for the specific language governing permissions and limitations under
14
+ # the License.
15
+
16
+ require 'rubygems'
17
+ require 'active_record'
18
+
19
+ RSpec.configure do |config|
20
+ config.treat_symbols_as_metadata_keys_with_true_values = true
21
+ config.run_all_when_everything_filtered = true
22
+ config.filter_run :focus
23
+
24
+ # Run specs in random order to surface order dependencies. If you find an
25
+ # order dependency and want to debug it, you can fix the order by providing
26
+ # the seed, which is printed after each run.
27
+ # --seed 1234
28
+ config.order = 'random'
29
+ end
30
+
31
+ ActiveRecord::Base.establish_connection(
32
+ :adapter => 'sqlite3',
33
+ :database => ':memory:'
34
+ )
35
+
36
+ ActiveRecord::Schema.define do
37
+ self.verbose = false
38
+
39
+ create_table :messages, :force => true do |t|
40
+ t.string :text
41
+ t.integer :user_id
42
+ end
43
+ end
metadata ADDED
@@ -0,0 +1,180 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: obfuscate
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.2
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Michael Guymon
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2013-02-03 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: crypt19
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ~>
20
+ - !ruby/object:Gem::Version
21
+ version: 1.2.0
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ~>
28
+ - !ruby/object:Gem::Version
29
+ version: 1.2.0
30
+ - !ruby/object:Gem::Dependency
31
+ name: rspec
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ~>
36
+ - !ruby/object:Gem::Version
37
+ version: 2.12.0
38
+ type: :development
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ~>
44
+ - !ruby/object:Gem::Version
45
+ version: 2.12.0
46
+ - !ruby/object:Gem::Dependency
47
+ name: guard-rspec
48
+ requirement: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ~>
52
+ - !ruby/object:Gem::Version
53
+ version: 2.4.0
54
+ type: :development
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ~>
60
+ - !ruby/object:Gem::Version
61
+ version: 2.4.0
62
+ - !ruby/object:Gem::Dependency
63
+ name: rb-inotify
64
+ requirement: !ruby/object:Gem::Requirement
65
+ none: false
66
+ requirements:
67
+ - - ~>
68
+ - !ruby/object:Gem::Version
69
+ version: 0.8.8
70
+ type: :development
71
+ prerelease: false
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ~>
76
+ - !ruby/object:Gem::Version
77
+ version: 0.8.8
78
+ - !ruby/object:Gem::Dependency
79
+ name: activerecord
80
+ requirement: !ruby/object:Gem::Requirement
81
+ none: false
82
+ requirements:
83
+ - - ! '>'
84
+ - !ruby/object:Gem::Version
85
+ version: 3.0.0
86
+ type: :development
87
+ prerelease: false
88
+ version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
91
+ - - ! '>'
92
+ - !ruby/object:Gem::Version
93
+ version: 3.0.0
94
+ - !ruby/object:Gem::Dependency
95
+ name: sqlite3
96
+ requirement: !ruby/object:Gem::Requirement
97
+ none: false
98
+ requirements:
99
+ - - ~>
100
+ - !ruby/object:Gem::Version
101
+ version: 1.3.0
102
+ type: :development
103
+ prerelease: false
104
+ version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
106
+ requirements:
107
+ - - ~>
108
+ - !ruby/object:Gem::Version
109
+ version: 1.3.0
110
+ - !ruby/object:Gem::Dependency
111
+ name: yard
112
+ requirement: !ruby/object:Gem::Requirement
113
+ none: false
114
+ requirements:
115
+ - - ~>
116
+ - !ruby/object:Gem::Version
117
+ version: 0.8.0
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ none: false
122
+ requirements:
123
+ - - ~>
124
+ - !ruby/object:Gem::Version
125
+ version: 0.8.0
126
+ description: Obfuscate
127
+ email:
128
+ - mguymon@tobedevoured.com
129
+ executables: []
130
+ extensions: []
131
+ extra_rdoc_files: []
132
+ files:
133
+ - .gitignore
134
+ - .rspec
135
+ - Gemfile
136
+ - Gemfile.lock
137
+ - Guardfile
138
+ - LICENSE
139
+ - README.md
140
+ - Rakefile
141
+ - lib/obfuscate.rb
142
+ - lib/obfuscate/config.rb
143
+ - lib/obfuscate/crypt.rb
144
+ - lib/obfuscate/obfuscatable.rb
145
+ - lib/obfuscate/version.rb
146
+ - obfuscate.gemspec
147
+ - spec/lib/obfuscate/config_spec.rb
148
+ - spec/lib/obfuscate/crypt_spec.rb
149
+ - spec/lib/obfuscate/ofuscatable_spec.rb
150
+ - spec/lib/obfuscate/version_spec.rb
151
+ - spec/lib/obfuscate_spec.rb
152
+ - spec/message.rb
153
+ - spec/spec_helper.rb
154
+ homepage: https://github.com/mguymon/obfuscate
155
+ licenses:
156
+ - MIT
157
+ post_install_message:
158
+ rdoc_options: []
159
+ require_paths:
160
+ - lib
161
+ required_ruby_version: !ruby/object:Gem::Requirement
162
+ none: false
163
+ requirements:
164
+ - - ! '>='
165
+ - !ruby/object:Gem::Version
166
+ version: '0'
167
+ required_rubygems_version: !ruby/object:Gem::Requirement
168
+ none: false
169
+ requirements:
170
+ - - ! '>='
171
+ - !ruby/object:Gem::Version
172
+ version: '0'
173
+ requirements: []
174
+ rubyforge_project:
175
+ rubygems_version: 1.8.24
176
+ signing_key:
177
+ specification_version: 3
178
+ summary: Obfuscate
179
+ test_files: []
180
+ has_rdoc: