-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdecrypt.cpp
More file actions
36 lines (31 loc) · 834 Bytes
/
decrypt.cpp
File metadata and controls
36 lines (31 loc) · 834 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#include <iostream>
#include <vector>
#include <string>
#include "cpp.h"
#include <algorithm>
using namespace std;
vector<int> decryptWorking(vector<int> img) {
vector<int> no;
for (int i = 0; i < img.size(); i += 3) {
int small = 255;
for (int j = 0; j < 3; j++) {
if (small > img[i + j]) {
small = img[i + j];
}
}
// cout << "Pixel Value: " << small << ", Extracted Bit: " << (small % 10) << endl; fr debug
int bit = small % 10;
if (bit == 0 || bit == 1) {
no.push_back(bit);
} else {
cout << "\033[3;34mStopped at invalid bit: " << bit << endl;
break;
}
}
cout<< "checking the no vector - ";
for(int n:no){
cout <<"\033[1;34m"<< n ;
}
cout << "\n";
return no;
}