crypt-fog 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +6 -0
- data/MANIFEST +8 -11
- data/README +7 -7
- data/Rakefile +31 -0
- data/bin/{quickenc → fogenc} +13 -13
- data/lib/crypt/fog.rb +1 -2
- data/test/tc_fog.rb +14 -21
- metadata +29 -24
data/CHANGES
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
== 1.0.1 - 1-Aug-2007
|
2
|
+
* Changed 'quickenc' to 'fogenc'
|
3
|
+
* Now includes a Rakefile with tasks for installation and testing.
|
4
|
+
* There are now comments in the source, though they are still obfuscated.
|
5
|
+
* Some doc updates.
|
6
|
+
|
1
7
|
== 1.0.0 - 12-Jun-2005
|
2
8
|
* Moved project to RubyForge.
|
3
9
|
* Removed the 'doc' directory. Because the documentation is so short, that
|
data/MANIFEST
CHANGED
@@ -1,11 +1,8 @@
|
|
1
|
-
MANIFEST
|
2
|
-
CHANGES
|
3
|
-
README
|
4
|
-
|
5
|
-
crypt-fog.gemspec
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
lib/crypt/fog.rb
|
10
|
-
|
11
|
-
test/tc_fog.rb
|
1
|
+
* MANIFEST
|
2
|
+
* CHANGES
|
3
|
+
* README
|
4
|
+
* Rakefile
|
5
|
+
* crypt-fog.gemspec
|
6
|
+
* bin/fogenc
|
7
|
+
* lib/crypt/fog.rb
|
8
|
+
* test/tc_fog.rb
|
data/README
CHANGED
@@ -8,18 +8,18 @@
|
|
8
8
|
scheme.
|
9
9
|
|
10
10
|
In addition to the module, a stand-alone program is included called
|
11
|
-
"
|
11
|
+
"fogenc" that takes both a string and a number as arguments and returns
|
12
12
|
your encrypted string. You can then copy/paste that string to a .rc file.
|
13
13
|
Just remember the number you picked in order to decrypt it.
|
14
14
|
|
15
|
-
Usage: ruby
|
16
|
-
ruby
|
15
|
+
Usage: ruby fogenc.rb -s "hello" -d 1688
|
16
|
+
ruby fogenc.rb -f "test.txt" -d 1066
|
17
17
|
|
18
18
|
Modify the shebang line as needed.
|
19
19
|
|
20
20
|
== Installation
|
21
|
-
|
22
|
-
|
21
|
+
rake test (optional)
|
22
|
+
rake install (non-gem) rake install_gem (gem)
|
23
23
|
|
24
24
|
== Synopsis
|
25
25
|
include Crypt
|
@@ -31,7 +31,7 @@
|
|
31
31
|
|
32
32
|
== Constants
|
33
33
|
VERSION
|
34
|
-
The current version of the
|
34
|
+
The current version of the library, returned as a String.
|
35
35
|
|
36
36
|
== Class Methods
|
37
37
|
Fog.new(string, degree=13)
|
@@ -53,7 +53,7 @@ Fog#decrypt
|
|
53
53
|
Ruby's
|
54
54
|
|
55
55
|
== Copyright
|
56
|
-
(C) 2003-
|
56
|
+
(C) 2003-2007 Daniel J. Berger
|
57
57
|
All rights reserved.
|
58
58
|
|
59
59
|
== Author
|
data/Rakefile
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
require 'rake'
|
2
|
+
require 'rake/testtask'
|
3
|
+
include Config
|
4
|
+
|
5
|
+
desc "Install the crypt-fog package (non-gem) and the fogenc program"
|
6
|
+
task :install do
|
7
|
+
dest = File.join(CONFIG['sitelibdir'], 'crypt')
|
8
|
+
Dir.mkdir(dest) unless File.exists? dest
|
9
|
+
cp 'lib/crypt/fog.rb', dest, :verbose => true
|
10
|
+
cp 'bin/fogenc', CONFIG['bindir'], :verbose => true
|
11
|
+
end
|
12
|
+
|
13
|
+
desc "Install the crypt-fog library (non-gem) only"
|
14
|
+
task :install_lib do
|
15
|
+
dest = File.join(CONFIG['sitelibdir'], 'crypt')
|
16
|
+
Dir.mkdir(dest) unless File.exists? dest
|
17
|
+
cp 'lib/crypt/fog.rb', dest, :verbose => true
|
18
|
+
end
|
19
|
+
|
20
|
+
desc "Install the crypt-fog package as a gem"
|
21
|
+
task :install_gem do
|
22
|
+
ruby 'crypt-fog.gemspec'
|
23
|
+
file = Dir["*.gem"].first
|
24
|
+
sh "gem install #{file}"
|
25
|
+
end
|
26
|
+
|
27
|
+
Rake::TestTask.new do |t|
|
28
|
+
t.libs << 'lib'
|
29
|
+
t.warning = true
|
30
|
+
t.test_files = FileList['test/tc*']
|
31
|
+
end
|
data/bin/{quickenc → fogenc}
RENAMED
@@ -1,30 +1,30 @@
|
|
1
|
-
#!/usr/
|
1
|
+
#!/usr/bin/env ruby
|
2
2
|
#
|
3
3
|
# This script allows you to encode a string or file using the
|
4
4
|
# crypt-fog Ruby package.
|
5
5
|
#
|
6
6
|
# Author:
|
7
|
-
#
|
7
|
+
# Daniel J. Berger
|
8
8
|
#
|
9
9
|
# Warranty:
|
10
|
-
#
|
11
|
-
#
|
12
|
-
#
|
10
|
+
# This package is provided "as is" and without any express or
|
11
|
+
# implied warranties, including, without limitation, the implied
|
12
|
+
# warranties of merchantability and fitness for a particular purpose.
|
13
13
|
#
|
14
14
|
# License: Ruby's
|
15
15
|
#
|
16
|
-
# Copyright: (C) 2003-
|
17
|
-
|
18
|
-
require
|
19
|
-
require
|
16
|
+
# Copyright: (C) 2003-2007 Daniel J. Berger. All rights reserved.
|
17
|
+
#
|
18
|
+
require 'getoptlong'
|
19
|
+
require 'crypt/fog'
|
20
20
|
include Crypt
|
21
21
|
|
22
|
-
|
22
|
+
FOGENC_VERSION = 1.2
|
23
23
|
|
24
24
|
def usage
|
25
25
|
print <<-HELP
|
26
|
-
Usage:
|
27
|
-
|
26
|
+
Usage: fogenc -f <filename> -d <salt>
|
27
|
+
fogenc -s <string> -d <salt>
|
28
28
|
HELP
|
29
29
|
exit
|
30
30
|
end
|
@@ -46,7 +46,7 @@ rescue GetoptLong::InvalidOption
|
|
46
46
|
end
|
47
47
|
|
48
48
|
if opts["--version"]
|
49
|
-
puts "VERSION: " +
|
49
|
+
puts "VERSION: " + FOGENC_VERSION.to_s
|
50
50
|
exit
|
51
51
|
end
|
52
52
|
|
data/lib/crypt/fog.rb
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
module Crypt
|
2
2
|
|
3
|
-
#
|
4
|
-
module_eval("\024\035\022$$\321\367 \030\321\355\321\004%#\032\037\030\273\321\321\321\a\366\003\004\372\000\377\321\356\321\323\342\337\341\337\341\323\273\321\321\321\025\026\027\321\032\037\032%\032\022\035\032+\026\331$%#\032\037\030\335\321\025\026\030#\026\026\356\342\344\332\273\321\321\321\321\321\321\361\025\026\030#\026\026\321\356\321\025\026\030#\026\026\337% \020\032\273\321\321\321\321\321\321$%#\321\356\321\026\037\024#*!%\331$%#\032\037\030\335\321\025\026\030#\026\026\332\273\321\321\321\321\321\321$&!\026#\331$%#\332\273\321\321\321\026\037\025\273\273\321\321\321\025\026\027\321\025\026\024#*!%\273\321\321\321\321\321\321&\037!\022\024\034\331\323\364\333\323\332\337\036\022!,\321-\026-\321\026\321\336\356\321\361\025\026\030#\026\026\321.\337!\022\024\034\331\323\364\333\323\332\273\321\321\321\026\037\025\273\273\321\321\321\025\026\027\321% \020$\273\321\321\321\321\321\321$\026\035\027\337\032\037$!\026\024%\273\321\321\321\026\037\025\273\273\321\321\321\025\026\027\321$\026\035\027\337\025\026\024#*!%\331$%#\335\321\025\026\030#\026\026\356\342\344\332\273\321\321\321\321\321\321$%#\337&\037!\022\024\034\331\323\364\333\323\332\337\036\022!,\321-\026-\321\026\321\336\356\321\025\026\030#\026\026\321.\337!\022\024\034\331\323\364\333\323\332\273\321\321\321\026\037\025\273\273\321\321\321!#\032'\022%\026\273\273\321\321\321\025\026\027\321\026\037\024#*!%\331$%#\356$\026\035\027\335\321\025\026\030#\026\026\356\361\025\026\030#\026\026\332\273\321\321\321\321\321\321$%#\337&\037!\022\024\034\331\323\364\333\323\332\337\036\022!,\321-\026-\321\026\321\334\356\321\025\026\030#\026\026\321.\337!\022\024\034\331\323\364\333\323\332\273\321\321\321\026\037\025\273\026\037\025\273".unpack("C*").map{ |e| e -= 1969 }.pack("C*"))
|
3
|
+
module_eval("\024\035\022$$\321\367 \030\321\355\321\004%#\032\037\030\273\321\321\321\a\366\003\004\372\000\377\321\356\321\330\342\337\341\337\342\330\273\273\321\321\321\324\321\003\026%&#\037$\321\022\037\321\026\037\024#*!%\026\025\321\334$%#\032\037\030\334\321\023\022$\026\025\321 \037\321%\031\026\321\334\025\026\030#\026\026\334\321%\031\022%\321* &\321!\022$$\337\321\005\031\026\273\321\321\321\324\321\025\026\027\022&\035%\321\025\026\030#\026\026\321\032$\321\342\344\337\321\005\031\026\321\334\025\026\030#\026\026\334\321\032$\321\036 #\026\321 #\321\035\026$$\321\022\321$\022\035%\321'\022\035&\026\337\273\321\321\321\324\273\321\321\321\025\026\027\321\032\037\032%\032\022\035\032+\026\331$%#\032\037\030\335\321\025\026\030#\026\026\356\342\344\332\273\321\321\321\321\321\321\361\025\026\030#\026\026\321\356\321\025\026\030#\026\026\337% \020\032\273\321\321\321\321\321\321$%#\321\356\321\026\037\024#*!%\331$%#\032\037\030\335\321\025\026\030#\026\026\332\273\321\321\321\321\321\321$&!\026#\331$%#\332\273\321\321\321\026\037\025\273\273\321\321\321\324\321\365\026\024#*!%$\321%\031\026\321$%#\032\037\030\321&$\032\037\030\321%\031\026\321\334\025\026\030#\026\026\334\321!\022$$\026\025\321% \321%\031\026\321\024 \037$%#&\024% #\337\273\321\321\321\324\273\321\321\321\025\026\027\321\025\026\024#*!%\273\321\321\321\321\321\321&\037!\022\024\034\331\330\364\333\330\332\337\036\022!,\321-\026-\321\026\321\336\356\321\361\025\026\030#\026\026\321.\337!\022\024\034\331\330\364\333\330\332\273\321\321\321\026\037\025\273\273\321\321\321\324\321\005\031\026\321% \020$\321\036\026%\031 \025\321\032$\321\032\025\026\037%\032\024\022\035\321% \321\032\037$!\026\024%\335\321\032\037\321 #\025\026#\321% \321!#\026'\026\037%\321%\031\026\273\321\321\321\324\321\035\032%\026#\022\035\321\"& %\022%\032 \037\321\036\022#\034$\321\027# \036\321! %\026\037%\032\022\035\035*\321\036\026$$\032\037\030\321&!\321%\031\032\037\030$\337\273\321\321\321\324\273\321\321\321\025\026\027\321% \020$\273\321\321\321\321\321\321\032\037$!\026\024%\273\321\321\321\026\037\025\273\273\321\321\321\324\321\365\026\024#*!%$\321\022\037\321\022#\023\032%#\022#*\321$%#\032\037\030\321&$\032\037\030\321\334\025\026\030#\026\026\334\337\321\n &\321\036&$%\321\034\037 (\321%\031\026\321\025\026\030#\026\026\273\321\321\321\324\321(\032%\031\321(\031\032\024\031\321%\031\026\321$%#\032\037\030\321(\022$\321 #\032\030\032\037\022\035\035*\321\026\037\024#*!%\026\025\321\032\037\321 #\025\026#\321\027 #\321%\031\032$\321\036\026%\031 \025\273\321\321\321\324\321% \321( #\034\321!# !\026#\035*\337\273\321\321\321\324\273\321\321\321\025\026\027\321$\026\035\027\337\025\026\024#*!%\331$%#\032\037\030\335\321\025\026\030#\026\026\356\342\344\332\273\321\321\321\321\321\321$%#\032\037\030\337&\037!\022\024\034\331\330\364\333\330\332\337\036\022!,\321-\026-\321\026\321\336\356\321\025\026\030#\026\026\321.\337!\022\024\034\331\330\364\333\330\332\273\321\321\321\026\037\025\273\273\321\321\321!#\032'\022%\026\273\273\321\321\321\324\321\362\321!#\032'\022%\026\321\036\026%\031 \025\321&$\026\025\321% \321\026\037\024#*!%\321\022\321$%#\032\037\030\321\023\022$\026\025\321 \037\321\334\025\026\030#\026\026\334\337\273\321\321\321\324\273\321\321\321\025\026\027\321\026\037\024#*!%\331$%#\356$\026\035\027\335\321\025\026\030#\026\026\356\361\025\026\030#\026\026\332\273\321\321\321\321\321\321$%#\337&\037!\022\024\034\331\330\364\333\330\332\337\036\022!,\321-\026-\321\026\321\334\356\321\025\026\030#\026\026\321.\337!\022\024\034\331\330\364\333\330\332\273\321\321\321\026\037\025\273\026\037\025".unpack("C*").map{ |e| e -= 1969 }.pack("C*"))
|
5
4
|
|
6
5
|
end
|
data/test/tc_fog.rb
CHANGED
@@ -3,51 +3,44 @@
|
|
3
3
|
#
|
4
4
|
# Test suite for crypt-fog.
|
5
5
|
#############################
|
6
|
-
base = File.basename(Dir.pwd)
|
7
|
-
|
8
|
-
if base == "test" || base =~ /crypt-fog/
|
9
|
-
Dir.chdir("..") if base == "test"
|
10
|
-
$LOAD_PATH.unshift Dir.pwd
|
11
|
-
$LOAD_PATH.unshift Dir.pwd + "/lib"
|
12
|
-
end
|
13
|
-
|
14
6
|
require "test/unit"
|
15
7
|
require "crypt/fog"
|
16
8
|
include Crypt
|
17
9
|
|
18
10
|
class TC_Fog < Test::Unit::TestCase
|
19
11
|
def setup
|
20
|
-
@
|
12
|
+
@fog = Fog.new("hello")
|
21
13
|
end
|
22
14
|
|
23
15
|
def test_version
|
24
|
-
assert_equal(
|
16
|
+
assert_equal('1.0.1', Fog::VERSION)
|
25
17
|
end
|
26
18
|
|
27
19
|
def test_constructor
|
28
|
-
assert_nothing_raised{ Fog.new(
|
29
|
-
assert_nothing_raised{ Fog.new(
|
20
|
+
assert_nothing_raised{ Fog.new('string') }
|
21
|
+
assert_nothing_raised{ Fog.new('string', 55) }
|
22
|
+
assert_kind_of(String, Fog.new('string'))
|
30
23
|
end
|
31
24
|
|
32
25
|
def test_class_decrypt
|
33
26
|
assert_respond_to(Fog, :decrypt)
|
34
|
-
assert_nothing_raised{ Fog.decrypt(
|
35
|
-
assert_nothing_raised{ Fog.decrypt(
|
36
|
-
assert_equal(
|
27
|
+
assert_nothing_raised{ Fog.decrypt('string') }
|
28
|
+
assert_nothing_raised{ Fog.decrypt('string', 66) }
|
29
|
+
assert_equal('hello', Fog.decrypt(';8??B', 2003))
|
37
30
|
end
|
38
31
|
|
39
32
|
def test_instance_decrypt
|
40
|
-
assert_respond_to(@
|
41
|
-
assert_nothing_raised{ @
|
42
|
-
assert_equal(
|
33
|
+
assert_respond_to(@fog, :decrypt)
|
34
|
+
assert_nothing_raised{ @fog.decrypt }
|
35
|
+
assert_equal('hello', @fog.decrypt)
|
43
36
|
end
|
44
37
|
|
45
38
|
def test_types
|
46
|
-
assert_kind_of(Crypt::Fog, @
|
47
|
-
assert_kind_of(String, @
|
39
|
+
assert_kind_of(Crypt::Fog, @fog)
|
40
|
+
assert_kind_of(String, @fog.decrypt)
|
48
41
|
end
|
49
42
|
|
50
43
|
def teardown
|
51
|
-
@
|
44
|
+
@fog = nil
|
52
45
|
end
|
53
46
|
end
|
metadata
CHANGED
@@ -1,15 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
|
-
rubygems_version: 0.
|
2
|
+
rubygems_version: 0.9.4
|
3
3
|
specification_version: 1
|
4
4
|
name: crypt-fog
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 1.0.
|
7
|
-
date:
|
8
|
-
summary:
|
9
|
-
It's primary goal is to provide a reasonable amount of obfuscation without
|
10
|
-
having to resort to public/private key exchanges, etc."
|
6
|
+
version: 1.0.1
|
7
|
+
date: 2007-08-01 00:00:00 -06:00
|
8
|
+
summary: crypt-fog is a simple encryption mechanism, but slightly better than Rot13. It's primary goal is to provide a reasonable amount of obfuscation without having to resort to public/private key exchanges, etc.
|
11
9
|
require_paths:
|
12
|
-
|
10
|
+
- lib
|
13
11
|
email: djberg96@gmail.com
|
14
12
|
homepage: http://www.rubyforge.org/projects/shards
|
15
13
|
rubyforge_project:
|
@@ -20,30 +18,37 @@ bindir: bin
|
|
20
18
|
has_rdoc: true
|
21
19
|
required_ruby_version: !ruby/object:Gem::Version::Requirement
|
22
20
|
requirements:
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
version: 0.0.0
|
21
|
+
- - ">"
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: 0.0.0
|
27
24
|
version:
|
28
25
|
platform: ruby
|
26
|
+
signing_key:
|
27
|
+
cert_chain:
|
28
|
+
post_install_message:
|
29
29
|
authors:
|
30
|
-
|
30
|
+
- Daniel J. Berger
|
31
31
|
files:
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
32
|
+
- lib/crypt/fog.rb
|
33
|
+
- CHANGES
|
34
|
+
- MANIFEST
|
35
|
+
- README
|
36
|
+
- Rakefile
|
37
|
+
- test/tc_fog.rb
|
37
38
|
test_files:
|
38
|
-
|
39
|
+
- test/tc_fog.rb
|
39
40
|
rdoc_options:
|
40
|
-
|
41
|
-
|
41
|
+
- --main
|
42
|
+
- README
|
42
43
|
extra_rdoc_files:
|
43
|
-
|
44
|
-
|
44
|
+
- README
|
45
|
+
- CHANGES
|
46
|
+
- MANIFEST
|
45
47
|
executables:
|
46
|
-
|
48
|
+
- fogenc
|
47
49
|
extensions: []
|
50
|
+
|
48
51
|
requirements: []
|
49
|
-
|
52
|
+
|
53
|
+
dependencies: []
|
54
|
+
|