symmetric-encryption 3.0.0 → 3.0.1
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c30cffd6db15e542fee8493edb838e9843906d54
|
4
|
+
data.tar.gz: 9e869eb73ce3cba78ff656d049fe3177fdeadea4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2caf1f8d69a160d78c372d61d0c2267e58416ab470ad955f7a6d2e7a381798649d68ff054dd3065a318bfb510aa86606bd4e609061bd602ac3cf7486b505294a
|
7
|
+
data.tar.gz: 0cd59f67247763283ae7320971477a064489b5a551fd15fa0e14f12cb8d56ec4d6a8e479b28bd6cf94a1396f3cb10aee9ad3f551f7cb266e0cd5baf7f1948734
|
@@ -259,6 +259,24 @@ module SymmetricEncryption
|
|
259
259
|
return unless has_header?(buffer)
|
260
260
|
|
261
261
|
# Header includes magic header and version byte
|
262
|
+
#
|
263
|
+
# The encryption header consists of:
|
264
|
+
# 4 Byte Magic Header Prefix: @Enc
|
265
|
+
# Followed by 2 Bytes (16 bits)
|
266
|
+
# Bit 0 through 7: The version of the cipher used to encrypt the header
|
267
|
+
# Bit 8 though 10: Reserved
|
268
|
+
# Bit 11: Whether the encrypted data is Binary (otherwise UTF8 text)
|
269
|
+
# Bit 12: Whether the Cipher Name is included
|
270
|
+
# Bit 13: Whether the Key is included
|
271
|
+
# Bit 14: Whether the IV is included
|
272
|
+
# Bit 15: Whether the data is compressed
|
273
|
+
# 2 Byte IV Length if included
|
274
|
+
# IV in binary form
|
275
|
+
# 2 Byte Key Length if included
|
276
|
+
# Key in binary form
|
277
|
+
# 2 Byte Cipher Name Length if included
|
278
|
+
# Cipher name it UTF8 text
|
279
|
+
|
262
280
|
# Remove header and extract flags
|
263
281
|
_, flags = buffer.slice!(0..MAGIC_HEADER_SIZE+1).unpack(MAGIC_HEADER_UNPACK)
|
264
282
|
compressed = (flags & 0b1000_0000_0000_0000) != 0
|
@@ -248,7 +248,7 @@ module SymmetricEncryption
|
|
248
248
|
|
249
249
|
# Generate a new Symmetric Key pair
|
250
250
|
iv_filename = cipher_cfg[:iv_filename]
|
251
|
-
key_pair = SymmetricEncryption::Cipher.random_key_pair(cipher_name || 'aes-256-cbc'
|
251
|
+
key_pair = SymmetricEncryption::Cipher.random_key_pair(cipher_name || 'aes-256-cbc')
|
252
252
|
|
253
253
|
if key_filename = cipher_cfg[:key_filename]
|
254
254
|
# Save symmetric key after encrypting it with the private RSA key, backing up existing files if present
|
data/test/test_db.sqlite3
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: symmetric-encryption
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Reid Morrison
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-09-
|
11
|
+
date: 2013-09-20 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: SymmetricEncryption supports encrypting ActiveRecord data, Mongoid data,
|
14
14
|
passwords in configuration files, encrypting and decrypting of large files through
|