naoki 1.0.14 → 1.0.15

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/naoki.gemspec +2 -2
  2. data/sample.rb +10 -37
  3. 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.14"
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', ['0.6.3'])
12
+ s.add_runtime_dependency('ffi')
13
13
  end
data/sample.rb CHANGED
@@ -1,12 +1,11 @@
1
- require File.join(File.dirname(__FILE__), 'lib/data_secure_wrapper')
1
+ require File.join(File.expand_path(__FILE__), '../data_secure_wrapper')
2
2
 
3
3
  properties_file = 'IngrianNAE.properties'
4
- user_name = 'stg-MySQL_user2'
5
- password = 'y)$)=M_-c52#!_2'
6
- algorithm = 'AES/CBC/PKCS5Padding'
7
- key_name = 'stg-new-test-key' # versioned key
8
- #key_name = "stg-encrypt-test1" #non-versioned key
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
- enc1 = "\x10\x00\x10k\xBFy\xF6\x8B\xB5\x17\x9F!KWvB\xA6#\xA1_\x10V2\vC\v\xE4\x9F\r\x9A\xDE\xB8\x10R%"
43
- enc2 = "\x10\x00 ]\xAD\xDFJDa\x10\xB3\x98\xC0\tT\xC4\x1E\xECs\xAA\xE5\xD7B\xF1CWS]N\x16\fdM\"\xA9"
44
- decrypted_data = DataSecureWrapper.decrypt(algorithm, 'stg-new-test-key', initialization_vector, enc1)
45
- puts "Decrypted 1:\n#{decrypted_data}"
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
- version: 1.0.14
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-28 00:00:00 -07:00
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
- version: 0.6.3
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.5.2
79
+ rubygems_version: 1.3.7
70
80
  signing_key:
71
81
  specification_version: 3
72
82
  summary: C bindings for SafeNet DataSecure ICAPI