Пример #1
0
def decode_blob(blob):
    header = blob[:HEADER_WIDTH]
    body = blob[HEADER_WIDTH:]
    scheme = _unpack_header(header)
    decryption_oracle = get_decryption_oracle('BLOCK_ENCRYPTION_KEY')
    compressed_plaintext = decryption_oracle.decrypt(body, scheme)
    result = zlib.decompress(compressed_plaintext)
    return result
Пример #2
0
def decode_blob(blob):
    header = blob[:HEADER_WIDTH]
    body = blob[HEADER_WIDTH:]
    scheme = _unpack_header(header)
    decryption_oracle = get_decryption_oracle('BLOCK_ENCRYPTION_KEY')
    compressed_plaintext = decryption_oracle.decrypt(body, scheme)
    result = zlib.decompress(compressed_plaintext)
    return result
Пример #3
0
 def secret(self):
     with get_decryption_oracle('SECRET_ENCRYPTION_KEY') as d_oracle:
         return d_oracle.decrypt(
             self._secret,
             encryption_scheme=self.encryption_scheme)
Пример #4
0
 def secret(self):
     # type: () -> bytes
     with get_decryption_oracle("SECRET_ENCRYPTION_KEY") as d_oracle:
         return d_oracle.decrypt(
             self._secret, encryption_scheme=self.encryption_scheme
         )