Expose bounded operating-system cryptographic random bytes
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ó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Ít trao đổi
- Lĩnh vực
- operating-systems, security
Hướng nghiên cứu
Bắt đầu bằng việc đọc design.md và thống nhất cách đặt tên với module Random của basic-cli. Sử dụng điểm vào pf.Random.bytes! và các kiểm tra được liệt kê về độ dài bằng không, giới hạn tối đa, tính đồng thời, thành công/thất bại của host và các nền tảng native làm bản đồ xác thực. Được coi là hoàn tất khi các tiêu chí chấp nhận được đáp ứng trên Linux, macOS và Windows mà không để lộ các byte chưa đầy đủ hoặc trạng thái PRNG toàn cục có thể thay đổi.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
Expose cryptographically secure bytes from the operating system:
bytes = Random.bytes!(32)?
Illustrative API:
bytes! : U64 => Try(
List(U8),
[
EntropyUnavailable(IOErr),
TooManyBytes({ requested : U64, max : U64 }),
],
)
Exact names can be settled during implementation.
Why this belongs in the platform
Secure randomness is necessary for session identifiers, CSRF tokens, password-reset tokens, webhook secrets, and other conventional web application capabilities. Applications cannot implement it safely in pure Roc, and the platform is the only supported boundary through which they can access the operating system.
OWASP recommends a CSPRNG and at least 128 bits when an application creates session identifiers. A byte API avoids encouraging applications to concatenate or reinterpret a small integer seed.
This is a small, app-independent OS primitive with identical semantics on every target, so it meets the platform subsystem criteria in design.md.
Required contract
- Use the operating system's preferred cryptographic random source on Linux, macOS, and Windows.
- Return exactly the requested number of bytes or a typed failure; never return partial success.
bytes!(0)returnsOk([]).- Enforce a documented hard allocation bound before allocating. A proposed initial maximum is 64 KiB.
- Calls are safe under concurrent request handling.
- Do not expose a mutable global PRNG or require application-provided seeding.
- Do not log, inspect, or otherwise expose generated bytes on an error path.
- Coordinate naming with basic-cli's
Randommodule, while keeping this repository independently usable.
Tests
- Zero length, exact maximum, and over-maximum.
- Exact output length over representative sizes.
- Concurrent calls.
- Injected host success and failure paths.
- Native smoke coverage on Linux, macOS, and Windows.
- No statistical randomness tests: those do not validate the security of the OS source.
Non-goals
- Deterministic seeded random-number generation
- Probability distributions or random collection helpers
- UUIDs, tokens, Base64, or hexadecimal encoding
- Key derivation, hashing, signing, or encryption
- Arbitrarily large random buffers
Acceptance criteria
-
pf.Random.bytes!returns exact-length OS cryptographic randomness. - Allocation has a finite documented maximum and typed over-limit error.
- The operation has one cross-platform semantic contract.
- The implementation has no mutable process-global PRNG state.
- Failure and concurrency paths are covered.
References
- Ngôn ngữ chính
- HTML
- Star
- 110
- Fork
- 25
- Merge trung bình
- 18 giờ 28 phút
- Pull request đã merge (30 ngày)
- 16
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
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 roc-lang/basic-webserver
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
roc-lang/basic-webserver#277 ·
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
roc-lang/basic-webserver#274 ·
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 15/100
roc-lang/basic-webserver#273 ·
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 15/100
roc-lang/basic-webserver#272 ·
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 25/100
roc-lang/basic-webserver#265 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của roc-lang/basic-webserver
Issue tương tự
-
userRaised
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
eclipse-openj9/openj9#25285 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
macOS autosubmit enable passes unsupported --wait to launchctl bootoutCó thể đã có người làm @iqdoctor đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
junhoyeo/tokscale#1713 · 3 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 78/100
obra/episodic-memory#219 ·
-
bug low-priority
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
dividebysandwich/rust-dos#2688 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 1 ngày