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

Obfuscate 64-bit integers #6

Open
cerbero90 opened this issue Mar 8, 2021 · 2 comments
Open

Obfuscate 64-bit integers #6

cerbero90 opened this issue Mar 8, 2021 · 2 comments

Comments

@cerbero90
Copy link

Hello and thank you for this great package :)

I tried to leverage it with 64-bit integers but I'm not expert enough with bitwise operations to make it work, any suggestions on how this would be possible?

Thank you in advance :)

@cerbero90
Copy link
Author

Also there are 2 questions I'd like to ask you:

  1. why are we multiplying the salted integer by 0x9e3b in transform()?
  2. we are keeping only the first 6 characters of the base64 encoded binary, what makes this algorithm work without the full base64 string?

Thank you for your time ❤️

@cerbero90
Copy link
Author

I ended up with this solution: https://gist.github.com/cerbero90/fb99f79570c413a05c5efa5aab6dd72e
it supports 32bit and 64bit integers but does not support negative integers, feedback is more than welcome :)

Regarding the question 2, base64 representation is enough to cover all 32bit integers with 6 characters, so we can safely remove the extra = symbols (correct me if I'm wrong).

Re question 1, I still haven't understood why we multiply by 0x9e3b

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

1 participant