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

Password generation #35

Open
hartois opened this issue Mar 22, 2019 · 4 comments
Open

Password generation #35

hartois opened this issue Mar 22, 2019 · 4 comments

Comments

@hartois
Copy link

hartois commented Mar 22, 2019

On Windows Andama on every execution, on different systems generate different ID, but same password.

@hartois
Copy link
Author

hartois commented Mar 22, 2019

Who generate password Proxy or client?
Help me please find place in sources

@YiannisBourkelis
Copy link
Owner

@hartois strange, password is generated on the client side, each time the application runs.
Probably it has to do with the internal implementation of random numbers distribution, inside the mingw.
Tested with compilers on osx/clang, linux/g++ and windows/vs c++ and works fine.

To find the problem with the mingw compiler, I think you should look inside the function where the random password is generated. It is located in 2 places:

  1. clientserver::generateRandomPassword(int length)
  2. std::string clientServerProtocol::generateRandomPassword(int length)

Probably with Mingw it always picks the same "Random" characters

@hartois
Copy link
Author

hartois commented Mar 22, 2019

Yes, after searching I found that problem in using rd() function in Mingw compiller.
For me I replace it to time(NULL) and get different passwords...

std::mt19937 mt = std::mt19937(time(NULL));

Сan you suggest some kind of another, more correct way?

Thanks

@YiannisBourkelis
Copy link
Owner

@hartois I don't know if this way it produces completely random passwords. Maybe std::mt19937 mt = std::mt19937(time_t(NULL)); might be better to clean the warning. It still needs investigation if it is ok.

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

No branches or pull requests

2 participants