Skip to content

sha-crypt: switch from rand to rand_core#720

Merged
tarcieri merged 1 commit intomasterfrom
sha-crypt/use-rand_core
Oct 16, 2025
Merged

sha-crypt: switch from rand to rand_core#720
tarcieri merged 1 commit intomasterfrom
sha-crypt/use-rand_core

Conversation

@tarcieri
Copy link
Copy Markdown
Member

Replaces the use of Distribution by first filling a buffer with random bytes, then encoding it as Base64.

It seems the Base64 encoding is directly consumed by the algorithm, or otherwise it would probably make sense to convert all usages of salt to be raw bytes. That warrants further investigation.

@tarcieri tarcieri force-pushed the sha-crypt/use-rand_core branch from 7dc1466 to 4da22c1 Compare October 16, 2025 00:21
Replaces the use of `Distribution` by first filling a buffer with random
bytes, then encoding it as Base64.

It seems the Base64 encoding is directly consumed by the algorithm, or
otherwise it would probably make sense to convert all usages of `salt`
to be raw bytes. That warrants further investigation.
@tarcieri tarcieri force-pushed the sha-crypt/use-rand_core branch from 4da22c1 to 1451d8e Compare October 16, 2025 00:27
@tarcieri tarcieri merged commit 272a125 into master Oct 16, 2025
64 checks passed
@tarcieri tarcieri deleted the sha-crypt/use-rand_core branch October 16, 2025 00:29
@tarcieri tarcieri mentioned this pull request Apr 21, 2026
tarcieri added a commit that referenced this pull request Apr 21, 2026
## Added
- Implement `core::error::Error` for error types (#719)
- Implement the `password-hash` crate traits (#771, #779, #806)
- Dynamic `Algorithm` support (#800)
- `Params` customization for `ShaCrypt` type (#801)
- `ShaCrypt::SHA256` and `ShaCrypt::SHA512` (#813)
- `no_alloc` support (#894)

## Changed
- `rounds` parameter is now `u32` (#500)
- Make hashing infallible (#500)
- Bump edition to 2024; MSRV 1.85 (#563)
- Switch from `rand` to `rand_core` (#720)
- Use `mcf` crate for implementing Modular Crypt Format (#726, #842)
- Unify `Params` type (#772)
- Rename `simple` feature to `password-hash` (#776)
- Migrate from `subtle` to `ctutils` (#845)
- Bump `password-hash` dependency to v0.6 (#848)
- Bump `sha2` to v0.11 (#872)

## Removed
- `std` feature (#719)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant