symmetric-encryption 3.0.0 → 3.0.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8ef6c56bc1e2a9a0231a0f98f37b4cd4ca485842
4
- data.tar.gz: 52318d2b70e96ecfc6067e35d8c7b3ca0a339933
3
+ metadata.gz: c30cffd6db15e542fee8493edb838e9843906d54
4
+ data.tar.gz: 9e869eb73ce3cba78ff656d049fe3177fdeadea4
5
5
  SHA512:
6
- metadata.gz: 461b4904ad5b16293b4edb7f760486bbaf30a548a04debd3418c04a829d87e03f40db7a665e318e43435d140ed4fcbc07d45953158a23ac9e26c3dd725f894af
7
- data.tar.gz: 100babba3863c0a0b4abcdb800e6b6afe6d56ee66e43c85ff9b5cdb957f931d7660ac462e73014c07b4754df927fb264f0b5d2c77b71da0e2ba88f623c6b68b3
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', !iv_filename.nil?)
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
@@ -1,4 +1,4 @@
1
1
  # encoding: utf-8
2
2
  module SymmetricEncryption #:nodoc
3
- VERSION = "3.0.0"
3
+ VERSION = "3.0.1"
4
4
  end
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.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-19 00:00:00.000000000 Z
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