Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(bcrypt tool): Fix bcrypt error states and crashes (#1133) #1152

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

lionel-rowe
Copy link

Started out with fixing #1133, but I also found out it was super easy to crash the browser tab by setting the salt count to a high enough value. In light of that:

  • Switched from sync to async versions of the bcrypt functions.
  • Reduced max rounds to 20, as 100 is absurdly high (even 20 is absurdly high with current computing power).
  • I also added a timeout if hashing/comparing takes >10 seconds. That timeout kicks in somewhere between 16 and 17 rounds on my machine.
  • Updated visual progress/error states in the UI, including a progress bar and a message showing how long the function took to run.
  • In-progress functions are aborted if the user changes the inputs before they run to completion.

bcrypt

Copy link

vercel bot commented Jun 7, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
it-tools ✅ Ready (Inspect) Visit Preview Aug 9, 2024 0:19am

</n-form>
</c-card>
</template>

<style lang="less" scoped>
<style lang="less">
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couldn't get the styles to work due to CSS precedence rules while retaining scoped, so I passed an id to c-input-text, which is set on the <input> itself, allowing easier CSS targeting. It's not a great solution though... Open to suggestions of how to do it better without resorting to global styles or !important. Maybe c-input-text just needs finer-grained ways of styling it?

Copy link

sonarcloud bot commented Jun 8, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

Copy link

sonarcloud bot commented Aug 9, 2024

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