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

how change size secret code #42

Open
masoudzeeb opened this issue Jan 28, 2020 · 0 comments
Open

how change size secret code #42

masoudzeeb opened this issue Jan 28, 2020 · 0 comments

Comments

@masoudzeeb
Copy link

masoudzeeb commented Jan 28, 2020

Hi
Unfortunately, all proxies fail to detect the state using the packet size of the protocol
Please advise how to resize the secret code so that the package cannot be identified

how change this code use66 char secret code?


let buf64 = Buffer.allocUnsafe(64);
			data.copy(buf64);
			let keyIv = Buffer.allocUnsafe(48);
			buf64.copy(keyIv, 0, 8);

			let decryptKey_client = Buffer.allocUnsafe(32);
			keyIv.copy(decryptKey_client, 0, 0);

			let decryptIv_client = Buffer.allocUnsafe(16);
			keyIv.copy(decryptIv_client, 0, 32);

			reverseInplace(keyIv);

			let encryptKey_client = Buffer.allocUnsafe(32);
			keyIv.copy(encryptKey_client, 0, 0);

			let encryptIv_client = Buffer.allocUnsafe(16);
			keyIv.copy(encryptIv_client, 0, 32);

			let binSecret = Buffer.from(configObj.secret, 'hex');

			decryptKey_client = crypto.createHash('sha256').update(Buffer.concat([decryptKey_client, binSecret])).digest();
			encryptKey_client = crypto.createHash('sha256').update(Buffer.concat([encryptKey_client, binSecret])).digest();

			socket.cipher_dec_client = crypto.createCipheriv('aes-256-ctr', decryptKey_client, decryptIv_client);
			socket.cipher_enc_client = crypto.createCipheriv('aes-256-ctr', encryptKey_client, encryptIv_client);

			let dec_auth_packet = socket.cipher_dec_client.update(buf64);
			socket.dcId = Math.abs(dec_auth_packet.readInt16LE(60)) - 1;

			for (var i = 0; i < 4; i++) {
				if (dec_auth_packet[56 + i] != 0xef) {
					socket.destroy();
					return;
				}
			}

			if (socket.dcId > 4 || socket.dcId < 0) {
				socket.destroy();
				return;
			}

			data = data.slice(64, data.length);
			socket.init = true;
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