Skip to content

Instantly share code, notes, and snippets.

@creative-cranels
Created September 27, 2016 09:36
Show Gist options
  • Save creative-cranels/e9e7b963dcdfd7ec4b380bf74ff0f14b to your computer and use it in GitHub Desktop.
Save creative-cranels/e9e7b963dcdfd7ec4b380bf74ff0f14b to your computer and use it in GitHub Desktop.
# c++
string sslCert = "some large random string"
int ssl_xor[10];
fill(ssl_xor, ssl_xor + 10, 0);
for (int i = 0; i < sslCert.size(); i += 10) {
for (int j = 0; j < 10 && i + j < sslCert.size(); j++) {
ssl_xor[j] = ssl_xor[j] ^ (int)sslCert[i + j];
}
}
wstring access_token = L"";
for (int i = 0; i < 10; i++)
access_token += to_wstring(ssl_xor[i]) + L"#";
# in ruby
ssl_xor = Array.new(10, 0)
(0..self.cert.length).step(10).each do |index|
j = 0
(0..9).each do |j|
break if index + j >= self.cert.length
ssl_xor[j] = ssl_xor[j] ^ self.cert[index + j].ord
end
end
self.access_token = ssl_xor.join('#')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment