Documentation
¶
Index ¶
- Constants
- func EncryptedSize(fileSize int64) int64
- type AesCipher
- func (c *AesCipher) DecryptedSize(encryptedFileSize int64) (int64, error)
- func (c *AesCipher) EncryptedSize(fileSize int64) int64
- func (c *AesCipher) Open(ctx context.Context, rh *utils.RangeHeader, decryptedFileSize int64, ...) (io.ReadCloser, error)
- func (c *AesCipher) OverheadSize(fileSize int64) int64
Constants ¶
const BlockSize = 16
BlockSize is the AES block size in bytes (128 bits)
Variables ¶
This section is empty.
Functions ¶
func EncryptedSize ¶
EncryptedSize calculates the encrypted size for a given plaintext size. AES-CBC pads data to 16-byte block boundary.
Types ¶
type AesCipher ¶
type AesCipher struct{}
AesCipher handles AES-CBC decryption for encrypted archives Used for password-protected RAR, 7z, and other AES-encrypted archive formats
func (*AesCipher) DecryptedSize ¶
DecryptedSize calculates the decrypted size from encrypted size
func (*AesCipher) EncryptedSize ¶
EncryptedSize calculates the encrypted size for a given plaintext size
func (*AesCipher) Open ¶
func (c *AesCipher) Open( ctx context.Context, rh *utils.RangeHeader, decryptedFileSize int64, key []byte, iv []byte, getReader func(ctx context.Context, start, end int64) (io.ReadCloser, error), ) (io.ReadCloser, error)
Open creates a decrypting reader for AES-encrypted data decryptedFileSize is the actual file size (output will be limited to this)
func (*AesCipher) OverheadSize ¶
OverheadSize returns the encryption overhead for AES-CBC AES-CBC has minimal overhead (padding to block size)