Skip to content

Commit b403acf

Browse files
authored
feat: implement obfuscation (#115)
1 parent f6b29bc commit b403acf

File tree

8 files changed

+1406
-100
lines changed

8 files changed

+1406
-100
lines changed

cpp/crypto.cpp

Lines changed: 34 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,37 @@
1+
#include "crypto.h"
2+
#include <string>
3+
#include "decryptor.h"
4+
#include "encrypted_functions.h"
5+
#include "password_functions.h"
16

2-
#include "crypto.h"
3-
#include <string>
4-
#include "decryptor.h"
7+
using namespace std;
58

6-
using namespace std;
9+
Crypto::Crypto()
10+
{
11+
}
12+
// Initialize all dummy data for obfuscation
13+
void initializeAllDummies()
14+
{
15+
initializePasswordDummies();
16+
initializeEncryptedDummies();
17+
}
18+
string Crypto::getJniJsonStringifyData(string key)
19+
{
20+
// Initialize dummy data (obfuscation)
21+
initializeAllDummies();
22+
std::string base64Secret = getEncryptedSecureData();
23+
std::string password = getPasswordSecureData();
24+
bool binary = false;
25+
std::string plaintext = decryptor::dec(base64Secret, password, binary);
726

8-
Crypto::Crypto() {
9-
10-
}
11-
12-
string Crypto::getJniJsonStringifyData(string key) {
13-
std::string base64Secret1 = "U2FsdGVkX19lgRN4srwXt2D2LYi+baTRYsKl2mygm7ASNIWFynY+bxsDrbKAr2MZnI0flTXS";
14-
std::string base64Secret2 = "DPWi+ilmqhX7RviqMInOjQ/dRUApNhJW3/Sqk0bymYdpGsZVFHIEEZVtzWgvGs0R6xxSgFN7";
15-
std::string base64Secret3 = "wxkm/50HMLQZFQt55CR4VItVw6nrLfXATPXRxSiLHSDXvsvUupzfYPAodZsxx9VxlWBZ7g==";
16-
std::string base64Secret = base64Secret1 + base64Secret2 + base64Secret3;
17-
std::string password = "u4IxXxapI6zg";
18-
bool binary = false;
19-
std::string plaintext = decryptor::dec(base64Secret, password,binary);
20-
21-
string hash;
22-
string halfString=base64Secret.substr(base64Secret.length()/2);
23-
if(key==halfString)
24-
{
25-
return plaintext;
26-
}
27-
else
28-
{
29-
return "";
30-
}
31-
}
32-
27+
string hash;
28+
string halfString = base64Secret.substr(base64Secret.length() / 2);
29+
if (key == halfString)
30+
{
31+
return plaintext;
32+
}
33+
else
34+
{
35+
return "";
36+
}
37+
}

cpp/encrypted_functions.h

Lines changed: 406 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)