encrypter_decrypter_files 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- OWY4ZWFmMmIwYjc2YjczNDZjZWEzMzYxOTQwOTA5MDYyZWUwZjlhNQ==
4
+ ZjMxYjIwOWZhY2MyZDkwMGU2N2E3YTczYWM3ZjhhOWM4ZjE1MGU2Mg==
5
5
  data.tar.gz: !binary |-
6
- MmU2MjJhYWEzYTQ4ZmU5NjFiZjk5Y2JlNmU5ODAyMDEwMjY2NjM0NQ==
6
+ YTZkNzBmMzdlY2U1MDc4ZmUzYjJlZTAzNTBlNmUzMjJmNzVkYTc0Mg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NjVjNzU3MmU3MDRjZmEzYzI2ODI5MjE0MjUyOGRlMDkzYzlhMjA2Njc4YzZi
10
- NmQzZjZkZjRkOTg1MTAzMTAyYmUwNWQ2YTc1Mjc2OTExODQ2ZDI1MTczMTNl
11
- MDFhMjJmYmMyMzZlNGZkMWY2OGY5OTBiNDJlNmViMmIyMjkxYjM=
9
+ MDRlZGZhMmMyNmVjMWQyZWYyOTM0OWVjZTE0MDQ1YTVlNTA5ZTQyMDg2YWE0
10
+ N2RlMTY5MzI0YTNkNmVlOTY2MGVlNDEyNGE0MDk1ZGRkNmZmMDFiY2ExMjg2
11
+ MGMwOWM5MDgxZWM4ZDMzMThkYTc2NzI0ZmI5YTE4MGExZDg0YTQ=
12
12
  data.tar.gz: !binary |-
13
- Nzg1NTgzZTY4ZDZmNTY1M2Q5MWQzMDI1NTMzMDRhODMxN2ViYTkxMTE3NTM2
14
- MWY0NzJlZjdjMDdhMDg4YjBhMmExZTY4MDc2ZGU5ZGM1ZjdhZTE0MjU2N2Nl
15
- ZDU1ZDBlZGU1MjZlOTgzODc3MmE3YjViMzUzNjJlYzU0MzQ1MmE=
13
+ OTVkODdhNzI2OGQzZGU3MTRiNTJiMTFjMDQ1N2FmMjgxOTU4NmY1ZDA5NTBi
14
+ NTc2MTdjNjFmZTU0NDI0OGM2YmFiOGNhZTdlNmEyMTZlN2YyZjg3MjAyMTY3
15
+ YjkyNTRjMjhhZDJlNjRjNDdiMWI3YWIyYjk5ZGZiZjAxN2Y4Nzg=
@@ -1,5 +1,6 @@
1
1
  class Base
2
2
  def initialize(opts = {})
3
3
  @path = opts[:path]
4
+ @key_size = opts[:key_size] || 256
4
5
  end
5
6
  end
@@ -12,7 +12,7 @@ def trigger_decryption
12
12
  key = data[original_file_name][:key]
13
13
  iv = data[original_file_name][:iv]
14
14
 
15
- cipher = OpenSSL::Cipher.new('aes-256-cbc')
15
+ cipher = OpenSSL::Cipher.new("aes-#{@key_size}-cbc")
16
16
  cipher.decrypt
17
17
  cipher.key = key
18
18
  cipher.iv = iv
@@ -8,7 +8,7 @@ class EDfile < Base
8
8
  end
9
9
 
10
10
  def trigger_encryption
11
- cipher = OpenSSL::Cipher.new('aes-256-cbc')
11
+ cipher = OpenSSL::Cipher.new("aes-#{@key_size}-cbc")
12
12
  cipher.encrypt
13
13
  key = cipher.random_key
14
14
  iv = cipher.random_iv
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: encrypter_decrypter_files
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ankit gupta