Class: Zip::TraditionalEncrypter
Instance Method Summary
collapse
#gp_flags, #header_bytesize, #initialize
Instance Method Details
#data_descriptor(crc32, compressed_size, uncomprssed_size) ⇒ Object
56
57
58
|
# File 'lib/zip/crypto/traditional_encryption.rb', line 56
def data_descriptor(crc32, compressed_size, )
[0x08074b50, crc32, compressed_size, ].pack('VVVV')
end
|
#encrypt(data) ⇒ Object
52
53
54
|
# File 'lib/zip/crypto/traditional_encryption.rb', line 52
def encrypt(data)
data.unpack('C*').map { |x| encode x }.pack('C*')
end
|
42
43
44
45
46
47
48
49
50
|
# File 'lib/zip/crypto/traditional_encryption.rb', line 42
def (mtime)
[].tap do ||
( - 2).times do
<< Random.rand(0..255)
end
<< (mtime.to_binary_dos_time & 0xff)
<< (mtime.to_binary_dos_time >> 8)
end.map { |x| encode x }.pack('C*')
end
|
#reset! ⇒ Object
60
61
62
|
# File 'lib/zip/crypto/traditional_encryption.rb', line 60
def reset!
reset_keys!
end
|