dissect.fve.crypto.dmcrypt

Module Contents

Classes

CryptStream

Transparently decrypting stream.

class dissect.fve.crypto.dmcrypt.CryptStream(fh: BinaryIO, cipher: str, key: bytes, key_size: int | None = None, offset: int = 0, size: int | str | None = None, iv_tweak: int = 0, sector_size: int = 512)

Bases: dissect.util.stream.AlignedStream

Transparently decrypting stream.

Parameters:
  • fh – The original file-like object, usually the encrypted disk.

  • cipher – The cipher name/specification.

  • key – The encryption key.

  • key_size – Optional key size hint.

  • offset – Optional base offset to the encrypted region. Segment offset in LUKS.

  • size – Optional size hint. If None or "dynamic", determine the size by seeking to the end of fh.

  • iv_tweak – Optional IV tweak, or offset.

  • sector_size – Optional sector size. Defaults to 512.

fh
cipher
offset = 0
iv_tweak = 0
sector_size = 512