-
Notifications
You must be signed in to change notification settings - Fork 10
/
ruby-mcrypt.gemspec
144 lines (113 loc) · 4.15 KB
/
ruby-mcrypt.gemspec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
# Generated by jeweler
# DO NOT EDIT THIS FILE DIRECTLY
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
# -*- encoding: utf-8 -*-
Gem::Specification.new do |s|
s.name = %q{ruby-mcrypt}
s.version = "0.2.0"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Philip Garrett"]
s.date = %q{2013-02-24}
s.description = %q{= Mcrypt - libmcrypt bindings for Ruby
Mcrypt provides Ruby-language bindings for libmcrypt(3), a
symmetric cryptography library. {Libmcrypt}[http://mcrypt.sourceforge.net/]
supports lots of different ciphers and encryption modes.
== You will need
* A working Ruby installation (>= 1.8.6 or 1.9)
* A working libmcrypt installation (2.5.x or 2.6.x, tested with 2.5.8)
* A sane build environment
== Installation
Install the gem:
gem install ruby-mcrypt --test -- --with-mcrypt-dir=/path/to/mcrypt/prefix
If you're installing on Ubuntu:
sudo apt-get install mcrypt libmcrypt-dev
gem install ruby-mcrypt
If you want to run the longer test suite, do this instead:
MCRYPT_TEST_BRUTE=1 \
gem install ruby-mcrypt --test -- --with-mcrypt-dir=/path/to/mcrypt/prefix
Put this in your code:
require 'rubygems'
require 'mcrypt'
Or in Rails' environment.rb:
gem "ruby-mcrypt", :lib => "mcrypt"
== Usage
crypto = Mcrypt.new(:twofish, :cbc, MY_KEY, MY_IV, :pkcs)
# encryption and decryption in one step
ciphertext = crypto.encrypt(plaintext)
plaintext = crypto.decrypt(ciphertext)
# encrypt in smaller steps
while chunk = $stdin.read(4096)
$stdout << crypto.encrypt_more(chunk)
end
$stdout << crypto.encrypt_finish
# or decrypt:
while chunk = $stdin.read(4096)
$stdout << crypto.decrypt_more(chunk)
end
$stdout << crypto.decrypt_finish
== Known Issues
* Test coverage is lacking.
If you find any bugs, please let the author know.
== Wish List
* IO-like behavior, e.g. crypto.open($stdin) { |stream| ... }
== Author
* Philip Garrett <philgarr at gmail.com>
== Copyright and License
Copyright (c) 2009-2013 Philip Garrett.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
}
s.email = %q{[email protected]}
s.extensions = ["ext/extconf.rb"]
s.extra_rdoc_files = [
"README.rdoc"
]
s.files = [
"Manifest",
"README.rdoc",
"Rakefile",
"VERSION",
"cross.sh",
"ext/.gitignore",
"ext/extconf.rb",
"ext/mcrypt_wrapper.c",
"lib/.gitignore",
"lib/mcrypt.rb",
"ruby-mcrypt.gemspec",
"test/generate/.gitignore",
"test/generate/Makefile",
"test/generate/generate_testcases.c",
"test/helper.rb",
"test/test_basics.rb",
"test/test_brute.rb",
"test/test_reciprocity.rb"
]
s.homepage = %q{http://github.com/kingpong/ruby-mcrypt}
s.require_paths = ["lib"]
s.required_ruby_version = Gem::Requirement.new(">= 1.8.6")
s.requirements = ["libmcrypt (2.5.x or 2.6.x, tested with 2.5.8)"]
s.rubygems_version = %q{1.3.6}
s.summary = %q{Ruby bindings for libmcrypt}
if s.respond_to? :specification_version then
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
s.specification_version = 3
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
else
end
else
end
end