Code Monkey home page Code Monkey logo

Comments (7)

firaja avatar firaja commented on May 29, 2024 1

Hi @GisoBartels thank you for providing a working example.

In the next days I will publish the fix for the issue. This might impact other projects but I think that very few people uses non-ASCII characters for their passwords.

from password4j.

firaja avatar firaja commented on May 29, 2024 1

Hi @GisoBartels 1.7.3 is released now!
Thank you for your support šŸš€

from password4j.

firaja avatar firaja commented on May 29, 2024

Hi @GisoBartels,

can you provide a working example for this issue?
Thank you

from password4j.

GisoBartels avatar GisoBartels commented on May 29, 2024

Sure. I noticed the problem through a failing test in an update PR. See here: GisoBartels/kaster#8
The test went green again, when I compiled the latest version with UTF-8 as default charset.

from password4j.

firaja avatar firaja commented on May 29, 2024

From what I see the PR is failing because of a test about password generation not password hashing.

org.junit.ComparisonFailure: expected:<[g9*RlE3CilUmDL$#tyhX]> but was:<[PRqOXQNjODPVVuz6Ol5&]>
at org.junit.Assert.assertEquals(Assert.java:117)
at kotlin.test.junit.JUnitAsserter.assertEquals(JUnitSupport.kt:32)
at kotlin.test.AssertionsKt__AssertionsKt.assertEquals(Assertions.kt:63)
at kotlin.test.AssertionsKt.assertEquals(Unknown Source)
at kotlin.test.AssertionsKt__AssertionsKt.assertEquals$default(Assertions.kt:62)
at kotlin.test.AssertionsKt.assertEquals$default(Unknown Source)
at app.passwordkaster.core.PasswordGenerationTest.testPassword(PasswordGenerationTest.kt:110)

I don't see Password4j involved in that test. Please report here a piece of code where Password4j is involved, with input, output and expected output (from external tools if needed). I'm not going to analyze and debug third party libraries šŸ˜ž

In 1.6.3 (and 1.7.x as well) we have a test with multi-byte unicodes and the test passed in all versions.
The string used was (ć£ļ¼¾ā–æļ¼¾)Ū¶\uD83C\uDF78\uD83C\uDF1F\uD83C\uDF7AŁ©(Ė˜ā—”Ė˜ ) āŒāŒ āŒāŒāŒ. So it's weird that a backtick is breaking the hashing process.

Have you tried to convert strings to bytes with a different encoding? Password4j accepts also byte[] as well.
In java:

Password4j.hash("my password".getBytes(StandardCharsets.UTF_8)).with(...);

from password4j.

GisoBartels avatar GisoBartels commented on May 29, 2024

I created a test, so you can debug for yourself. The test will go green, when the default charset is set to UTF-8
#127

from password4j.

GisoBartels avatar GisoBartels commented on May 29, 2024

Thanks for fixing quickly šŸ˜Š
I can confirm, that with the new version my tests are green again.

from password4j.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    šŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. šŸ“ŠšŸ“ˆšŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ā¤ļø Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.