# crypto.bcrypt: allow very large passwords to be pre-hashed \(\#15955\) · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/9ee0a706da66e271ce0f79d00566dbe40b57b83e)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: 9ee0a706da66e271ce0f79d00566dbe40b57b83e

Requested commit: 9ee0a706da66e271ce0f79d00566dbe40b57b83e

Commit: 9ee0a706da66e271ce0f79d00566dbe40b57b83e

Tree: 78d131370e5af989a391194c7f379eee0abe4ae0

Author: Frank Denis

Committer: GitHub

## Message

```
crypto.bcrypt: allow very large passwords to be pre-hashed (#15955)

crypto.bcrypt: allow very large passwords to be pre-hashed

bcrypt has a slightly annoying limitation: passwords are limited
to 72 characters. In the original implementation, additional characters
are silently ignored.

When they care, applications adopt different strategies to work around
this, in incompatible ways.

Ideally, large passwords should be pre-hashed using a hash function that
hinders GPU attackers, and the hashed function should not be deterministic
in order to defeat shucking attacks.

This change improves the developer experience by adding a very explicit
`silently_truncate_password` option, that can be set to `false` in
order to do that automatically, and consistently across Zig applications.

By default, passwords are still truncated, so this is not a breaking
change.

Add some inline documentation for our beloved autodoc by the way.
```

## Parents

- [7e0a02ee2593d99236bc9a1ff98a8f957add6ec4](https://git.cafe/gitcafe/zig/commit/7e0a02ee2593d99236bc9a1ff98a8f957add6ec4?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/9ee0a706da66e271ce0f79d00566dbe40b57b83e?format=markdown)
