Module: Zip::AESEncryption
- Included in:
- AESDecrypter
- Defined in:
- lib/zip/crypto/aes_encryption.rb
Overview
:nodoc:
Constant Summary collapse
- VERIFIER_LENGTH =
2
- BLOCK_SIZE =
16
- AUTHENTICATION_CODE_LENGTH =
10
- VERSION_AE_1 =
0x01
- VERSION_AE_2 =
0x02
- VERSIONS =
[ VERSION_AE_1, VERSION_AE_2 ].freeze
- STRENGTH_128_BIT =
0x01
- STRENGTH_192_BIT =
0x02
- STRENGTH_256_BIT =
0x03
- STRENGTHS =
[ STRENGTH_128_BIT, STRENGTH_192_BIT, STRENGTH_256_BIT ].freeze
- BITS =
{ STRENGTH_128_BIT => 128, STRENGTH_192_BIT => 192, STRENGTH_256_BIT => 256 }.freeze
- KEY_LENGTHS =
{ STRENGTH_128_BIT => 16, STRENGTH_192_BIT => 24, STRENGTH_256_BIT => 32 }.freeze
- SALT_LENGTHS =
{ STRENGTH_128_BIT => 8, STRENGTH_192_BIT => 12, STRENGTH_256_BIT => 16 }.freeze
Instance Method Summary collapse
Instance Method Details
#gp_flags ⇒ Object
59 60 61 |
# File 'lib/zip/crypto/aes_encryption.rb', line 59 def gp_flags 0x0001 end |
#header_bytesize ⇒ Object
55 56 57 |
# File 'lib/zip/crypto/aes_encryption.rb', line 55 def header_bytesize @salt_length + VERIFIER_LENGTH end |
#initialize(password, strength) ⇒ Object
47 48 49 50 51 52 53 |
# File 'lib/zip/crypto/aes_encryption.rb', line 47 def initialize(password, strength) @password = password @strength = strength @bits = BITS[@strength] @key_length = KEY_LENGTHS[@strength] @salt_length = SALT_LENGTHS[@strength] end |