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
Randomised name generation #1873
Comments
I'm leaning toward saying no to this, because we want builds to be completely deterministic. It's not a bad idea though so I would encourage you to publish it and maybe we can link to it from the wiki somewhere even if we don't accept it into the official project. |
It's been done before. At one point we have a special NameGenerator that The level of obfuscation and the size penalty makes it not worth it so I On Wed, Jul 6, 2016 at 11:02 PM, Tyler Breisacher notifications@github.com
|
@acleung I've found a way to prototype it using reflection (to work around the package protection), by calling favors() followed by reset() to establish randomised values of |
I've actually considered adding this in as well. It makes it harder for malware to target your code if it is constantly changing. I was simply going to make a custom build to do this however. |
If there is enough interest, it is probably worth rewriting one. If it It impacted compressed size because the name generator does tricky things On Thu, Jul 7, 2016 at 5:42 AM, Chad Killingsworth <notifications@github.com
|
Isn't it enough to simply randomize the order of supported characters? |
It's what I used to do, before |
I have a working prototype, which I'll clean up and post as a PR if I it's likely to be accepted. |
Randomizing the support letters was the previous approach. It still have a On Mon, Jul 11, 2016 at 7:59 AM, Steve Spencer notifications@github.com
|
@supersteves can you relink to your patch? The earlier link isn't right. |
@dimvar I was linking to the comment above.
Effectively it's as if I've shuffled each subsection of the char arrays if it weren't for the Array.sort recent additions. By subsection I preserve the grouping of lowercase, uppercase and numbers, but reorder the array within those subsequences (sort-of preserving the same camelcase). This approach works well, but no patch yet, it's a reflection based prototype/hack in external code, I'll need to rework it into a PR and will only do it if it's likely to be of interest. |
It seems that your approach is what others in this thread also recommend, so yes, we'll likely accept it. |
I'm certain I've seen existing code that does this already. Let me see if I can get it open-sourced so you don't have to duplicate the work. |
OK, @blickly just assigned the issue to you. |
Great! |
Should be fixed by 2bb100f |
👍 Thanks! |
I'd like to be able to randomise the name generation such that two compilations result in entirely different names. This makes it harder to reverse-engineer the compilation since every continuous integration build of the software would have far less in common.
I propose either of the following, and will put together a PR if it would be likely to be accepted:
DefaultNameGenerator
andNameGenerator
public, and add a public accessor inCompilerOptions
(I'll supply my own, likely a subclass ofDefaultNameGenerator
)CompilerOption.randomiseNameGeneration
, and haveDefaultNameGenerator.reset()
shuffle instead of sort those two arrays.The text was updated successfully, but these errors were encountered: