symmetric-encryption 0.7.0 → 0.7.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -93,12 +93,15 @@ production:
93
93
  # Encrypted data is returned in base64 encoding format
94
94
  # Symmetric::Encryption.decrypt will also base64 decode any data prior
95
95
  # to decrypting it
96
+ # base64withoutsuffix
97
+ # As base64 except that the trailing newline is removed after base64
98
+ # encoding
96
99
  # binary
97
100
  # Encrypted data is returned as raw binary
98
101
  # Although smaller than base64 it cannot be stored in MySQL text columns
99
102
  # It can only be held in binary columns such as BINARY or BLOB
100
- # Default: base64
101
- #encoding: base64
103
+ # Default: base64withoutsuffix
104
+ #encoding: base64withoutsuffix
102
105
 
103
106
  # OPTIONAL:
104
107
  #
@@ -108,4 +111,4 @@ production:
108
111
  # to be used
109
112
  - key_filename: /etc/rails/.rails_old.key
110
113
  iv_filename: /etc/rails/.rails_old.iv
111
- cipher: aes-256-cbc
114
+ cipher: aes-256-cbc
@@ -131,6 +131,18 @@ module SymmetricEncryption
131
131
  @ios.close if close_child_stream
132
132
  end
133
133
 
134
+ # Flush the read stream
135
+ # Needed by XLS gem
136
+ def flush
137
+ @ios.flush
138
+ end
139
+
140
+ # Return the size of the file rounded up to the nearest encryption block size
141
+ # Needed by XLS gem
142
+ def size
143
+ @ios.size
144
+ end
145
+
134
146
  # Read from the stream and return the decrypted data
135
147
  # See IOS#read
136
148
  #
@@ -1,4 +1,4 @@
1
1
  # encoding: utf-8
2
2
  module SymmetricEncryption #:nodoc
3
- VERSION = "0.7.0"
3
+ VERSION = "0.7.1"
4
4
  end
@@ -131,6 +131,14 @@ module SymmetricEncryption
131
131
  self
132
132
  end
133
133
 
134
+ # Flush the output stream
135
+ # Does not flush internal buffers since encryption requires all data to
136
+ # be written following the encryption block size
137
+ # Needed by XLS gem
138
+ def flush
139
+ @ios.flush
140
+ end
141
+
134
142
  private
135
143
 
136
144
  # Write the Encryption header if this is the first write
@@ -7,7 +7,7 @@
7
7
  </file>
8
8
  <file>
9
9
  <url>lib/symmetric_encryption/symmetric_encryption.rb</url>
10
- <line>60</line>
10
+ <line>69</line>
11
11
  </file>
12
12
  <file>
13
13
  <url>lib/symmetric_encryption/encryption.rb</url>
Binary file
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 7
8
- - 0
9
- version: 0.7.0
8
+ - 1
9
+ version: 0.7.1
10
10
  platform: ruby
11
11
  authors:
12
12
  - Reid Morrison
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2012-04-30 00:00:00 -04:00
17
+ date: 2012-05-18 00:00:00 -04:00
18
18
  default_executable:
19
19
  dependencies: []
20
20
 
@@ -32,7 +32,6 @@ files:
32
32
  - csv_encrypted
33
33
  - csv_encrypted_zip
34
34
  - examples/symmetric-encryption.yml
35
- - lib/csv_encrypted
36
35
  - lib/symmetric-encryption.rb
37
36
  - lib/symmetric_encryption/cipher.rb
38
37
  - lib/symmetric_encryption/extensions/active_record/base.rb
@@ -53,6 +52,7 @@ files:
53
52
  - nbproject/project.xml
54
53
  - Rakefile
55
54
  - README.md
55
+ - symmetric-encryption-0.7.0.gem
56
56
  - test/attr_encrypted_test.rb
57
57
  - test/cipher_test.rb
58
58
  - test/config/database.yml
data/lib/csv_encrypted DELETED
@@ -1 +0,0 @@
1
- "������ W��ga�