hazer 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: dfd84fb3442a1744bc9fbc3e66379f6d664adc31
4
+ data.tar.gz: ccfc26ec9aa09e38df4e39f07e194d850ff6aa46
5
+ SHA512:
6
+ metadata.gz: 4224cc5374769946653a8e27cb2ee47ccb65b51e86014168cfa36e75fd6ce9da5734b7071bec02150f1e0d8c8539fbfd03ad85183e4356c7cb4adbab10d2c7f2
7
+ data.tar.gz: 9f401e2702157c0ef348ccec5175421eb4e50d6f9c78b1fe9bfd1627add77d550b50d9cfd78ffac247f629595cc0c1bd0f7d2cf8a93a6854d0a35dc82c7d601e
@@ -0,0 +1,20 @@
1
+ Copyright 2013 Topspin Media Inc.
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,21 @@
1
+ What is Hazer
2
+ =============
3
+
4
+ A simple obfuscator/de-obfuscator gem
5
+
6
+ How to install
7
+ ==============
8
+
9
+ Run `gem install hazer`, then use the functions `Hazer.encrypt` and `Hazer.decrypt` from your Ruby program.
10
+ For instance:
11
+
12
+ $ Hazer.encrypt 'hello' # >
13
+ $ Hazer.decrypt 'hello' # >
14
+
15
+ How to use from the command line
16
+ ================================
17
+
18
+ Install with `gem install hazer`, then run `hazer -h` for help. Example:
19
+
20
+ $ hazer --encrypt 'hello' # >
21
+ $ hazer --decrypt 'hello' # >
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ begin
4
+ require 'hazer'
5
+ rescue LoadError
6
+ require 'rubygems'
7
+ require 'hazer'
8
+ end
9
+
10
+ require 'hazer/parser'
11
+
12
+ options = Hazer::Parser.parse ARGV
13
+ case options[:mode]
14
+ when :encrypt then puts Hazer.encrypt
15
+ when :decrypt then puts Hazer.decrypt
16
+ end
@@ -0,0 +1,11 @@
1
+ require 'base64'
2
+
3
+ module Hazer
4
+ def self.encrypt(number)
5
+ number
6
+ end
7
+
8
+ def self.decrypt(encrypted)
9
+ encrypted
10
+ end
11
+ end
@@ -0,0 +1,34 @@
1
+ # coding: utf-8
2
+ require 'optparse'
3
+
4
+ class Hazer::Parser
5
+ def self.parse(args)
6
+ options = {mode: :encrypt}
7
+
8
+ opt_parser = OptionParser.new do |opts|
9
+ opts.banner = "Usage: #{File.basename($0)}"
10
+
11
+ opts.separator 'Options:'
12
+
13
+ opts.on('-m', '--mode [MODE]', [:encrypt, :decrypt],
14
+ %q(Encrypt or decrypt the text)) do |m|
15
+ options[:mode] = m
16
+ end
17
+
18
+ opts.separator ''
19
+
20
+ opts.on_tail('-h', '--help', 'Show this message') do
21
+ puts opts
22
+ exit
23
+ end
24
+
25
+ opts.on_tail('--version', 'Show version') do
26
+ puts Hazer::VERSION
27
+ exit
28
+ end
29
+ end
30
+
31
+ opt_parser.parse! args
32
+ options
33
+ end
34
+ end
@@ -0,0 +1,3 @@
1
+ module Hazer
2
+ VERSION = '0.0.1'
3
+ end
metadata ADDED
@@ -0,0 +1,94 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: hazer
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Claudio Baccigalupo
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2013-09-24 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: '1.3'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: '1.3'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ description: Encrypt and decrypt an integer
56
+ email:
57
+ - claudio@topspinmedia.com
58
+ executables:
59
+ - hazer
60
+ extensions: []
61
+ extra_rdoc_files: []
62
+ files:
63
+ - bin/hazer
64
+ - lib/hazer/parser.rb
65
+ - lib/hazer/version.rb
66
+ - lib/hazer.rb
67
+ - MIT-LICENSE
68
+ - README.md
69
+ homepage: https://github.com/topspin/hazer
70
+ licenses:
71
+ - MIT
72
+ metadata: {}
73
+ post_install_message:
74
+ rdoc_options: []
75
+ require_paths:
76
+ - lib
77
+ required_ruby_version: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - '>='
80
+ - !ruby/object:Gem::Version
81
+ version: 1.9.0
82
+ required_rubygems_version: !ruby/object:Gem::Requirement
83
+ requirements:
84
+ - - '>='
85
+ - !ruby/object:Gem::Version
86
+ version: '0'
87
+ requirements: []
88
+ rubyforge_project:
89
+ rubygems_version: 2.1.0
90
+ signing_key:
91
+ specification_version: 4
92
+ summary: Encrypt an integer into a string, then decrypt it.
93
+ test_files: []
94
+ has_rdoc: