question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Encryption, compression, etc.

See original GitHub issue

Hello.

I use bytenode for my project and through my usage, I have discovered one feature I would like looked into. I am not too happy how the script’s cachedData contains intact function names, variable names, and strings. I would just like a way to hide that information. It’s not like I store passwords in my code, but the function names and strings do expose how my program works.

I tried modifying this module with zlib to hide the raw data, but I encountered one error after another. That is why I am here.

An example of an exposed function:

... QfzȐ5   enableRemoteModuleGQc* ...

Some of the errors I confronted that I couldn’t solve (believe me, I tried):

ReferenceError: Require is not defined
Error: Invalid or incompatible cached data

Please note: after removing the zlib code everything works as expected.

If you are wondering why I don’t just use an obfuscator as the “middleware,” it is because the obfuscators I tried did not obfuscate regex. That was a big problem for me.

All help is appreciated.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
CrazyHoodlemcommented, Jan 23, 2021

Thanks, I had tried doing something like that earlier (but modifying the .jsc one, not creating a new one) and it had lots of errors. Your response made me try again, I realized I had an inconsistency in my code where I was inflating non-deflated files. Once I had that fixed, I still got a require is not defined error. Looking at your code more, I fixed the problem by changing

bytenode.compileCode(fs.readFileSync(filePath, 'utf8'))

to

bytenode.compileCode(
    Module.wrap(
        fs.readFileSync(filePath, 'utf8')).replace(/^#!.*/, "")
    )
);

Thank you, I have no more errors and my code works as expected.

1reaction
OsamaAbbascommented, Jan 23, 2021

I will look into it.

I like the idea too. =)

Read more comments on GitHub >

github_iconTop Results From Across the Web

What is the difference between Encryption and Compression ...
Encryption and compression work hand in hand. Encryption secures the data while it is at rest or in motion, and compression uses patterns...
Read more >
ANS-based compression and encryption with 128-bit security
Encryption is done for already compressed video/voice bitstreams using a full AES. This is expensive as it does not exploit potential benefits ...
Read more >
Efficient Compression and Encryption for Digital Data ...
These two operations are data compression and encryption. The aim of this work is to study the combination of compression and encryption ......
Read more >
Compression and Encryption: An Integrated Approach – IJERT
In this paper a brief review of both of these branches-compression and encryption, need of data compression and data encryption has been discussed....
Read more >
Encryption-then-Compression Systems using ... - arXiv
In this paper, we present a novel block scrambling-based image encryption scheme for EtC systems that enhances security compared with the ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found