pub struct TempPlaintext { /* private fields */ }Expand description
受控的临时明文文件,用于「以外部应用打开」。
§这个类型在防什么
把解密后的明文落盘给外部程序打开,会踩到三个旁路泄露
(见 docs/research/07-platform-and-sidechannels.md §3):
| 编号 | 泄露 | 本类型的对策 |
|---|---|---|
| L2 | 明文文件残留 | Drop 时删除;先覆写再删除(见下) |
| L3 | 系统缩略图缓存 | 目录写入 desktop.ini(Windows) |
| L5 | 搜索索引收录明文内容 | 目录标记不索引 |
§⚠️ 覆写删除的真实效力
TempPlaintext::shred 会在删除前用随机字节覆写文件。在现代存储上这不保证
数据真正消失:SSD 的 wear leveling 会把写入重定向到新的物理块,日志式文件系统
(APFS/Btrfs/ZFS)可能保留旧版本,快照更是直接留存。
它能挡住的是「文件被删除后用常规恢复工具捞回来」,挡不住物理取证。 本项目威胁模型已排除物理取证(N2/N3),因此这是成本合适的措施—— 但不能向用户宣称“安全擦除“。
Implementations§
Trait Implementations§
Source§impl Debug for TempPlaintext
impl Debug for TempPlaintext
Source§impl Drop for TempPlaintext
impl Drop for TempPlaintext
Auto Trait Implementations§
impl Forget for TempPlaintext
impl Freeze for TempPlaintext
impl RefUnwindSafe for TempPlaintext
impl Send for TempPlaintext
impl Sync for TempPlaintext
impl Unpin for TempPlaintext
impl UnsafeUnpin for TempPlaintext
impl UnwindSafe for TempPlaintext
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more