scrypt: zeroize the B, V and T buffers before freeing them
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 55/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- cryptography, rust
- Lĩnh vực
- cryptography, security
Hướng nghiên cứu
The three heap buffers b in scrypt() and v and t in romix_sequential and romix_parallel are all in scrypt/src/lib.rs. Read how they are allocated and dropped, then check scrypt/Cargo.toml for an existing zeroize dependency. Done means each buffer is cleared before it is freed, and the existing scrypt test vectors still pass. Whether to gate this behind a zeroize feature is a maintainer decision, so ask in the issue first.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Version: scrypt 0.12.0. Master as of 2026-10-10 is the same (scrypt/src/lib.rs has the same allocations and no zeroize).
scrypt::scrypt allocates three heap buffers that hold password-derived data, then frees them without zeroizing:
binscrypt()(p * 128 * rbytes): the PBKDF2-HMAC-SHA256 output of the password and salt. ROMix mixes it in place, and it then becomes the salt of the final PBKDF2 step.vinromix_sequential/romix_parallel(N * 128 * rbytes, 256 MiB atlog_n = 18, r = 8).tin the same two functions (128 * rbytes).
After scrypt() returns, their contents stay in freed heap memory until something reuses it. This matters beyond ordinary hygiene. The first block of v is shuffle_in(B), a fixed permutation of the initial one-iteration PBKDF2 output. Anyone who later reads that freed memory, for example in a core dump, in swap or through a later allocation in the same process, can test password guesses for the cost of one PBKDF2-HMAC-SHA256 iteration each. That skips the memory-hard work scrypt exists to force.
Suggestion: zeroize b, v and t before they drop, either always or behind an optional zeroize feature like other RustCrypto crates. It costs one write pass over v, which is small next to the 2N BlockMix calls ROMix already makes.
Context: we use scrypt() as a passphrase KDF for file encryption (an age v1 scrypt stanza; log_n = 18, r = 8, p = 1).
- Ngôn ngữ chính
- Rust
- Star
- 920
- Fork
- 122
- Merge trung bình
- 52 phút
- Pull request đã merge (30 ngày)
- 11
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của RustCrypto/password-hashes
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
RustCrypto/password-hashes#926 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 38/100
RustCrypto/password-hashes#940 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
RustCrypto/password-hashes#924 · 3 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
RustCrypto/password-hashes#883 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 38/100
RustCrypto/password-hashes#573 · 5 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của RustCrypto/password-hashes
Issue tương tự
-
benchmark-review
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 63/100
Maintainer thường phản hồi trong vòng 1 ngày
-
area:filesystem bug need-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Captions panel does not offer to show an existing transcriptCó thể đã có người làm @thedavidweng đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
CapSoftware/Cap#4276 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
libracoder/kiri#364 ·
Maintainer thường phản hồi trong vòng 1 ngày