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.
- data/examples/symmetric-encryption.yml +6 -3
- data/lib/symmetric_encryption/reader.rb +12 -0
- data/lib/symmetric_encryption/version.rb +1 -1
- data/lib/symmetric_encryption/writer.rb +8 -0
- data/nbproject/private/private.xml +1 -1
- data/symmetric-encryption-0.7.0.gem +0 -0
- metadata +4 -4
- data/lib/csv_encrypted +0 -1
@@ -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:
|
101
|
-
#encoding:
|
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:
|
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
|
#
|
@@ -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
|
Binary file
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 7
|
8
|
-
-
|
9
|
-
version: 0.7.
|
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-
|
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�
|