naoki 1.0.14 → 1.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/naoki.gemspec +2 -2
- data/sample.rb +10 -37
- metadata +16 -6
data/naoki.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
SPEC = Gem::Specification.new do |s|
|
2
2
|
s.name = "naoki"
|
3
|
-
s.version = "1.0.
|
3
|
+
s.version = "1.0.15"
|
4
4
|
s.platform = Gem::Platform::RUBY
|
5
5
|
s.homepage = ""
|
6
6
|
s.summary = "C bindings for SafeNet DataSecure ICAPI"
|
@@ -9,5 +9,5 @@ SPEC = Gem::Specification.new do |s|
|
|
9
9
|
s.email = ["apolzon@gmail.com"]
|
10
10
|
s.description = "C bindings for SafeNet DataSecure ICAPI"
|
11
11
|
|
12
|
-
s.add_runtime_dependency('ffi'
|
12
|
+
s.add_runtime_dependency('ffi')
|
13
13
|
end
|
data/sample.rb
CHANGED
@@ -1,12 +1,11 @@
|
|
1
|
-
require File.join(File.
|
1
|
+
require File.join(File.expand_path(__FILE__), '../data_secure_wrapper')
|
2
2
|
|
3
3
|
properties_file = 'IngrianNAE.properties'
|
4
|
-
user_name = '
|
5
|
-
password = '
|
6
|
-
algorithm = '
|
7
|
-
key_name = '
|
8
|
-
|
9
|
-
initialization_vector = '1234567890123456'
|
4
|
+
user_name = ''
|
5
|
+
password = ''
|
6
|
+
algorithm = ''
|
7
|
+
key_name = ''
|
8
|
+
initialization_vector = ''
|
10
9
|
|
11
10
|
input_data = 'qwertyuiopasdfghjkl;zxcvbnm,./'
|
12
11
|
|
@@ -14,35 +13,9 @@ input_data = 'qwertyuiopasdfghjkl;zxcvbnm,./'
|
|
14
13
|
|
15
14
|
DataSecureWrapper.configure(properties_file)
|
16
15
|
DataSecureWrapper.open(user_name, password)
|
17
|
-
encrypted_data = DataSecureWrapper.encrypt(algorithm, key_name, initialization_vector, input_data)
|
18
|
-
puts encrypted_data
|
19
|
-
decrypted_data = DataSecureWrapper.decrypt(algorithm, key_name, initialization_vector, 'abc1')
|
20
|
-
exit(0)
|
21
|
-
GC.start
|
22
|
-
puts `ps -o rss= -p #{Process.pid}`.to_i
|
23
|
-
1_000.times do
|
24
|
-
#puts "encrypting: '#{input_data}'"
|
25
|
-
encrypted_data = DataSecureWrapper.encrypt(algorithm, key_name, initialization_vector, input_data)
|
26
|
-
decrypted_data = DataSecureWrapper.decrypt(algorithm, key_name, initialization_vector, encrypted_data)
|
27
|
-
#puts "decrypted: '#{decrypted_data}'"
|
28
|
-
end
|
29
|
-
GC.start
|
30
|
-
puts `ps -o rss= -p #{Process.pid}`.to_i
|
31
|
-
exit(0)
|
32
|
-
|
33
|
-
# enc1 = encrypt with a key that's versioned
|
34
|
-
#enc1 = DataSecureWrapper.encrypt(algorithm, 'stg-encrypt-test2', initialization_vector, input_data)
|
35
|
-
# enc2 = encrypt with an unversioned key of the same value
|
36
|
-
#enc2 = DataSecureWrapper.encrypt(algorithm, 'stg-new-test-key', initialization_vector, input_data)
|
37
|
-
#enc2 = DataSecureWrapper.encrypt(algorithm, 'stg-encrypt-test2', initialization_vector, input_data)
|
38
|
-
#p enc1
|
39
|
-
#puts "Encrypting:\n#{input_data}:"
|
40
|
-
#p enc2
|
41
16
|
|
42
|
-
|
43
|
-
|
44
|
-
decrypted_data = DataSecureWrapper.decrypt(algorithm,
|
45
|
-
puts "
|
46
|
-
decrypted_data = DataSecureWrapper.decrypt(algorithm, 'stg-new-test-key', initialization_vector, enc2)
|
47
|
-
puts "Decrypted 2:\n#{decrypted_data}"
|
17
|
+
puts "encrypting: '#{input_data}'"
|
18
|
+
encrypted_data = DataSecureWrapper.encrypt(algorithm, key_name, initialization_vector, input_data)
|
19
|
+
decrypted_data = DataSecureWrapper.decrypt(algorithm, key_name, initialization_vector, encrypted_data)
|
20
|
+
puts "decrypted: '#{decrypted_data}'"
|
48
21
|
|
metadata
CHANGED
@@ -1,8 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: naoki
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
prerelease:
|
5
|
-
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 1
|
7
|
+
- 0
|
8
|
+
- 15
|
9
|
+
version: 1.0.15
|
6
10
|
platform: ruby
|
7
11
|
authors:
|
8
12
|
- Chris Apolzon
|
@@ -11,7 +15,7 @@ autorequire:
|
|
11
15
|
bindir: bin
|
12
16
|
cert_chain: []
|
13
17
|
|
14
|
-
date: 2011-03-
|
18
|
+
date: 2011-03-29 00:00:00 -07:00
|
15
19
|
default_executable:
|
16
20
|
dependencies:
|
17
21
|
- !ruby/object:Gem::Dependency
|
@@ -20,9 +24,11 @@ dependencies:
|
|
20
24
|
requirement: &id001 !ruby/object:Gem::Requirement
|
21
25
|
none: false
|
22
26
|
requirements:
|
23
|
-
- - "
|
27
|
+
- - ">="
|
24
28
|
- !ruby/object:Gem::Version
|
25
|
-
|
29
|
+
segments:
|
30
|
+
- 0
|
31
|
+
version: "0"
|
26
32
|
type: :runtime
|
27
33
|
version_requirements: *id001
|
28
34
|
description: C bindings for SafeNet DataSecure ICAPI
|
@@ -56,17 +62,21 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
56
62
|
requirements:
|
57
63
|
- - ">="
|
58
64
|
- !ruby/object:Gem::Version
|
65
|
+
segments:
|
66
|
+
- 0
|
59
67
|
version: "0"
|
60
68
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
61
69
|
none: false
|
62
70
|
requirements:
|
63
71
|
- - ">="
|
64
72
|
- !ruby/object:Gem::Version
|
73
|
+
segments:
|
74
|
+
- 0
|
65
75
|
version: "0"
|
66
76
|
requirements: []
|
67
77
|
|
68
78
|
rubyforge_project:
|
69
|
-
rubygems_version: 1.
|
79
|
+
rubygems_version: 1.3.7
|
70
80
|
signing_key:
|
71
81
|
specification_version: 3
|
72
82
|
summary: C bindings for SafeNet DataSecure ICAPI
|