Skip to content

Instantly share code, notes, and snippets.

@joshuashaffer
Created October 15, 2017 16:09
Show Gist options
  • Save joshuashaffer/9facdbf5445f7492afc6b0f13ba71c0b to your computer and use it in GitHub Desktop.
Save joshuashaffer/9facdbf5445f7492afc6b0f13ba71c0b to your computer and use it in GitHub Desktop.
Recover Steganography Code embedded in RGB Values. e is the bit position.
auto steganographer(vector<vector<long long>> r, int e) {
bool f[r.size() * r[0].size()],*t;
int z = 0;
for (i:r)
for (j:i)
for(l:{3,2,1,0})
if (e&(1<<l)) f[z++] = j >> 8*l & 1;
string s;
for (t = f; t < f + z; t += 7)
s += accumulate(t, t + 7, 0, [](int x, int y) { return (x << 1) + y; });
return s;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment